From ca1515a89f633a37729405f201752195a47a3e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sat, 16 Nov 2024 10:00:43 +0100 Subject: [PATCH] embed systems in the installers again --- machine/not522/installer/default.nix | 15 +++++++++++++-- machine/pc-installer/default.nix | 27 +++++++++++++++++---------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/machine/not522/installer/default.nix b/machine/not522/installer/default.nix index 05809852..9c22815d 100644 --- a/machine/not522/installer/default.nix +++ b/machine/not522/installer/default.nix @@ -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" '' diff --git a/machine/pc-installer/default.nix b/machine/pc-installer/default.nix index 11399e9b..2087456e 100644 --- a/machine/pc-installer/default.nix +++ b/machine/pc-installer/default.nix @@ -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