diff options
author | makefu <github@syntax-fehler.de> | 2018-06-14 21:54:55 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2018-06-14 21:54:55 +0200 |
commit | d98e41a4d70755b10d123678250bb6353b53b5bd (patch) | |
tree | b64f54fcba0bcf31b4962632803634a57b5df0a7 /lass/krops.nix | |
parent | 8cad4d187446901206e8110d27d1763c2df942d2 (diff) | |
parent | 006a3174eccecfee96e7b4fb9c818043a0334535 (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'lass/krops.nix')
-rw-r--r-- | lass/krops.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lass/krops.nix b/lass/krops.nix new file mode 100644 index 000000000..776a3a55d --- /dev/null +++ b/lass/krops.nix @@ -0,0 +1,42 @@ +{ config ? config, name }: let + inherit (import ../krebs/krops.nix { inherit name; }) + krebs-source + lib + pkgs + ; + + source = { test }: lib.evalSource [ + krebs-source + { + nixos-config.symlink = "stockholm/lass/1systems/${name}/physical.nix"; + secrets = if test then { + file = "/home/lass/stockholm/lass/2configs/tests/dummy-secrets"; + } else { + pass = { + dir = "${lib.getEnv "HOME"}/.password-store"; + name = "hosts/${name}"; + }; + }; + } + ]; + +in { + # usage: $(nix-build --no-out-link --argstr name HOSTNAME -A deploy) + deploy = pkgs.krops.writeDeploy "${name}-deploy" { + source = source { test = false; }; + target = "root@${name}/var/src"; + }; + + # usage: $(nix-build --no-out-link --argstr name HOSTNAME -A test) + test = pkgs.krops.writeTest "${name}-test" { + source = source { test = true; }; + target = "${lib.getEnv "HOME"}/tmp/${name}-krops-test-src"; + }; + + ci = map (host: + pkgs.krops.writeTest "${host.name}-test" { + source = source { test = true; }; + target = "${lib.getEnv "TMPDIR"}/lass/${host.name}"; + } + ) (lib.filter (host: lib.getAttr "ci" host && host.owner == "lass") (lib.attrValues config.krebs.hosts)); +} |