dotfiles/systems/mars/config/filesystem.nix

80 lines
1.9 KiB
Nix
Raw Normal View History

2025-10-01 19:51:55 -05:00
{
flake,
config,
...
}:
let
inherit (flake.config.people) user0;
2025-10-30 22:30:51 -05:00
inherit (flake.config.machines.devices) mars ceres;
2025-10-01 20:23:04 -05:00
inherit (flake.config.services) instances;
2025-10-01 19:51:55 -05:00
ceresSecrets = config.sops.secrets."network/server".path;
in
{
fileSystems =
let
storageDrives = [
"storage0"
"storage1"
];
sambaDrives = [
"samba0"
];
sambaFolders = [
2025-10-01 20:23:04 -05:00
instances.audiobookshelf.name
instances.jellyfin.name
instances.comfyui.name
2025-10-01 20:31:41 -05:00
# instances.opencloud.name
2025-10-01 19:51:55 -05:00
];
storageMounts = storageDrive: {
name = "${mars.${storageDrive}.mount}";
value = {
device = mars.${storageDrive}.device;
fsType = "ext4";
options = mars.${storageDrive}.options;
};
};
sambaMounts = sambaDrive: folder: {
name = "${ceres.${sambaDrive}.mount}/${folder}";
value = {
device = "${ceres.${sambaDrive}.device}/${folder}";
fsType = "cifs";
options = ceres.${sambaDrive}.options ++ [
"credentials=${ceresSecrets}"
];
};
};
in
{
"/" = {
2025-10-02 23:49:31 -05:00
device = "/dev/disk/by-uuid/9055101b-f60d-4d5f-93f5-8b9d480b1a19";
2025-10-01 19:51:55 -05:00
fsType = "ext4";
};
"/boot" = {
2025-10-02 23:49:31 -05:00
device = "/dev/disk/by-uuid/A8CE-EB9B";
2025-10-01 19:51:55 -05:00
fsType = "vfat";
options = mars.boot.options;
};
2025-11-06 04:08:29 -06:00
};
# // (builtins.listToAttrs (map storageMounts storageDrives))
# // (builtins.listToAttrs (
# builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
# ));
2025-10-01 19:51:55 -05:00
swapDevices = [
2025-10-02 23:49:31 -05:00
{ device = "/dev/disk/by-uuid/6b56990c-545d-4d00-b93b-8ca1f143882e"; }
2025-10-01 19:51:55 -05:00
];
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
"Z ${mars.storage0.mount} 0755 ${user0} users -"
"Z ${mars.storage1.mount} 0755 ${user0} users -"
];
services.udisks2.enable = true;
}