{ flake, config, ... }: let inherit (flake.config.people) user0; inherit (flake.config.machines.devices) mars ceres; inherit (flake.config.services) instances; ceresSecrets = config.sops.secrets."network/server".path; in { fileSystems = let storageDrives = [ "storage0" "storage1" ]; sambaDrives = [ "samba0" ]; sambaFolders = [ instances.audiobookshelf.name instances.jellyfin.name instances.comfyui.name # instances.opencloud.name ]; 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 { "/" = { device = "/dev/disk/by-uuid/9055101b-f60d-4d5f-93f5-8b9d480b1a19"; fsType = "ext4"; }; "/boot" = { device = "/dev/disk/by-uuid/A8CE-EB9B"; fsType = "vfat"; options = mars.boot.options; }; }; # // (builtins.listToAttrs (map storageMounts storageDrives)) # // (builtins.listToAttrs ( # builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives # )); swapDevices = [ { device = "/dev/disk/by-uuid/6b56990c-545d-4d00-b93b-8ca1f143882e"; } ]; 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; }