aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-09-16 01:53:53 +0200
committertv <tv@krebsco.de>2018-09-16 01:53:53 +0200
commit5cd8bd046e9f8e5f03453e3c49161a9901787649 (patch)
tree822db10520e02bfb23fe4327618d6f2cee136ddc /pkgs
parentc46166d407c7d246112f13346621a3fbdb25889e (diff)
pkgs.krops: add rebuildv1.4.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/krops/default.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix
index 98d7e17..6bef6e1 100644
--- a/pkgs/krops/default.nix
+++ b/pkgs/krops/default.nix
@@ -2,7 +2,19 @@ let
lib = import ../../lib;
in
-{ nix, openssh, populate, writeDash, writeJSON }: {
+{ exec, nix, openssh, populate, writeDash, writeJSON }: rec {
+
+ rebuild = target:
+ exec "rebuild.${target.host}" rec {
+ filename = "${openssh}/bin/ssh";
+ argv = [
+ filename
+ "-l" target.user
+ "-p" target.port
+ target.host
+ "nixos-rebuild switch -I ${lib.escapeShellArg target.path}"
+ ];
+ };
writeDeploy = name: { source, target }: let
target' = lib.mkTarget target;
@@ -10,9 +22,7 @@ in
writeDash name ''
set -efu
${populate { inherit source; target = target'; }}
- ${openssh}/bin/ssh \
- ${target'.user}@${target'.host} -p ${target'.port} \
- nixos-rebuild switch -I ${target'.path}
+ ${rebuild target'}
'';
writeTest = name: { source, target }: let