embed systems in the installers again

This commit is contained in:
Charlotte 🦝 Delenk 2024-11-16 10:00:43 +01:00
parent a3a8951f00
commit ca1515a89f
2 changed files with 30 additions and 12 deletions

View file

@ -3,8 +3,20 @@
config,
pkgs,
nixpkgs,
pureInputs,
...
}:
let
dependencies = [
nixos-config.nixosConfigurations.not522.config.system.build.toplevel
nixos-config.nixosConfigurations.not522.config.system.build.diskoScript
nixos-config.nixosConfigurations.not522.config.system.build.diskoScript.drvPath
nixos-config.nixosConfigurations.not522.pkgs.stdenv.drvPath
(nixos-config.nixosConfigurations.not522.pkgs.closureInfo { rootPaths = [ ]; }).drvPath
] ++ map (i: i.outPath) (builtins.filter builtins.isAttrs (builtins.attrValues pureInputs));
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
in
{
networking.hostName = "not522-installer";
imports = [
@ -17,8 +29,7 @@
system.stateVersion = config.system.nixos.version;
#environment.etc."system/not522".source = "${nixos-config.nixosConfigurations.not522.config.system.build.toplevel}";
#environment.etc."system/not522-disko".source = "${nixos-config.nixosConfigurations.not522.config.system.build.diskoScript}";
environment.etc."install-closure".source = "${closureInfo}/store-paths";
environment.systemPackages = [
(pkgs.writeShellScriptBin "install-nixos-unattended" ''

View file

@ -2,8 +2,24 @@
config,
nixos-config,
pkgs,
pureInputs,
...
}:
let
getDeps = name: [
nixos-config.nixosConfigurations.${name}.config.system.build.toplevel
nixos-config.nixosConfigurations.${name}.config.system.build.diskoScript
nixos-config.nixosConfigurations.${name}.config.system.build.diskoScript.drvPath
nixos-config.nixosConfigurations.${name}.pkgs.stdenv.drvPath
(nixos-config.nixosConfigurations.${name}.pkgs.closureInfo { rootPaths = [ ]; }).drvPath
];
dependencies =
(getDeps "rainbow-resort")
++ (getDeps "thinkrac")
++ map (i: i.outPath) (builtins.filter builtins.isAttrs (builtins.attrValues pureInputs));
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
in
{
networking.hostName = "pc-installer";
imports = [
@ -32,16 +48,7 @@
];
};
isInstaller = true;
/*
environment.etc."system/rainbow-resort".source = "${nixos-config.nixosConfigurations.rainbow-resort.config.system.build.toplevel
}";
environment.etc."system/rainbow-resort-disko".source = "${nixos-config.nixosConfigurations.rainbow-resort.config.system.build.diskoScript
}";
environment.etc."system/thinkrac".source = "${nixos-config.nixosConfigurations.thinkrac.config.system.build.toplevel
}";
environment.etc."system/thinkrac-disko".source = "${nixos-config.nixosConfigurations.thinkrac.config.system.build.diskoScript
}";
*/
environment.etc."install-closure".source = "${closureInfo}/store-paths";
environment.systemPackages = [
(pkgs.writeShellScriptBin "install-thinkrac-unattended" ''
set -eux