difftreelog
fix(readme) make basic example compilable
in: trunk
1 file changed
README.adocdiffbeforeafterboth30 inputs.nixpkgs.follows = "nixpkgs";30 inputs.nixpkgs.follows = "nixpkgs";31 };31 };32 };32 };33 outputs = inputs: flake-parts.lib.mkFlake { inherit inputs; } {33 outputs = inputs @ {34 nixpkgs,35 flake-parts,36 lanzaboote,37 ...38 }:39 flake-parts.lib.mkFlake {inherit inputs;} {34 imports = [inputs.fleet.flakeModules.default];40 imports = [inputs.fleet.flakeModules.default];354136 perSystem = {pkgs, system, ...}: {42 perSystem = {43 pkgs,44 system,45 ...46 }: {37 _module.args.pkgs = import nixpkgs { inherit system; };47 _module.args.pkgs = import nixpkgs {inherit system;};384839 formatter = pkgs.alejandra;49 formatter = pkgs.alejandra;40 devShells.default = pkgs.mkShell {50 devShells.default = pkgs.mkShell {41 packages = [51 packages = [inputs.fleet.packages.${system}.fleet];42 inputs.fleet.packages.${system}.fleet43 ];52 };44 };53 };45 };465447 # Single flake may contain multiple fleet configurations, default one is called... `default`55 # Single flake may contain multiple fleet configurations, default one is called... `default`48 fleetConfigurations.default = {56 fleetConfigurations.default = {49 # nixpkgs used to build the systems57 # nixpkgs used to build the systems50 nixpkgs.buildUsing = nixpkgs;58 nixpkgs.buildUsing = nixpkgs;51 52 # nixos option section of fleet config declares module, which is used for all configured nixos hosts.53 nixos.imports = [54 lanzaboote.nixosModules.lanzaboote55 {56 # Make `nix shell nixpkgs#thing` use the same nixpkgs, as used to build the system.57 nix.registry.nixpkgs = {58 from = { id = "nixpkgs"; type = "indirect"; };59 flake = nixpkgs;60 exact = false;61 };62 }63 ];645965 # Those modules are used to configure all the machines in cluster at the same time, good example of global modules60 # nixos option section of fleet config declares module, which is used for all configured nixos hosts.66 # Is I.e wiring up the mesh VPN, or deploying kubernetes, or other things.67 #68 # Modules use the same semantics as standard nixos module system, they are just configuring all the hosts at once.69 imports = [70 ./wireguard71 # Multi-instancible modules example72 (import ./kubernetes {hosts = ["a" "b"];})73 (import ./kubernetes {hosts = ["c" "d"];})74 ];7576 # Hosts attribute (may also be defined/extended using modules attribute) configures hosts...77 hosts.controlplane-1 = {78 # Every host has some system, for which the system configuration needs to be built79 system = "x86_64-linux";80 # And nixos modules81 nixos.imports = [61 nixos.imports = [82 ./controlplane-1/hardware-configuration.nix62 lanzaboote.nixosModules.lanzaboote83 ./controlplane-1/configuration.nix84 # Configuration may also be specified inline, as in any nixos config.85 {63 {86 services.ray = {64 # Make `nix shell nixpkgs#thing` use the same nixpkgs, as used to build the system.65 nix.registry.nixpkgs = {66 from = {67 id = "nixpkgs";68 type = "indirect";69 };87 gpus = 4;70 flake = nixpkgs;88 cpus = 128;71 exact = false;89 };72 };90 }73 }91 ];74 ];7576 # Those modules are used to configure all the machines in cluster at the same time, good example of global modules77 # Is I.e wiring up the mesh VPN, or deploying kubernetes, or other things.78 #79 # Modules use the same semantics as standard nixos module system, they are just configuring all the hosts at once.80 imports = [81 ./wireguard82 # Multi-instancible modules example83 (import ./kubernetes {hosts = ["a" "b"];})84 (import ./kubernetes {hosts = ["c" "d"];})85 ];8687 # Hosts attribute (may also be defined/extended using modules attribute) configures hosts...88 hosts.controlplane-1 = {89 # Every host has some system, for which the system configuration needs to be built90 system = "x86_64-linux";91 # And nixos modules92 nixos.imports = [93 ./controlplane-1/hardware-configuration.nix94 ./controlplane-1/configuration.nix95 # Configuration may also be specified inline, as in any nixos config.96 {97 services.ray = {98 gpus = 4;99 cpus = 128;100 };101 }102 ];103 };92 };104 };93 };105 };94 };95}106}96----107----97108