git.delta.rocks / jrsonnet / refs/commits / 9e7bb975c3c5

difftreelog

feat(readme) minimize example

Petr Portnov2024-11-11parent: #6899c70.patch.diff
in: trunk

1 file changed

modifiedREADME.adocdiffbeforeafterboth
30 inputs.nixpkgs.follows = "nixpkgs";30 inputs.nixpkgs.follows = "nixpkgs";
31 };31 };
32 };32 };
33 outputs = inputs @ {33 outputs = inputs:
34 nixpkgs,
35 flake-parts,
36 lanzaboote,
37 ...
38 }:
39 flake-parts.lib.mkFlake {inherit inputs;} {34 inputs.flake-parts.lib.mkFlake {inherit inputs;} {
40 imports = [inputs.fleet.flakeModules.default];35 imports = [inputs.fleet.flakeModules.default];
4136
42 perSystem = {37 perSystem = {
38 inputs',
43 pkgs,39 pkgs,
44 system,40 system,
45 ...41 ...
46 }: {42 }: {
47 _module.args.pkgs = import nixpkgs {inherit system;};
48
49 formatter = pkgs.alejandra;43 formatter = pkgs.alejandra;
50 devShells.default = pkgs.mkShell {44 devShells.default =
51 packages = [inputs.fleet.packages.${system}.fleet];45 pkgs.mkShell {packages = [inputs'.fleet.packages.fleet];};
52 };
53 };46 };
5447
55 # Single flake may contain multiple fleet configurations, default one is called... `default`48 # Single flake may contain multiple fleet configurations, default one is called... `default`
56 fleetConfigurations.default = {49 fleetConfigurations.default = {
57 # nixpkgs used to build the systems50 # nixpkgs used to build the systems
58 nixpkgs.buildUsing = nixpkgs;51 nixpkgs.buildUsing = inputs.nixpkgs;
5952
60 # nixos option section of fleet config declares module, which is used for all configured nixos hosts.53 # nixos option section of fleet config declares module, which is used for all configured nixos hosts.
61 nixos.imports = [54 nixos = {
62 lanzaboote.nixosModules.lanzaboote55 imports = [inputs.lanzaboote.nixosModules.lanzaboote];
63 {56
64 # Make `nix shell nixpkgs#thing` use the same nixpkgs, as used to build the system.57 # Make `nix shell nixpkgs#thing` use the same nixpkgs, as used to build the system.
65 nix.registry.nixpkgs = {58 nix.registry.nixpkgs = {
66 from = {59 from = {
67 id = "nixpkgs";60 id = "nixpkgs";
68 type = "indirect";61 type = "indirect";
69 };
70 flake = nixpkgs;
71 exact = false;
72 };62 };
73 }63 flake = inputs.nixpkgs;
64 exact = false;
65 };
74 ];66 };
7567
76 # Those modules are used to configure all the machines in cluster at the same time, good example of global modules68 # Those modules are used to configure all the machines in cluster at the same time, good example of global modules
77 # Is I.e wiring up the mesh VPN, or deploying kubernetes, or other things.69 # Is I.e wiring up the mesh VPN, or deploying kubernetes, or other things.
88 hosts.controlplane-1 = {80 hosts.controlplane-1 = {
89 # Every host has some system, for which the system configuration needs to be built81 # Every host has some system, for which the system configuration needs to be built
90 system = "x86_64-linux";82 system = "x86_64-linux";
91 # And nixos modules83 nixos = {
84 # And nixos modules
92 nixos.imports = [85 imports = [
93 ./controlplane-1/hardware-configuration.nix86 ./controlplane-1/hardware-configuration.nix
94 ./controlplane-1/configuration.nix87 ./controlplane-1/configuration.nix
88 ];
95 # Configuration may also be specified inline, as in any nixos config.89 # Configuration may also be specified inline, as in any nixos config.
96 {90 services.ray = {
97 services.ray = {
98 gpus = 4;91 gpus = 4;
99 cpus = 128;92 cpus = 128;
100 };93 };
101 }94 };
102 ];
103 };95 };
104 };96 };
105 };97 };