diff options
author | lassulus <lassulus@lassul.us> | 2021-10-26 21:00:22 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-10-26 21:00:22 +0200 |
commit | fdbfd2d4eca520ddee23fe76c702a4d38021d00b (patch) | |
tree | b3e06ecb0807d3282461b2383b2bf536eef8e8d4 | |
parent | 64dd084c767feae2606db7b07b9d6127635704f3 (diff) |
l krops: use fancy deploy
-rw-r--r-- | lass/krops.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lass/krops.nix b/lass/krops.nix index fe5c00f3d..769112706 100644 --- a/lass/krops.nix +++ b/lass/krops.nix @@ -33,9 +33,23 @@ in { - # usage: $(nix-build --no-out-link --argstr name HOSTNAME -A deploy) - deploy = { target ? "root@${name}/var/src" }: pkgs.krops.writeDeploy "${name}-deploy" { + deploy = { target ? "root@${name}/var/src" }: pkgs.krops.writeCommand "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; }; + allocateTTY = true; inherit target; }; |