fix: build closure in build-step instead of on iso

This commit is contained in:
UGA Innovation Factory
2026-01-05 12:29:32 -05:00
parent 4c218190c3
commit b23525df78
2 changed files with 20 additions and 8 deletions

View File

@@ -20,6 +20,12 @@ let
targetConfig = self.nixosConfigurations.${hostName}.config;
targetSystem = targetConfig.system.build.toplevel;
diskoScript = targetConfig.system.build.diskoScript;
# Build the closure export at build time (not runtime in ISO)
closureExport = pkgs.runCommand "closure-export-${hostName}" { } ''
mkdir -p $out
${pkgs.nix}/bin/nix-store --export $(${pkgs.nix}/bin/nix-store -qR ${targetSystem}) > $out/closure.nar
'';
in
nixpkgs.lib.nixosSystem {
inherit system;
@@ -29,6 +35,7 @@ let
hostName
targetSystem
diskoScript
closureExport
;
hostPlatform = system;
};