Unhardcode empty flake_ref and friends

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-06-19 00:41:49 +02:00
parent 637dc2877f
commit ef62e6cc67
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
8 changed files with 32 additions and 72 deletions

View file

@ -1,13 +1,8 @@
{ elib, ... }: { elib, vars, ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
nomadJob; nomadJob;
flake_host = "";
flake_rev = "";
flake_ref = "";
flake_sha = "";
in in
{ {
resource."vault_policy"."dovecot-policy" = nfsVolume { resource."vault_policy"."dovecot-policy" = nfsVolume {
@ -47,8 +42,8 @@ in
resource."nomad_job"."email" = { resource."nomad_job"."email" = {
jobspec = ./job.hcl; jobspec = ./job.hcl;
vars = { vars = {
flake_ref = "${flake_host}?rev=${flake_rev}&ref=${flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
} }

View file

@ -1,13 +1,8 @@
{ elib, ... }: { elib, vars, ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
nomadJob; nomadJob;
flake_host = "";
flake_rev = "";
flake_ref = "";
flake_sha = "";
in in
{ {
resource."nomad_volume"."gitea-db" = nfsVolume { resource."nomad_volume"."gitea-db" = nfsVolume {
@ -39,8 +34,8 @@ in
jobspec = ./job.hcl; jobspec = ./job.hcl;
vars = { vars = {
flake_ref = "${flake_host}?rev=${flake_rev}&ref=${flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
} }

View file

@ -1,13 +1,8 @@
{ elib, ... }: { elib, vars, ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
nomadJob; nomadJob;
flake_host = "";
flake_rev = "";
flake_ref = "";
flake_sha = "";
in in
{ {
resource."nomad_volume"."home-assistant_hass" = nfsVolume { resource."nomad_volume"."home-assistant_hass" = nfsVolume {
@ -77,8 +72,8 @@ in
jobspec = ./job.hcl; jobspec = ./job.hcl;
vars = { vars = {
flake_ref = "${flake_host}?rev=${flake_rev}&ref=${flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
} }

View file

@ -1,13 +1,8 @@
{ config, elib, ... }: { config, elib, vars, ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
nomadJob; nomadJob;
flake_host = "";
flake_rev = "";
flake_ref = "";
flake_sha = "";
in in
{ {
resource."nomad_volume"."hydra-db" = nfsVolume { resource."nomad_volume"."hydra-db" = nfsVolume {
@ -47,8 +42,8 @@ in
jobspec = ./job.hcl; jobspec = ./job.hcl;
vars = { vars = {
flake_ref = "${flake_host}?rev=${flake_rev}&ref=${flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
} }

View file

@ -1,20 +1,15 @@
{ elib, ... }: { elib, vars, ... }:
let let
inherit (elib) inherit (elib)
nomadJob; nomadJob;
flake_host = "";
flake_rev = "";
flake_ref = "";
flake_sha = "";
in in
{ {
resource."nomad_job"."ingress" = nomadJob { resource."nomad_job"."ingress" = nomadJob {
jobspec = ./job.hcl; jobspec = ./job.hcl;
vars = { vars = {
flake_ref = "${flake_host}?rev=${flake_rev}&ref=${flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
upstreams = "\${file(\"${./upstreams.conf}\")}"; upstreams = "\${file(\"${./upstreams.conf}\")}";
}; };
}; };

View file

@ -1,13 +1,8 @@
{ elib, secret, ... }: { elib, secret, vars, ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
nomadJob; nomadJob;
flake_host = "";
flake_rev = "";
flake_ref = "";
flake_sha = "";
in in
{ {
resource."nomad_volume"."ingress-letsencrypt" = nfsVolume { resource."nomad_volume"."ingress-letsencrypt" = nfsVolume {
@ -21,8 +16,8 @@ in
resource."nomad_job"."ingress" = nomadJob { resource."nomad_job"."ingress" = nomadJob {
jobspec = ./job.hcl; jobspec = ./job.hcl;
vars = { vars = {
flake_ref = "${flake_host}?rev=${flake_rev}&ref=${flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
upstreams = "\${file(\"${./upstreams.conf}\")}"; upstreams = "\${file(\"${./upstreams.conf}\")}";
}; };
}; };

View file

@ -1,13 +1,8 @@
{ config, elib, ... }: { config, elib, vars, ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
nomadJob; nomadJob;
flake_host = "";
flake_sha = "";
flake_ref = "";
flake_rev= "";
in in
{ {
resource."nomad_volume"."matrix-synapse" = nfsVolume { resource."nomad_volume"."matrix-synapse" = nfsVolume {
@ -143,32 +138,32 @@ in
resource."nomad_job"."matrix-synapse" = nomadJob { resource."nomad_job"."matrix-synapse" = nomadJob {
jobspec = ./matrix-synapse.hcl; jobspec = ./matrix-synapse.hcl;
vars = { vars = {
flake_ref = "${flake_host}?ref=${flake_ref}&rev=${flake_rev}"; flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
resource."nomad_job"."matrix-mautrix-discord" = nomadJob { resource."nomad_job"."matrix-mautrix-discord" = nomadJob {
jobspec = ./matrix-mautrix-discord.hcl; jobspec = ./matrix-mautrix-discord.hcl;
vars = { vars = {
flake_ref = "${flake_host}?ref=${flake_ref}&rev=${flake_rev}"; flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
resource."nomad_job"."matrix-mautrix-facebook" = nomadJob { resource."nomad_job"."matrix-mautrix-facebook" = nomadJob {
jobspec = ./matrix-mautrix-facebook.hcl; jobspec = ./matrix-mautrix-facebook.hcl;
vars = { vars = {
flake_ref = "${flake_host}?ref=${flake_ref}&rev=${flake_rev}"; flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
resource."nomad_job"."matrix-mautrix-signal" = nomadJob { resource."nomad_job"."matrix-mautrix-signal" = nomadJob {
jobspec = ./matrix-mautrix-signal.hcl; jobspec = ./matrix-mautrix-signal.hcl;
vars = { vars = {
flake_ref = "${flake_host}?ref=${flake_ref}&rev=${flake_rev}"; flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
@ -176,8 +171,8 @@ in
jobspec = ./matrix-heisenbridge.hcl; jobspec = ./matrix-heisenbridge.hcl;
vars = { vars = {
flake_ref = "${flake_host}?ref=${flake_ref}&rev=${flake_rev}"; flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
} }

View file

@ -1,15 +1,10 @@
{ pkgs, elib, ... }: { pkgs, elib, vars, ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
nomadJob; nomadJob;
sharePrefix = "/mnt/kyle/infrastructure/syncthing"; sharePrefix = "/mnt/kyle/infrastructure/syncthing";
flake_host = "";
flake_rev = "";
flake_ref = "";
flake_sha = "";
in in
{ {
resource."nomad_volume"."syncthing-data" = nfsVolume { resource."nomad_volume"."syncthing-data" = nfsVolume {
@ -39,8 +34,8 @@ in
resource."nomad_job"."syncthing" = nomadJob { resource."nomad_job"."syncthing" = nomadJob {
jobspec = ./job.hcl; jobspec = ./job.hcl;
vars = { vars = {
flake_ref = "${flake_host}?rev=${flake_rev}&ref=${flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = flake_sha; flake_sha = vars.flake_sha;
}; };
}; };
} }