Compare commits

..

1 commit

Author SHA1 Message Date
8658ec6a81
proxmox scripts: set experimental features rather than implicitly depending on them
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
2025-09-22 21:27:23 +02:00
4 changed files with 17 additions and 9 deletions

View file

@ -4,9 +4,10 @@
... ...
}: }:
let let
inherit (import ./constants.nix) pathToRoot pathFromRoot;
inherit (pkgs) system; inherit (pkgs) system;
deployment-config = { deployment-config = {
inherit (import ./constants.nix) pathToRoot; inherit pathToRoot pathFromRoot;
nodeName = "ssh"; nodeName = "ssh";
targetSystem = system; targetSystem = system;
sshOpts = [ ]; sshOpts = [ ];

View file

@ -4,9 +4,10 @@
... ...
}: }:
let let
inherit (import ./constants.nix) pathToRoot pathFromRoot;
inherit (pkgs) system; inherit (pkgs) system;
deployment-config = { deployment-config = {
inherit (import ./constants.nix) pathToRoot; inherit pathToRoot pathFromRoot;
nodeName = "target"; nodeName = "target";
targetSystem = system; targetSystem = system;
sshOpts = [ ]; sshOpts = [ ];

View file

@ -11,9 +11,15 @@ let
}; };
modules = [ configuration ]; modules = [ configuration ];
}; };
in toplevel =
{ {
inherit (eval) pkgs config options; inherit (eval) pkgs config options;
system = eval.config.system.build.toplevel; system = eval.config.system.build.toplevel;
inherit (eval.config.system.build) vm vmWithBootLoader; inherit (eval.config.system.build) vm vmWithBootLoader;
}
.config.system.build.toplevel;
in
{
drv_path = toplevel.drvPath;
out_path = toplevel;
} }

View file

@ -24,13 +24,13 @@ command=(nix-instantiate --show-trace "${nixos_conf}")
# INSTANTIATE # INSTANTIATE
# instantiate the config in /nix/store # instantiate the config in /nix/store
"${command[@]}" -A config.system.build.toplevel "${command[@]}" -A out_path
# get the realized derivation so we can deploy it # get the realized derivation to deploy
"${command[@]}" -A config.system.build.toplevel --eval --strict --json "${command[@]}" --show-trace --eval --strict --json
# FIXME explore import/readFile as ways to instantiate the derivation, potentially allowing to realize the store path up-front from Nix? # FIXME explore import/readFile as ways to instantiate the derivation, potentially allowing to realize the store path up-front from Nix?
outPath=$(nix-store --realize "$("${command[@]}" -A config.system.build.toplevel.drvPath --eval --strict --json | jq -r '.')") outPath=$(nix-store --realize "$("${command[@]}" --show-trace --eval --strict --json | jq -r '.drv_path')")
# deploy the config by nix-copy-closure # deploy the config by nix-copy-closure
NIX_SSHOPTS="${sshOpts[*]}" nix-copy-closure --to "$destination" "$outPath" --gzip --use-substitutes NIX_SSHOPTS="${sshOpts[*]}" nix-copy-closure --to "$destination" "$outPath" --gzip --use-substitutes
# switch the remote host to the config # switch the remote host to the config