2023-06-15 23:09:40 +02:00
|
|
|
{
|
2024-03-02 22:05:30 +01:00
|
|
|
elib,
|
|
|
|
config',
|
|
|
|
vars,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(elib)
|
|
|
|
nfsVolume
|
|
|
|
nomadJob
|
|
|
|
;
|
|
|
|
in {
|
2023-06-15 23:09:40 +02:00
|
|
|
resource."nomad_volume"."gitea-db" = nfsVolume {
|
2024-03-02 22:05:30 +01:00
|
|
|
volume_name = "gitea-db";
|
2023-06-15 23:09:40 +02:00
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
2024-01-18 21:10:13 +01:00
|
|
|
share = "/mnt/kyle/infrastructure/gitea/database";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["hard" "vers=4.2" "rsize=16384" "wsize=16384" "async"];
|
2023-06-15 23:09:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_volume"."gitea-data" = nfsVolume {
|
2024-03-02 22:05:30 +01:00
|
|
|
volume_name = "gitea-data";
|
2023-06-15 23:09:40 +02:00
|
|
|
access_mode = "single-node-writer";
|
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
2024-01-18 21:10:13 +01:00
|
|
|
share = "/mnt/kyle/infrastructure/gitea/data";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["hard" "vers=4.2" "rsize=16384" "wsize=16384" "async"];
|
2023-06-15 23:09:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."vault_policy"."gitea-policy" = {
|
|
|
|
name = "gitea-policy";
|
|
|
|
policy = ''
|
2024-01-18 21:23:18 +01:00
|
|
|
path "kv/data/cluster/gitea/gitea" {
|
2023-06-15 23:09:40 +02:00
|
|
|
capabilities = ["read"]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_job"."gitea" = nomadJob {
|
|
|
|
jobspec = ./job.hcl;
|
2023-06-29 18:59:38 +02:00
|
|
|
|
2023-06-15 23:09:40 +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;
|
2024-01-18 21:27:57 +01:00
|
|
|
store_path = builtins.unsafeDiscardStringContext config'.flake.nixngConfigurations.gitea.config.system.build.toplevel;
|
2023-06-15 23:09:40 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|