dotfiles/systems/deimos/config/filesystem.nix

80 lines
1.9 KiB
Nix
Raw Normal View History

2025-10-01 19:51:55 -05:00
{
flake,
config,
...
}:
let
2025-10-01 20:27:07 -05:00
inherit (flake.config.people) user0;
2025-10-30 22:30:51 -05:00
inherit (flake.config.machines.devices) deimos ceres;
2025-10-01 20:27:07 -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
sambaDrives = [
"samba0"
];
remoteDrives = [
"remote0"
];
remoteFolders = [
2025-10-01 20:27:07 -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
];
sambaMounts = sambaDrive: folder: {
name = "${ceres.${sambaDrive}.mount}/${folder}";
value = {
device = "${ceres.${sambaDrive}.device}/${folder}";
fsType = "cifs";
options = ceres.${sambaDrive}.options ++ [
"credentials=${ceresSecrets}"
];
};
};
sshfsMounts = sshfsDrive: folder: {
name = "${ceres.${sshfsDrive}.mount}/${folder}";
value = {
device = "${ceres.${sshfsDrive}.device}/${folder}";
fsType = "sshfs";
options = ceres.${sshfsDrive}.options;
};
};
in
{
"/" = {
2025-10-02 23:51:05 -05:00
device = "/dev/disk/by-uuid/aa9e7283-3e96-4d3e-a66b-ce24bba9f3f2";
2025-10-01 19:51:55 -05:00
fsType = "ext4";
};
"/boot" = {
2025-10-02 23:51:05 -05:00
device = "/dev/disk/by-uuid/0616-DAE7";
2025-10-01 19:51:55 -05:00
fsType = "vfat";
options = deimos.boot.options;
};
};
# // (builtins.listToAttrs (
# builtins.concatMap (drive: map (folder: sambaMounts drive folder) remoteFolders) sambaDrives
# ))
# // (builtins.listToAttrs (
# builtins.concatMap (drive: map (folder: sshfsMounts drive folder) remoteFolders) remoteDrives
# ));
2025-10-01 19:51:55 -05:00
swapDevices = [
2025-10-02 23:51:05 -05:00
{ device = "/dev/disk/by-uuid/027a1efb-6c4e-4c1a-9956-91c7513950b4"; }
2025-10-01 19:51:55 -05:00
];
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user0}.home.homeDirectory} 0755 ${user0} users -"
];
services.udisks2.enable = true;
}