summaryrefslogtreecommitdiffstats
path: root/lass/krops.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-12-04 19:27:27 +0100
committerjeschli <jeschli@gmail.com>2018-12-04 19:27:27 +0100
commit5030b74cc5c578bb82619a24592504a6008f1a10 (patch)
tree0551e3ddb94353b7438bec02174bf3379bc89b87 /lass/krops.nix
parent78b289201987675844aa37abeb4279eb4051ebe0 (diff)
parent82988de84c177c247ebbe80940c4d50b9f073b4e (diff)
Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'lass/krops.nix')
-rw-r--r--lass/krops.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/lass/krops.nix b/lass/krops.nix
index a898164c3..d64454ea5 100644
--- a/lass/krops.nix
+++ b/lass/krops.nix
@@ -5,8 +5,14 @@
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
+ (krebs-source { test = test; })
{
nixos-config.symlink = "stockholm/lass/1systems/${name}/physical.nix";
secrets = if test then {
@@ -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;