chore: split nixos and opentofu

This commit is contained in:
Tibo De Peuter 2026-07-24 22:17:43 +02:00
parent d125848b82
commit 06500a8f01
Signed by: tdpeuter
SSH key fingerprint: SHA256:u/h/LVoqKF1Iz02uOyxe6hcjmoZASCGV2HM0TG9ZMoU
68 changed files with 44 additions and 61 deletions

View file

@ -0,0 +1,5 @@
{
imports = [
./media
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
./video
];
}

View file

@ -0,0 +1,39 @@
{ config, lib, ... }:
let
cfg = config.homelab.fileSystems.media.video;
remotePath = "/mnt/SMALL/MEDIA/VIDEO";
maxPermissions = permissions:
if builtins.elem "write" permissions then "rw"
else "ro";
permissionsOption = maxPermissions cfg.permissions;
in {
options.homelab.fileSystems.media.video = {
enable = lib.mkEnableOption "MEDIA/VIDEO dataset";
hostPath = lib.mkOption {
type = lib.types.path;
default = "/srv/video";
description = "Mountpath on host";
};
permissions = lib.mkOption {
type = lib.types.listOf (lib.types.enum [ "read" "write" ]);
default = [ "read" ];
description = "Mount options permissions";
};
};
config = lib.mkIf cfg.enable {
homelab.nfsMounts."${cfg.hostPath}" = {
device = "192.168.0.11:${remotePath}";
readOnly = permissionsOption == "ro";
extraOptions = [
"auto"
"rsize=1048576" "wsize=1048576"
"timeo=600" "retrans=2"
"_netdev"
];
};
};
}