2023-06-15 23:07:28 +02:00
|
|
|
{
|
2024-03-02 22:05:30 +01:00
|
|
|
config,
|
|
|
|
elib,
|
|
|
|
vars,
|
|
|
|
config',
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(elib)
|
|
|
|
nfsVolume
|
|
|
|
nomadJob
|
|
|
|
;
|
|
|
|
in {
|
2023-06-15 23:07:28 +02:00
|
|
|
resource."nomad_volume"."hydra-db" = nfsVolume {
|
|
|
|
volume_name = "hydra-db";
|
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
2024-01-27 22:41:12 +01:00
|
|
|
share = "/mnt/jimmy/infrastructure/hydra/postgresql";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["nfsvers=3" "hard" "async"];
|
2023-06-15 23:07:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_volume"."hydra-data" = nfsVolume {
|
2024-03-02 22:05:30 +01:00
|
|
|
volume_name = "hydra-data";
|
2023-06-15 23:07:28 +02:00
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
2024-01-27 22:41:12 +01:00
|
|
|
share = "/mnt/kyle/infrastructure/hydra/data";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["nfsvers=3" "hard" "async"];
|
2023-06-15 23:07:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_volume"."hydra-nix" = nfsVolume {
|
2024-03-02 22:05:30 +01:00
|
|
|
volume_name = "hydra-nix";
|
2023-06-15 23:07:28 +02:00
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
|
|
|
share = "/var/nfs/hydra-nix";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["nfsvers=3" "hard" "async"];
|
2023-06-15 23:07:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."vault_policy"."hydra-policy" = {
|
|
|
|
name = "hydra-policy";
|
|
|
|
policy = ''
|
2023-07-10 21:12:36 +02:00
|
|
|
path "kv/data/cluster/hydra" {
|
2023-06-15 23:07:28 +02:00
|
|
|
capabilities = ["read"]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_job"."hydra" = nomadJob {
|
|
|
|
jobspec = ./job.hcl;
|
2023-06-29 18:59:38 +02:00
|
|
|
|
2023-06-15 23:07:28 +02:00
|
|
|
vars = {
|
2023-06-19 00:41:49 +02:00
|
|
|
flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
|
|
|
|
flake_sha = vars.flake_sha;
|
2023-07-10 20:56:39 +02:00
|
|
|
store_path = builtins.toJSON (builtins.mapAttrs (_: builtins.unsafeDiscardStringContext) {
|
|
|
|
hydra = config'.flake.nixngConfigurations.hydra.config.system.build.toplevel;
|
2023-07-10 20:58:25 +02:00
|
|
|
postgresql = config'.flake.nixngConfigurations.hydraPostgreSQL.config.system.build.toplevel;
|
2023-07-10 20:56:39 +02:00
|
|
|
});
|
2023-06-15 23:07:28 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|