mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-15 09:35:12 -05:00
feat: added samba mount for audiobookshelf
This commit is contained in:
parent
eb63e130eb
commit
4d1a19edfd
3 changed files with 15 additions and 18 deletions
|
@ -1,11 +1,6 @@
|
|||
{ instancesFunctions }:
|
||||
let
|
||||
inherit (instancesFunctions)
|
||||
jellyfinLabel
|
||||
jellyfinName
|
||||
audiobookshelfLabel
|
||||
audiobookshelfName
|
||||
servicePath
|
||||
sopsPath
|
||||
;
|
||||
|
||||
|
@ -19,12 +14,6 @@ in
|
|||
path0 = "${sopsPath}/${sambaName}";
|
||||
};
|
||||
paths = {
|
||||
path0 = "${servicePath}/${jellyfinLabel}";
|
||||
path1 = jellyfinName;
|
||||
path2 = "";
|
||||
path3 = "${servicePath}/${audiobookshelfLabel}";
|
||||
path4 = audiobookshelfName;
|
||||
path6 = "";
|
||||
};
|
||||
ports = {
|
||||
port0 = 445; # Samba
|
||||
|
|
|
@ -20,11 +20,11 @@ in
|
|||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
${service.paths.path1} = {
|
||||
${jellyfin.name} = {
|
||||
path = jellyfin.paths.path0;
|
||||
writable = "true";
|
||||
};
|
||||
${service.paths.path4} = {
|
||||
${audiobookshelf.name} = {
|
||||
path = audiobookshelf.paths.path0;
|
||||
writable = "true";
|
||||
};
|
||||
|
|
|
@ -15,8 +15,9 @@ let
|
|||
;
|
||||
inherit (flake.config.services.instances)
|
||||
samba
|
||||
jellyfin
|
||||
audiobookshelf
|
||||
;
|
||||
|
||||
synologySecrets = config.sops.secrets."network/synology".path;
|
||||
ceresSecrets = config.sops.secrets."network/server".path;
|
||||
in
|
||||
|
@ -38,6 +39,11 @@ in
|
|||
"samba0"
|
||||
];
|
||||
|
||||
sambaFolders = [
|
||||
audiobookshelf.name
|
||||
jellyfin.name
|
||||
];
|
||||
|
||||
synologyMounts = synologyDrive: {
|
||||
name = "${synology.${synologyDrive}.mount}";
|
||||
value = {
|
||||
|
@ -58,10 +64,10 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
sambaMounts = sambaDrive: {
|
||||
name = "${ceres.${sambaDrive}.mount}/${samba.paths.path1}";
|
||||
sambaMounts = sambaDrive: folder: {
|
||||
name = "${ceres.${sambaDrive}.mount}/${folder}";
|
||||
value = {
|
||||
device = "${ceres.${sambaDrive}.device}/${samba.paths.path1}";
|
||||
device = "${ceres.${sambaDrive}.device}/${folder}";
|
||||
fsType = "cifs";
|
||||
options = ceres.${sambaDrive}.options ++ [
|
||||
"credentials=${ceresSecrets}"
|
||||
|
@ -82,7 +88,9 @@ in
|
|||
}
|
||||
// (builtins.listToAttrs (map synologyMounts synologyDrives))
|
||||
// (builtins.listToAttrs (map storageMounts storageDrives))
|
||||
// (builtins.listToAttrs (map sambaMounts sambaDrives));
|
||||
// (builtins.listToAttrs (
|
||||
builtins.concatMap (drive: map (folder: sambaMounts drive folder) sambaFolders) sambaDrives
|
||||
));
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/8b1d43a7-baf8-4d15-a1ad-dc0c9dda6970"; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue