2024-10-06 15:25:05 -05:00
|
|
|
{
|
|
|
|
flake,
|
|
|
|
config,
|
|
|
|
...
|
2025-01-31 01:49:36 -06:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (flake.config.people)
|
2025-01-08 19:06:14 -06:00
|
|
|
user0
|
|
|
|
user1
|
|
|
|
;
|
2025-01-31 01:49:36 -06:00
|
|
|
inherit (flake.config.machines.devices)
|
2025-03-01 15:58:02 -06:00
|
|
|
mars
|
2025-02-17 18:52:02 -06:00
|
|
|
ceres
|
2025-01-08 19:06:14 -06:00
|
|
|
synology
|
|
|
|
;
|
2025-01-31 01:49:36 -06:00
|
|
|
inherit (flake.config.services.instances)
|
2025-01-08 19:06:14 -06:00
|
|
|
samba
|
|
|
|
;
|
2024-11-03 19:02:58 -06:00
|
|
|
|
2024-10-09 23:26:43 -05:00
|
|
|
synologySecrets = config.sops.secrets."network/synology".path;
|
2025-02-17 18:52:02 -06:00
|
|
|
ceresSecrets = config.sops.secrets."network/server".path;
|
2025-01-31 01:49:36 -06:00
|
|
|
in
|
|
|
|
{
|
|
|
|
fileSystems =
|
|
|
|
let
|
|
|
|
synologyDrives = [
|
|
|
|
"folder0"
|
|
|
|
"folder1"
|
|
|
|
"folder2"
|
|
|
|
];
|
2024-10-06 15:25:05 -05:00
|
|
|
|
2025-01-31 01:49:36 -06:00
|
|
|
storageDrives = [
|
|
|
|
"storage0"
|
|
|
|
"storage1"
|
|
|
|
];
|
2024-10-06 15:25:05 -05:00
|
|
|
|
2025-01-31 01:49:36 -06:00
|
|
|
sambaDrives = [
|
|
|
|
"samba0"
|
|
|
|
];
|
2024-10-06 15:25:05 -05:00
|
|
|
|
2025-01-31 01:49:36 -06:00
|
|
|
synologyMounts = synologyDrive: {
|
|
|
|
name = "${synology.${synologyDrive}.mount}";
|
|
|
|
value = {
|
|
|
|
device = synology.${synologyDrive}.device;
|
|
|
|
fsType = "cifs";
|
|
|
|
options = synology.${synologyDrive}.options ++ [
|
2025-01-08 19:11:58 -06:00
|
|
|
"credentials=${synologySecrets}"
|
|
|
|
];
|
2025-01-31 01:49:36 -06:00
|
|
|
};
|
2024-10-06 15:25:05 -05:00
|
|
|
};
|
|
|
|
|
2025-01-31 01:49:36 -06:00
|
|
|
storageMounts = storageDrive: {
|
2025-03-01 15:58:02 -06:00
|
|
|
name = "${mars.${storageDrive}.mount}";
|
2025-01-31 01:49:36 -06:00
|
|
|
value = {
|
2025-03-01 15:58:02 -06:00
|
|
|
device = mars.${storageDrive}.device;
|
2025-01-31 01:49:36 -06:00
|
|
|
fsType = "ext4";
|
2025-03-01 15:58:02 -06:00
|
|
|
options = mars.${storageDrive}.options;
|
2025-01-31 01:49:36 -06:00
|
|
|
};
|
2024-10-06 15:25:05 -05:00
|
|
|
};
|
|
|
|
|
2025-01-31 01:49:36 -06:00
|
|
|
sambaMounts = sambaDrive: {
|
2025-02-17 18:52:02 -06:00
|
|
|
name = "${ceres.${sambaDrive}.mount}/${samba.paths.path1}";
|
2025-01-31 01:49:36 -06:00
|
|
|
value = {
|
2025-02-17 18:52:02 -06:00
|
|
|
device = "${ceres.${sambaDrive}.device}/${samba.paths.path1}";
|
2025-01-31 01:49:36 -06:00
|
|
|
fsType = "cifs";
|
2025-02-17 18:52:02 -06:00
|
|
|
options = ceres.${sambaDrive}.options ++ [
|
|
|
|
"credentials=${ceresSecrets}"
|
2025-01-08 19:11:58 -06:00
|
|
|
];
|
2025-01-31 01:49:36 -06:00
|
|
|
};
|
2024-10-06 15:25:05 -05:00
|
|
|
};
|
2025-01-31 01:49:36 -06:00
|
|
|
in
|
2024-10-06 15:25:05 -05:00
|
|
|
{
|
|
|
|
"/" = {
|
2025-03-09 19:37:13 -05:00
|
|
|
device = "/dev/disk/by-uuid/1de87c26-c123-44c0-9c9b-6d2480bdeb7d";
|
2024-10-06 15:25:05 -05:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
"/boot" = {
|
2025-03-09 19:37:13 -05:00
|
|
|
device = "/dev/disk/by-uuid/6A1F-3641";
|
2024-10-06 15:25:05 -05:00
|
|
|
fsType = "vfat";
|
2025-03-01 15:58:02 -06:00
|
|
|
options = mars.boot.options;
|
2024-10-06 15:25:05 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
|
|
|
// (builtins.listToAttrs (map storageMounts storageDrives))
|
|
|
|
// (builtins.listToAttrs (map sambaMounts sambaDrives));
|
|
|
|
|
|
|
|
swapDevices = [
|
2025-03-09 19:37:13 -05:00
|
|
|
{ device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; }
|
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 -"
|
2025-03-01 15:58:02 -06:00
|
|
|
"Z ${mars.storage0.mount} 0755 ${user0} users -"
|
|
|
|
"Z ${mars.storage1.mount} 0755 ${user0} users -"
|
2024-10-06 15:25:05 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
}
|