mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-06 21:17:14 -06:00
chore: init
This commit is contained in:
commit
1b2c1ea359
891 changed files with 37053 additions and 0 deletions
96
systems/mars/config/filesystem.nix
Executable file
96
systems/mars/config/filesystem.nix
Executable file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
flake,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.people) user0 user1;
|
||||
inherit (flake.config.machines.devices) mars ceres synology;
|
||||
inherit (flake.config.services.instances) jellyfin audiobookshelf comfyui;
|
||||
synologySecrets = config.sops.secrets."network/synology".path;
|
||||
ceresSecrets = config.sops.secrets."network/server".path;
|
||||
in
|
||||
{
|
||||
fileSystems =
|
||||
let
|
||||
synologyDrives = [
|
||||
"folder0"
|
||||
"folder1"
|
||||
];
|
||||
|
||||
storageDrives = [
|
||||
"storage0"
|
||||
"storage1"
|
||||
];
|
||||
|
||||
sambaDrives = [
|
||||
"samba0"
|
||||
];
|
||||
|
||||
sambaFolders = [
|
||||
audiobookshelf.name
|
||||
jellyfin.name
|
||||
comfyui.name
|
||||
];
|
||||
|
||||
synologyMounts = synologyDrive: {
|
||||
name = "${synology.${synologyDrive}.mount}";
|
||||
value = {
|
||||
device = synology.${synologyDrive}.device;
|
||||
fsType = "cifs";
|
||||
options = synology.${synologyDrive}.options ++ [
|
||||
"credentials=${synologySecrets}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
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/cca4aaac-9f98-42a5-8bcc-81c7048aad84";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/7199-F75B";
|
||||
fsType = "vfat";
|
||||
options = mars.boot.options;
|
||||
};
|
||||
}
|
||||
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
||||
// (builtins.listToAttrs (map storageMounts storageDrives))
|
||||
// (builtins.listToAttrs (
|
||||
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
|
||||
));
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/d9c787ac-9f10-41a4-8702-242922f44056"; }
|
||||
];
|
||||
|
||||
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 -"
|
||||
"Z ${mars.storage0.mount} 0755 ${user0} users -"
|
||||
"Z ${mars.storage1.mount} 0755 ${user0} users -"
|
||||
];
|
||||
|
||||
services.udisks2.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue