dotfiles/systems/fallaryn/filesystem.nix

66 lines
1.5 KiB
Nix
Raw Normal View History

2024-10-06 15:25:05 -05:00
{
config,
flake,
...
}: let
inherit (flake.config.people) user2;
inherit (flake.config.system.device) fallaryn nas;
secrets0 = config.sops.secrets."network/fallaryn".path;
in {
imports = [];
fileSystems = let
synologyDrives = [
"folder2"
];
storageDrives = [
"storage0"
"storage1"
];
synologyMounts = folder: {
name = "${nas.${folder}.mount}";
value = {
device = nas.${folder}.device;
fsType = "cifs";
options = nas.${folder}.options ++ ["credentials=${secrets0}"];
};
};
storageMounts = storage: {
name = "${fallaryn.${storage}.mount}";
value = {
device = fallaryn.${storage}.device;
fsType = "ext4";
options = fallaryn.${storage}.options;
};
};
in
{
"/" = {
device = "/dev/disk/by-uuid/d02cb367-26e0-4708-8840-75dcc4362ff4";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/22BD-5A25";
fsType = "vfat";
options = fallaryn.boot.options;
};
}
// (builtins.listToAttrs (map synologyMounts synologyDrives))
// (builtins.listToAttrs (map storageMounts storageDrives));
swapDevices = [
{device = "/dev/disk/by-uuid/cc7ab213-26c9-4567-91ca-9dba6e98c9d1";}
];
systemd.tmpfiles.rules = [
"Z ${config.home-manager.users.${user2}.home.homeDirectory} 0755 ${user2} users -"
"Z ${fallaryn.storage0.mount} 0755 ${user2} users -"
"Z ${fallaryn.storage1.mount} 0755 ${user2} users -"
];
services.udisks2.enable = true;
}