From 2dc172530965ea4f1ead8ff166004c5734daee1f Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 23 Oct 2019 16:01:38 +0200 Subject: krops: add writeCommand --- pkgs/krops/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/krops/default.nix b/pkgs/krops/default.nix index 85bf88c..13de4ce 100644 --- a/pkgs/krops/default.nix +++ b/pkgs/krops/default.nix @@ -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, -- cgit v1.2.3