From 247abc7a1b5331b0ba4464cd6d970ef6378e494d Mon Sep 17 00:00:00 2001 From: Magic_RB Date: Mon, 10 Jul 2023 20:56:39 +0200 Subject: [PATCH] Adapt Hydra to updated Nomad patch Signed-off-by: Magic_RB --- terranix/containers/hydra/default.nix | 6 +++++- terranix/containers/hydra/job.hcl | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/terranix/containers/hydra/default.nix b/terranix/containers/hydra/default.nix index 0deda2c..6476278 100644 --- a/terranix/containers/hydra/default.nix +++ b/terranix/containers/hydra/default.nix @@ -1,4 +1,4 @@ -{ config, elib, vars, ... }: +{ config, elib, vars, config', ... }: let inherit (elib) nfsVolume @@ -44,6 +44,10 @@ in vars = { flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}"; flake_sha = vars.flake_sha; + store_path = builtins.toJSON (builtins.mapAttrs (_: builtins.unsafeDiscardStringContext) { + hydra = config'.flake.nixngConfigurations.hydra.config.system.build.toplevel; + postgresql = config'.flake.nixngConfigurations.hydraPostgresql.config.system.build.toplevel; + }); }; }; } diff --git a/terranix/containers/hydra/job.hcl b/terranix/containers/hydra/job.hcl index 929b21f..28827f9 100644 --- a/terranix/containers/hydra/job.hcl +++ b/terranix/containers/hydra/job.hcl @@ -6,6 +6,13 @@ variable "flake_sha" { type = string } +variable "store_path" { + type = object({ + hydra = string + postgresql = string + }) + + job "hydra" { datacenters = [ "homelab-1" ] type = "service" @@ -90,6 +97,7 @@ job "hydra" { config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.hydra.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.hydra entrypoint = [ "init" ] devices = [ @@ -163,6 +171,7 @@ EOF config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.hydraPostgresql.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.postgresql entrypoint = [ "init" ] }