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
commit288db486eec19c88215f333065cf14fe44086cf7 (patch)
tree9e3a82958bcfff6d469169f73d0a639bcade00db /jeschli
parent32548552b04bbc8b086778852c13fc72e5fed8eb (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 000000000..e55f207d3
--- /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";
+ };
+}