mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-15 17:45:12 -05:00
92 lines
2.1 KiB
Nix
Executable file
92 lines
2.1 KiB
Nix
Executable file
{
|
|
flake,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
inherit (flake.config.people)
|
|
user0
|
|
user1
|
|
;
|
|
inherit (flake.config.machines.devices)
|
|
deimos
|
|
synology
|
|
ceres
|
|
;
|
|
inherit (flake.config.services.instances)
|
|
samba
|
|
jellyfin
|
|
audiobookshelf
|
|
;
|
|
|
|
synologySecrets = config.sops.secrets."network/synology".path;
|
|
ceresSecrets = config.sops.secrets."network/server".path;
|
|
in
|
|
{
|
|
fileSystems =
|
|
let
|
|
synologyDrives = [
|
|
"folder0"
|
|
"folder1"
|
|
"folder2"
|
|
];
|
|
|
|
sambaDrives = [
|
|
"samba0"
|
|
];
|
|
|
|
sambaFolders = [
|
|
audiobookshelf.name
|
|
jellyfin.name
|
|
];
|
|
|
|
synologyMounts = synologyDrive: {
|
|
name = "${synology.${synologyDrive}.mount}";
|
|
value = {
|
|
device = synology.${synologyDrive}.device;
|
|
fsType = "cifs";
|
|
options = synology.${synologyDrive}.options ++ [
|
|
"credentials=${synologySecrets}"
|
|
];
|
|
};
|
|
};
|
|
|
|
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/1556c3ad-8835-4cdf-a619-649d658bf6c7";
|
|
fsType = "ext4";
|
|
};
|
|
"/boot" = {
|
|
device = "/dev/disk/by-uuid/9EDC-E534";
|
|
fsType = "vfat";
|
|
options = deimos.boot.options;
|
|
};
|
|
}
|
|
# // (builtins.listToAttrs (map synologyMounts synologyDrives))
|
|
# // (builtins.listToAttrs (
|
|
# builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
|
|
# ))
|
|
;
|
|
|
|
swapDevices = [
|
|
{ device = "/dev/disk/by-uuid/fa814d6b-5ba9-48e6-8581-e6b5560a5038"; }
|
|
];
|
|
|
|
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 -"
|
|
];
|
|
|
|
services.udisks2.enable = true;
|
|
}
|