nixos-config/nix/buildAllNixosConfigurations.nix
Ingolf Wagner 40854dd628
All checks were successful
Build all NixOS Configurations / nix build (push) Successful in 11m56s
🔨 add addSys from ˈt͡sɛːzaɐ
2024-11-28 13:47:17 +07:00

30 lines
825 B
Nix

# buid all system locally is part of `nix flake check` with this flake parrt.
# todo make this an application : `nix run .#buildAllNixosConfigurations`
{ inputs, self, ... }:
{
perSystem =
{
pkgs,
system,
lib,
...
}:
with lib;
{
checks =
let
all = attrNames self.nixosConfigurations;
linkFor = sys: "ln -s ${self.nixosConfigurations.${sys}.config.system.build.toplevel} $out/${sys}";
links = filt: builtins.concatStringsSep "\n" (map linkFor (filter (name: filt name) all));
toplevels =
filt:
pkgs.runCommandLocal "toplevels" { } ''
mkdir $out
${links filt}
'';
in
{
buildAllNixosConfigurations = toplevels (_: true);
};
};
}