feat: added ceres samba mount

This commit is contained in:
Nick 2025-11-14 02:19:16 -06:00
parent 229a1f8b3f
commit 65cda6178f

View file

@ -5,26 +5,28 @@
}: }:
let let
inherit (flake.config.people) user0; inherit (flake.config.people) user0;
inherit (flake.config.machines.devices) mars eris; inherit (flake.config.machines.devices) mars eris ceres;
erisSecrets = config.sops.secrets."network/server".path; sambaSecrets = config.sops.secrets."network/server".path;
in in
{ {
fileSystems = fileSystems =
let let
storageDrives = [ storageDrives = [
"storage0" "storage0"
"storage1" "storage1"
]; ];
erisDrives = [
sambaDrives = [
"samba0" "samba0"
]; ];
erisFolders = [
sambaFolders = [
"raid0" "raid0"
]; ];
ceresDrives = [
"samba0"
];
ceresFolders = [
"storage"
];
storageMounts = storageDrive: { storageMounts = storageDrive: {
name = "${mars.${storageDrive}.mount}"; name = "${mars.${storageDrive}.mount}";
value = { value = {
@ -33,14 +35,23 @@ in
options = mars.${storageDrive}.options; options = mars.${storageDrive}.options;
}; };
}; };
erisMounts = sambaDrive: folder: {
sambaMounts = sambaDrive: folder: {
name = "${eris.${sambaDrive}.mount}/${folder}"; name = "${eris.${sambaDrive}.mount}/${folder}";
value = { value = {
device = "${eris.${sambaDrive}.device}/${folder}"; device = "${eris.${sambaDrive}.device}/${folder}";
fsType = "cifs"; fsType = "cifs";
options = eris.${sambaDrive}.options ++ [ options = eris.${sambaDrive}.options ++ [
"credentials=${erisSecrets}" "credentials=${sambaSecrets}"
];
};
};
ceresMounts = sambaDrive: folder: {
name = "${ceres.${sambaDrive}.mount}/${folder}";
value = {
device = "${ceres.${sambaDrive}.device}/${folder}";
fsType = "cifs";
options = ceres.${sambaDrive}.options ++ [
"credentials=${sambaSecrets}"
]; ];
}; };
}; };
@ -58,7 +69,10 @@ in
} }
// (builtins.listToAttrs (map storageMounts storageDrives)) // (builtins.listToAttrs (map storageMounts storageDrives))
// (builtins.listToAttrs ( // (builtins.listToAttrs (
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives builtins.concatMap (drive: map (folder: ceresMounts drive folder) ceresFolders) ceresDrives
))
// (builtins.listToAttrs (
builtins.concatMap (drive: map (folder: erisMounts drive folder) erisFolders) erisDrives
)); ));
swapDevices = [ swapDevices = [