Adapt Hydra to updated Nomad patch

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-07-10 20:56:39 +02:00
parent 58641c2cc4
commit 247abc7a1b
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
2 changed files with 14 additions and 1 deletions

View file

@ -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;
});
};
};
}

View file

@ -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" ]
}