summaryrefslogtreecommitdiffstats
path: root/jeschli
diff options
context:
space:
mode:
authorlassulus <lass@blue.r>2018-09-08 12:30:50 +0200
committerlassulus <lass@blue.r>2018-09-08 12:30:50 +0200
commit8952cfee8723c48e6e963995e3c0e57b0f80c32b (patch)
tree31a9b7fb790be9fd281d58f37ec5b8527d6ac8b7 /jeschli
parent3ee6a8170b85341c0adf178a947898821d143178 (diff)
j: add krops.nix
Diffstat (limited to 'jeschli')
-rw-r--r--jeschli/krops.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/jeschli/krops.nix b/jeschli/krops.nix
new file mode 100644
index 0000000..e55f207
--- /dev/null
+++ b/jeschli/krops.nix
@@ -0,0 +1,40 @@
+{ name }: let
+ inherit (import ../krebs/krops.nix { inherit name; })
+ krebs-source
+ lib
+ pkgs
+ ;
+
+ source = { test }: lib.evalSource [
+ krebs-source
+ {
+ nixos-config.symlink = "stockholm/jeschli/1systems/${name}/config.nix";
+ secrets = if test then {
+ file = toString ./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}-stockholm-test";
+ };
+
+ ci = pkgs.krops.writeTest "${name}-test" {
+ source = source { test = true; };
+ target = "${lib.getEnv "HOME"}/stockholm-build";
+ };
+}