forked from Fediversity/Fediversity
ditch superfluous substituters
This commit is contained in:
parent
7a7343f0ea
commit
4d85dd96f2
2 changed files with 4 additions and 28 deletions
|
@ -84,8 +84,6 @@ in
|
|||
in
|
||||
# import "${pathToRoot}/deployment/nixos.nix" {}
|
||||
{
|
||||
substituters = builtins.concatStringsSep " " os.config.nix.settings.substituters;
|
||||
trusted_public_keys = builtins.concatStringsSep " " os.config.nix.settings.trusted-public-keys;
|
||||
drv_path = os.config.system.build.toplevel.drvPath;
|
||||
out_path = os.config.system.build.toplevel;
|
||||
}
|
||||
|
@ -97,21 +95,16 @@ in
|
|||
json="$("''${command[@]}" --eval --strict --json)"
|
||||
|
||||
# DEPLOY
|
||||
declare substituters trusted_public_keys drv_path
|
||||
declare drv_path
|
||||
# set our variables using the json object
|
||||
eval "export $(echo $json | jq -r 'to_entries | map("\(.key)=\(.value)") | @sh')"
|
||||
host="root@${nodeName}"
|
||||
buildArgs=(
|
||||
--option extra-binary-caches https://cache.nixos.org/
|
||||
--option substituters $substituters
|
||||
--option trusted-public-keys $trusted_public_keys
|
||||
)
|
||||
sshOpts=(
|
||||
-o BatchMode=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
# get the realized derivation to deploy
|
||||
outPath=$(nix-store --realize "$drv_path" "''${buildArgs[@]}")
|
||||
outPath=$(nix-store --realize "$drv_path")
|
||||
# deploy the config by nix-copy-closure
|
||||
NIX_SSHOPTS="''${sshOpts[*]}" nix-copy-closure --to "$host" "$outPath" --gzip --use-substitutes
|
||||
# switch the remote host to the config
|
||||
|
|
21
paste
21
paste
|
@ -1,12 +1,9 @@
|
|||
declare substituters trusted_public_keys drv_path
|
||||
|
||||
declare drv_path
|
||||
host="root@fedi203.abundos.eu"
|
||||
|
||||
sshOpts=(
|
||||
-o BatchMode=yes
|
||||
-o StrictHostKeyChecking=no
|
||||
)
|
||||
|
||||
command=(nix-instantiate --expr '
|
||||
let
|
||||
sources = import ./npins;
|
||||
|
@ -33,27 +30,13 @@ command=(nix-instantiate --expr '
|
|||
};
|
||||
in
|
||||
{
|
||||
substituters = builtins.concatStringsSep " " os.config.nix.settings.substituters;
|
||||
trusted_public_keys = builtins.concatStringsSep " " os.config.nix.settings.trusted-public-keys;
|
||||
drv_path = os.config.system.build.toplevel.drvPath;
|
||||
out_path = os.config.system.build.toplevel;
|
||||
}
|
||||
')
|
||||
|
||||
buildArgs=(
|
||||
--option extra-binary-caches https://cache.nixos.org/
|
||||
--option substituters "$substituters"
|
||||
--option trusted-public-keys "$trusted_public_keys"
|
||||
)
|
||||
|
||||
"${command[@]}" -A out_path
|
||||
|
||||
json="$("${command[@]}" --eval --strict --json)"
|
||||
|
||||
eval "export $(echo $json | jq -r 'to_entries | map("\(.key)=\(.value)") | @sh')"
|
||||
|
||||
outPath=$(nix-store --realize "$drv_path" "${buildArgs[@]}")
|
||||
|
||||
outPath=$(nix-store --realize "$drv_path")
|
||||
NIX_SSHOPTS="${sshOpts[*]}" nix-copy-closure --to "$host" "$outPath" --gzip --use-substitutes
|
||||
|
||||
ssh "${sshOpts[@]}" "$host" "nix-env --profile /nix/var/nix/profiles/system --set $outPath; $outPath/bin/switch-to-configuration switch"
|
||||
|
|
Loading…
Add table
Reference in a new issue