summaryrefslogtreecommitdiffstats
path: root/lass/krops.nix
diff options
context:
space:
mode:
authorlassulus <lass@blue.r>2018-06-07 08:24:56 +0200
committerlassulus <lass@blue.r>2018-06-07 08:24:56 +0200
commit2e7f0ada013810e577944434f42000313befe549 (patch)
treefc9c3480101d0bfcf15448bef9d1a4d1767afee9 /lass/krops.nix
parent16d306c784ce586cc72ff24f2ab65f6431f9c5d5 (diff)
l: kops -> krops
Diffstat (limited to 'lass/krops.nix')
-rw-r--r--lass/krops.nix42
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));
+}