packages: fix nix-env not being in PATH; check if we nuke the microvm host on accident
This commit is contained in:
parent
27930ce873
commit
6c5830b591
11
packages.nix
11
packages.nix
|
@ -116,7 +116,7 @@ lib.attrsets.mapAttrs
|
|||
''}
|
||||
|
||||
if [[ $(ssh ${target} cat /etc/hostname) != ${name} ]]; then
|
||||
echo "hostname of the target machine does not match, please manually investiagte!"
|
||||
echo "hostname of the target machine does not match, please manually investigate!"
|
||||
echo " $(ssh ${target} cat /etc/hostname) != ${name}"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -126,7 +126,7 @@ lib.attrsets.mapAttrs
|
|||
# use nixos-rebuild from target config
|
||||
ssh ${target} bash -e <<END
|
||||
nix build ${toplevelDrvPath}
|
||||
nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
|
||||
${discardStringCtx hostConfig.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
|
||||
${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}"
|
||||
END
|
||||
'';
|
||||
|
@ -219,8 +219,13 @@ lib.attrsets.mapAttrs
|
|||
ssh ${target} bash -e <<END
|
||||
set -eou pipefail
|
||||
|
||||
if [[ $(cat /etc/hostname) != ${name} ]]; then
|
||||
echo "hostname of the target machine does not match, please manually investigate!"
|
||||
echo " $(ssh ${target} cat /etc/hostname) != ${name}"
|
||||
exit 1
|
||||
fi
|
||||
${discardStringCtx hostConfig.nix.package}/bin/nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
|
||||
${toplevelOutPath}/bin/switch-to-configuration "''${@:-switch}"
|
||||
nix-env -p /nix/var/nix/profiles/system --set ${toplevelOutPath}
|
||||
END
|
||||
# ^ yes, this is required to be like this
|
||||
|
||||
|
|
Loading…
Reference in New Issue