feat: added samba mount for audiobookshelf

This commit is contained in:
Nick 2025-03-18 23:25:41 -05:00
parent eb63e130eb
commit 4d1a19edfd
3 changed files with 15 additions and 18 deletions

View file

@ -1,11 +1,6 @@
{ instancesFunctions }: { instancesFunctions }:
let let
inherit (instancesFunctions) inherit (instancesFunctions)
jellyfinLabel
jellyfinName
audiobookshelfLabel
audiobookshelfName
servicePath
sopsPath sopsPath
; ;
@ -19,12 +14,6 @@ in
path0 = "${sopsPath}/${sambaName}"; path0 = "${sopsPath}/${sambaName}";
}; };
paths = { paths = {
path0 = "${servicePath}/${jellyfinLabel}";
path1 = jellyfinName;
path2 = "";
path3 = "${servicePath}/${audiobookshelfLabel}";
path4 = audiobookshelfName;
path6 = "";
}; };
ports = { ports = {
port0 = 445; # Samba port0 = 445; # Samba

View file

@ -20,11 +20,11 @@ in
enable = true; enable = true;
openFirewall = true; openFirewall = true;
settings = { settings = {
${service.paths.path1} = { ${jellyfin.name} = {
path = jellyfin.paths.path0; path = jellyfin.paths.path0;
writable = "true"; writable = "true";
}; };
${service.paths.path4} = { ${audiobookshelf.name} = {
path = audiobookshelf.paths.path0; path = audiobookshelf.paths.path0;
writable = "true"; writable = "true";
}; };

View file

@ -15,8 +15,9 @@ let
; ;
inherit (flake.config.services.instances) inherit (flake.config.services.instances)
samba samba
jellyfin
audiobookshelf
; ;
synologySecrets = config.sops.secrets."network/synology".path; synologySecrets = config.sops.secrets."network/synology".path;
ceresSecrets = config.sops.secrets."network/server".path; ceresSecrets = config.sops.secrets."network/server".path;
in in
@ -38,6 +39,11 @@ in
"samba0" "samba0"
]; ];
sambaFolders = [
audiobookshelf.name
jellyfin.name
];
synologyMounts = synologyDrive: { synologyMounts = synologyDrive: {
name = "${synology.${synologyDrive}.mount}"; name = "${synology.${synologyDrive}.mount}";
value = { value = {
@ -58,10 +64,10 @@ in
}; };
}; };
sambaMounts = sambaDrive: { sambaMounts = sambaDrive: folder: {
name = "${ceres.${sambaDrive}.mount}/${samba.paths.path1}"; name = "${ceres.${sambaDrive}.mount}/${folder}";
value = { value = {
device = "${ceres.${sambaDrive}.device}/${samba.paths.path1}"; device = "${ceres.${sambaDrive}.device}/${folder}";
fsType = "cifs"; fsType = "cifs";
options = ceres.${sambaDrive}.options ++ [ options = ceres.${sambaDrive}.options ++ [
"credentials=${ceresSecrets}" "credentials=${ceresSecrets}"
@ -82,7 +88,9 @@ in
} }
// (builtins.listToAttrs (map synologyMounts synologyDrives)) // (builtins.listToAttrs (map synologyMounts synologyDrives))
// (builtins.listToAttrs (map storageMounts storageDrives)) // (builtins.listToAttrs (map storageMounts storageDrives))
// (builtins.listToAttrs (map sambaMounts sambaDrives)); // (builtins.listToAttrs (
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
));
swapDevices = [ swapDevices = [
{ device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; } { device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; }