migrate system scanning logic to lib/

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
2024-05-19 10:26:46 -04:00
committed by Alice Huston
parent 6b5dda1f39
commit 46aee20d9e
3 changed files with 49 additions and 49 deletions

View File

@ -166,32 +166,17 @@
);
in
{
inherit (self) outputs;
inherit (self) outputs; # for hydra
inherit lib; # for allowing use of custom functions in nix repl
hydraJobs = import ./hydra/jobs.nix { inherit inputs outputs; };
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
nixosConfigurations =
let
constructSystem = lib.rad-dev.systems.constructSystem;
genSystems = lib.rad-dev.systems.genSystems;
in
(builtins.listToAttrs (
map (system: {
name = system;
value = constructSystem (
{
inherit inputs src;
hostname = system;
}
// builtins.removeAttrs (import ./systems/${system} { inherit inputs; }) [
"hostname"
"server"
"home"
]
);
}) (lib.rad-dev.lsdir src "systems")
));
genSystems inputs src (src + "/systems");
devShell = lib.mapAttrs (
system: sopsPkgs: