2024-03-02 22:05:30 +01:00
|
|
|
{
|
|
|
|
config',
|
|
|
|
pkgs,
|
|
|
|
elib,
|
|
|
|
vars,
|
2024-07-16 20:41:59 +02:00
|
|
|
uterranix-lib,
|
2024-03-02 22:05:30 +01:00
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(elib)
|
2023-06-15 23:04:59 +02:00
|
|
|
nfsVolume
|
2024-03-02 22:05:30 +01:00
|
|
|
nomadJob
|
|
|
|
;
|
2024-04-06 16:15:47 +02:00
|
|
|
inherit
|
2024-07-16 20:41:59 +02:00
|
|
|
(uterranix-lib)
|
2024-04-06 16:15:47 +02:00
|
|
|
tf
|
|
|
|
;
|
2023-06-15 23:04:59 +02:00
|
|
|
|
|
|
|
sharePrefix = "/mnt/kyle/infrastructure/syncthing";
|
2024-03-02 22:05:30 +01:00
|
|
|
in {
|
2023-06-15 23:04:59 +02:00
|
|
|
resource."nomad_volume"."syncthing-data" = nfsVolume {
|
|
|
|
access_mode = "single-node-writer";
|
2024-03-02 22:05:30 +01:00
|
|
|
volume_name = "syncthing-data";
|
2023-06-15 23:04:59 +02:00
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
|
|
|
share = sharePrefix + "/data";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["hard" "vers=4.2" "rsize=131072" "wsize=131072" "async"];
|
2023-06-15 23:04:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_volume"."syncthing-storage" = nfsVolume {
|
|
|
|
access_mode = "single-node-writer";
|
2024-03-02 22:05:30 +01:00
|
|
|
volume_name = "syncthing-storage";
|
2023-06-15 23:04:59 +02:00
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
2023-07-18 23:11:45 +02:00
|
|
|
share = sharePrefix + "/storage";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["hard" "vers=4.2" "rsize=131072" "wsize=131072" "async"];
|
2023-06-15 23:04:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
resource."nomad_volume"."syncthing-config" = nfsVolume {
|
|
|
|
access_mode = "single-node-writer";
|
2024-03-02 22:05:30 +01:00
|
|
|
volume_name = "syncthing-config";
|
2023-06-15 23:04:59 +02:00
|
|
|
server = "blowhole.hosts.in.redalder.org";
|
2023-07-18 23:11:45 +02:00
|
|
|
share = sharePrefix + "/config";
|
2024-03-02 22:05:30 +01:00
|
|
|
mount_flags = ["hard" "vers=4.2" "rsize=131072" "wsize=131072" "async"];
|
2023-06-15 23:04:59 +02:00
|
|
|
};
|
|
|
|
|
2024-04-06 16:15:47 +02:00
|
|
|
imports = [
|
|
|
|
(elib.buildNixNGSystem {
|
|
|
|
name = "syncthing";
|
2024-04-06 16:40:33 +02:00
|
|
|
hosts = [
|
|
|
|
"blowhole.hosts.in.redalder.org"
|
|
|
|
];
|
2024-04-06 16:15:47 +02:00
|
|
|
})
|
|
|
|
];
|
2023-06-15 23:04:59 +02:00
|
|
|
resource."nomad_job"."syncthing" = nomadJob {
|
|
|
|
jobspec = ./job.hcl;
|
|
|
|
vars = {
|
2024-04-06 16:40:33 +02:00
|
|
|
flake_ref = "unused";
|
|
|
|
flake_sha = "unused";
|
2024-04-06 16:15:47 +02:00
|
|
|
store_path = tf "data.external.nixng-system-syncthing.result.out";
|
2023-06-15 23:04:59 +02:00
|
|
|
};
|
2024-04-06 16:15:47 +02:00
|
|
|
depends_on = [
|
|
|
|
"terraform_data.nixng-system-syncthing-copy"
|
|
|
|
];
|
2023-06-15 23:04:59 +02:00
|
|
|
};
|
|
|
|
}
|