diff options
author | tv <tv@krebsco.de> | 2018-11-27 11:47:54 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-11-27 11:47:54 +0100 |
commit | c4fabb0bc40e270f7d34a06115b121ef879fc2d1 (patch) | |
tree | d745b162ca3fed36057a1d6aa7d4b4b591d76107 /lass/krops.nix | |
parent | 09144f173677ed33850e484cf46876d13bb37c9e (diff) | |
parent | eef1d7877defd7c310dc20f62bf96c7b8f408044 (diff) |
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'lass/krops.nix')
-rw-r--r-- | lass/krops.nix | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lass/krops.nix b/lass/krops.nix index a898164c3..c2669c8f2 100644 --- a/lass/krops.nix +++ b/lass/krops.nix @@ -5,6 +5,12 @@ pkgs ; + host-source = if lib.pathExists (./. + "/1systems/${name}/source.nix") then + import (./. + "/1systems/${name}/source.nix") { inherit lib pkgs; } + else + {} + ; + source = { test }: lib.evalSource [ krebs-source { @@ -18,15 +24,24 @@ }; }; } + host-source ]; in { + # usage: $(nix-build --no-out-link --argstr name HOSTNAME -A deploy) deploy = { target ? "root@${name}/var/src" }: pkgs.krops.writeDeploy "${name}-deploy" { source = source { test = false; }; inherit target; }; + # usage: $(nix-build --no-out-link --argstr name HOSTNAME --argstr target PATH -A populate) + populate = { target, force ? false }: pkgs.populate { + inherit force; + source = source { test = false; }; + target = lib.mkTarget target; + }; + # usage: $(nix-build --no-out-link --argstr name HOSTNAME --argstr target PATH -A test) test = { target }: pkgs.krops.writeTest "${name}-test" { force = true; |