2025-03-29 23:08:26 -05:00
|
|
|
{
|
|
|
|
flake,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (flake.config.people)
|
|
|
|
user0
|
|
|
|
;
|
|
|
|
inherit (flake.config.machines.devices)
|
|
|
|
deimos
|
|
|
|
synology
|
|
|
|
ceres
|
|
|
|
;
|
|
|
|
inherit (flake.config.services.instances)
|
|
|
|
jellyfin
|
|
|
|
audiobookshelf
|
2025-07-18 18:42:20 -05:00
|
|
|
comfyui
|
2025-03-29 23:08:26 -05:00
|
|
|
;
|
|
|
|
|
|
|
|
synologySecrets = config.sops.secrets."network/synology".path;
|
|
|
|
ceresSecrets = config.sops.secrets."network/server".path;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
fileSystems =
|
|
|
|
let
|
|
|
|
synologyDrives = [
|
|
|
|
"folder0"
|
|
|
|
"folder1"
|
|
|
|
];
|
|
|
|
|
|
|
|
sambaDrives = [
|
|
|
|
"samba0"
|
|
|
|
];
|
|
|
|
|
2025-06-25 18:28:16 -05:00
|
|
|
remoteDrives = [
|
|
|
|
"remote0"
|
|
|
|
];
|
|
|
|
|
|
|
|
remoteFolders = [
|
2025-03-29 23:08:26 -05:00
|
|
|
audiobookshelf.name
|
|
|
|
jellyfin.name
|
2025-07-18 18:42:20 -05:00
|
|
|
comfyui.name
|
2025-03-29 23:08:26 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
synologyMounts = synologyDrive: {
|
|
|
|
name = "${synology.${synologyDrive}.mount}";
|
|
|
|
value = {
|
|
|
|
device = synology.${synologyDrive}.device;
|
|
|
|
fsType = "cifs";
|
|
|
|
options = synology.${synologyDrive}.options ++ [
|
|
|
|
"credentials=${synologySecrets}"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
sambaMounts = sambaDrive: folder: {
|
|
|
|
name = "${ceres.${sambaDrive}.mount}/${folder}";
|
|
|
|
value = {
|
|
|
|
device = "${ceres.${sambaDrive}.device}/${folder}";
|
|
|
|
fsType = "cifs";
|
|
|
|
options = ceres.${sambaDrive}.options ++ [
|
|
|
|
"credentials=${ceresSecrets}"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2025-06-25 18:28:16 -05:00
|
|
|
|
|
|
|
sshfsMounts = sshfsDrive: folder: {
|
|
|
|
name = "${ceres.${sshfsDrive}.mount}/${folder}";
|
|
|
|
value = {
|
|
|
|
device = "${ceres.${sshfsDrive}.device}/${folder}";
|
|
|
|
fsType = "sshfs";
|
|
|
|
options = ceres.${sshfsDrive}.options;
|
|
|
|
};
|
|
|
|
};
|
2025-03-29 23:08:26 -05:00
|
|
|
in
|
|
|
|
{
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-uuid/c9a82c93-1da4-4cd1-a1fa-26483271a2bb";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/71CA-765A";
|
|
|
|
fsType = "vfat";
|
|
|
|
options = deimos.boot.options;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
|
|
|
// (builtins.listToAttrs (
|
2025-06-25 18:28:16 -05:00
|
|
|
builtins.concatMap (drive: map (folder: sambaMounts drive folder) remoteFolders) sambaDrives
|
|
|
|
))
|
|
|
|
// (builtins.listToAttrs (
|
|
|
|
builtins.concatMap (drive: map (folder: sshfsMounts drive folder) remoteFolders) remoteDrives
|
2025-03-29 23:08:26 -05:00
|
|
|
));
|
|
|
|
|
|
|
|
swapDevices = [
|
|
|
|
{ device = "/dev/disk/by-uuid/74007bf1-6e2f-425e-99fa-d35990f4ea37"; }
|
|
|
|
];
|
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
|
|
|
|
];
|
|
|
|
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
}
|