forked from fediversity/fediversity
Compare commits
3 commits
8658ec6a81
...
46709d03d3
| Author | SHA1 | Date | |
|---|---|---|---|
| 46709d03d3 | |||
| 404ad12533 | |||
| ba95bae430 |
6 changed files with 12 additions and 20 deletions
|
|
@ -4,10 +4,9 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (import ./constants.nix) pathToRoot pathFromRoot;
|
||||
inherit (pkgs) system;
|
||||
deployment-config = {
|
||||
inherit pathToRoot pathFromRoot;
|
||||
inherit (import ./constants.nix) pathToRoot;
|
||||
nodeName = "ssh";
|
||||
targetSystem = system;
|
||||
sshOpts = [ ];
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (import ./constants.nix) pathToRoot pathFromRoot;
|
||||
inherit (pkgs) system;
|
||||
deployment-config = {
|
||||
inherit pathToRoot pathFromRoot;
|
||||
inherit (import ./constants.nix) pathToRoot;
|
||||
nodeName = "target";
|
||||
targetSystem = system;
|
||||
sshOpts = [ ];
|
||||
|
|
|
|||
|
|
@ -11,15 +11,9 @@ let
|
|||
};
|
||||
modules = [ configuration ];
|
||||
};
|
||||
toplevel =
|
||||
{
|
||||
inherit (eval) pkgs config options;
|
||||
system = eval.config.system.build.toplevel;
|
||||
inherit (eval.config.system.build) vm vmWithBootLoader;
|
||||
}
|
||||
.config.system.build.toplevel;
|
||||
in
|
||||
{
|
||||
drv_path = toplevel.drvPath;
|
||||
out_path = toplevel;
|
||||
inherit (eval) pkgs config options;
|
||||
system = eval.config.system.build.toplevel;
|
||||
inherit (eval.config.system.build) vm vmWithBootLoader;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ command=(nix-instantiate --show-trace "${nixos_conf}")
|
|||
|
||||
# INSTANTIATE
|
||||
# instantiate the config in /nix/store
|
||||
"${command[@]}" -A out_path
|
||||
"${command[@]}" -A config.system.build.toplevel
|
||||
|
||||
# get the realized derivation to deploy
|
||||
"${command[@]}" --show-trace --eval --strict --json
|
||||
# get the realized derivation so we can deploy it
|
||||
"${command[@]}" -A config.system.build.toplevel --eval --strict --json
|
||||
|
||||
# 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[@]}" --show-trace --eval --strict --json | jq -r '.drv_path')")
|
||||
outPath=$(nix-store --realize "$("${command[@]}" -A config.system.build.toplevel.drvPath --eval --strict --json | jq -r '.')")
|
||||
# deploy the config by nix-copy-closure
|
||||
NIX_SSHOPTS="${sshOpts[*]}" nix-copy-closure --to "$destination" "$outPath" --gzip --use-substitutes
|
||||
# switch the remote host to the config
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ grab_vm_options () {
|
|||
printf 'Grabing VM options for VM %s...\n' "$vm_name"
|
||||
|
||||
options=$(
|
||||
nix eval \
|
||||
nix --extra-experimental-features 'nix-command flakes' eval \
|
||||
--impure --raw --expr "
|
||||
builtins.toJSON (builtins.getFlake (builtins.toString ./.)).vmOptions.$vm_name
|
||||
" \
|
||||
|
|
@ -220,7 +220,7 @@ build_iso () {
|
|||
nix_host_keys=
|
||||
fi
|
||||
|
||||
nix build \
|
||||
nix --extra-experimental-features 'nix-command flakes' build \
|
||||
--impure --expr "
|
||||
let flake = builtins.getFlake (builtins.toString ./.); in
|
||||
import ./infra/makeInstallerIso.nix {
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ grab_vm_options () {
|
|||
printf 'Grabing VM options for VM %s...\n' "$vm_name"
|
||||
|
||||
options=$(
|
||||
nix eval \
|
||||
nix --extra-experimental-features 'nix-command flakes' eval \
|
||||
--impure --raw --expr "
|
||||
builtins.toJSON (builtins.getFlake (builtins.toString ./.)).vmOptions.$vm_name
|
||||
" \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue