2024-10-06 15:25:05 -05:00
|
|
|
{
|
|
|
|
flake,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
2025-01-08 19:06:14 -06:00
|
|
|
inherit
|
|
|
|
(flake.config.people)
|
|
|
|
user0
|
|
|
|
user1
|
|
|
|
;
|
|
|
|
inherit
|
|
|
|
(flake.config.machines.devices)
|
|
|
|
desktop
|
|
|
|
server
|
|
|
|
synology
|
|
|
|
;
|
|
|
|
inherit
|
|
|
|
(flake.config.services.instances)
|
|
|
|
samba
|
|
|
|
;
|
2024-11-03 19:02:58 -06:00
|
|
|
|
2024-10-09 23:26:43 -05:00
|
|
|
synologySecrets = config.sops.secrets."network/synology".path;
|
|
|
|
serverSecrets = config.sops.secrets."network/server".path;
|
2024-10-06 15:25:05 -05:00
|
|
|
in {
|
|
|
|
fileSystems = let
|
|
|
|
synologyDrives = [
|
2024-10-18 01:50:18 -05:00
|
|
|
"folder0"
|
|
|
|
"folder1"
|
|
|
|
"folder2"
|
2024-10-06 15:25:05 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
storageDrives = [
|
|
|
|
"storage0"
|
|
|
|
"storage1"
|
|
|
|
];
|
|
|
|
|
|
|
|
sambaDrives = [
|
|
|
|
"samba0"
|
|
|
|
];
|
|
|
|
|
2024-10-09 23:26:43 -05:00
|
|
|
synologyMounts = synologyDrive: {
|
2024-11-10 01:29:37 -06:00
|
|
|
name = "${synology.${synologyDrive}.mount}";
|
2024-10-06 15:25:05 -05:00
|
|
|
value = {
|
2024-11-10 01:29:37 -06:00
|
|
|
device = synology.${synologyDrive}.device;
|
2024-10-06 15:25:05 -05:00
|
|
|
fsType = "cifs";
|
2024-11-03 19:02:58 -06:00
|
|
|
options =
|
2024-11-10 01:29:37 -06:00
|
|
|
synology.${synologyDrive}.options
|
2025-01-08 19:11:58 -06:00
|
|
|
++ [
|
|
|
|
"credentials=${synologySecrets}"
|
|
|
|
];
|
2024-10-06 15:25:05 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-09 23:26:43 -05:00
|
|
|
storageMounts = storageDrive: {
|
|
|
|
name = "${desktop.${storageDrive}.mount}";
|
2024-10-06 15:25:05 -05:00
|
|
|
value = {
|
2024-10-09 23:26:43 -05:00
|
|
|
device = desktop.${storageDrive}.device;
|
2024-10-06 15:25:05 -05:00
|
|
|
fsType = "ext4";
|
2024-10-09 23:26:43 -05:00
|
|
|
options = desktop.${storageDrive}.options;
|
2024-10-06 15:25:05 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-10-09 23:26:43 -05:00
|
|
|
sambaMounts = sambaDrive: {
|
|
|
|
name = "${server.${sambaDrive}.mount}/${samba.paths.path1}";
|
2024-10-06 15:25:05 -05:00
|
|
|
value = {
|
2024-10-09 23:26:43 -05:00
|
|
|
device = "${server.${sambaDrive}.device}/${samba.paths.path1}";
|
2024-10-06 15:25:05 -05:00
|
|
|
fsType = "cifs";
|
2024-11-03 19:02:58 -06:00
|
|
|
options =
|
|
|
|
server.${sambaDrive}.options
|
2025-01-08 19:11:58 -06:00
|
|
|
++ [
|
|
|
|
"credentials=${serverSecrets}"
|
|
|
|
];
|
2024-10-06 15:25:05 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
"/" = {
|
2025-01-11 01:37:11 -06:00
|
|
|
device = "/dev/disk/by-uuid/f63ce470-874a-4d2f-9494-31a15ca39f7f";
|
2024-10-06 15:25:05 -05:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
"/boot" = {
|
2025-01-11 01:37:11 -06:00
|
|
|
device = "/dev/disk/by-uuid/D29F-080E";
|
2024-10-06 15:25:05 -05:00
|
|
|
fsType = "vfat";
|
|
|
|
options = desktop.boot.options;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
|
|
|
// (builtins.listToAttrs (map storageMounts storageDrives))
|
|
|
|
// (builtins.listToAttrs (map sambaMounts sambaDrives));
|
|
|
|
|
|
|
|
swapDevices = [
|
2025-01-11 01:37:11 -06:00
|
|
|
{device = "/dev/disk/by-uuid/e3724d5e-9aba-4a32-9d89-c2117b1ed044";}
|
2024-10-06 15:25:05 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
|
|
|
|
"Z ${config.home-manager.users.${user1}.home.homeDirectory} 0755 ${user1} users -"
|
|
|
|
"Z ${desktop.storage0.mount} 0755 ${user0} users -"
|
|
|
|
"Z ${desktop.storage1.mount} 0755 ${user0} users -"
|
|
|
|
];
|
|
|
|
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
}
|