l krops: use fancy deploy
This commit is contained in:
parent
64dd084c76
commit
fdbfd2d4ec
@ -33,9 +33,23 @@
|
|||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
# usage: $(nix-build --no-out-link --argstr name HOSTNAME -A deploy)
|
deploy = { target ? "root@${name}/var/src" }: pkgs.krops.writeCommand "deploy" {
|
||||||
deploy = { target ? "root@${name}/var/src" }: pkgs.krops.writeDeploy "${name}-deploy" {
|
command = targetPath: ''
|
||||||
|
|
||||||
|
set -fu
|
||||||
|
|
||||||
|
outDir=$(mktemp -d)
|
||||||
|
trap "rm -rf $outDir;" INT TERM EXIT
|
||||||
|
|
||||||
|
nix build \
|
||||||
|
-I "${targetPath}" \
|
||||||
|
-f '<nixpkgs/nixos>' config.system.build.toplevel \
|
||||||
|
-o "$outDir/out"
|
||||||
|
|
||||||
|
$outDir/out/bin/switch-to-configuration switch
|
||||||
|
'';
|
||||||
source = source { test = false; };
|
source = source { test = false; };
|
||||||
|
allocateTTY = true;
|
||||||
inherit target;
|
inherit target;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user