krops: add writeCommand

This commit is contained in:
lassulus 2019-10-23 16:01:38 +02:00
parent 3d59510ac2
commit 2dc1725309
1 changed files with 15 additions and 0 deletions

View File

@ -30,6 +30,21 @@ in
];
};
writeCommand = name: {
command ? (targetPath: "echo ${targetPath}"),
backup ? false,
force ? false,
source,
target
}: let
target' = lib.mkTarget target;
in
writeDash name ''
set -efu
${populate { inherit backup force source; target = target'; }}
${remoteCommand target' (command target'.path)}
'';
writeDeploy = name: {
backup ? false,
fast ? false,