git.delta.rocks / jrsonnet / refs/commits / c6d77aa9f34e

difftreelog

source

lib/default.nix1.3 KiBsourcehistory
1{2  fleetConfiguration = { common ? { modules = []; }, hosts, nixpkgs }@args:3    rec {4      root = nixpkgs.lib.evalModules {5        modules = [6          (7            { ... }: {8              config = {9                inherit hosts;10                # Secret data is available only via fleet build-systems11                secrets = if builtins?getEnv then12                  let13                    stringData = builtins.getEnv "SECRET_DATA";14                  in15                    if stringData != "" then (builtins.fromJSON stringData) else {}16                else {};17              };1819            }20          )21        ] ++ common.modules ++ import ../modules/modules.nix {22          pkgs = nixpkgs;23          lib = nixpkgs.lib;24        };2526        specialArgs = {27          fleet = import ./fleetLib.nix {28            inherit nixpkgs hosts;29          };30        };31      };32      configuredHosts = root.config.hosts;33      configuredSecrets = root.config.secrets;34      configuredSystems = nixpkgs.lib.listToAttrs (35        map (36          name: {37            inherit name; value = nixpkgs.lib.nixosSystem {38            system = configuredHosts.${name}.system;39            modules = configuredHosts.${name}.modules;40          };41          }42        ) (builtins.attrNames hosts)43      ); #nixpkgs.lib.nixosSystem {}44    };45}