migrated location of /media folder

This commit is contained in:
baritone 2025-04-01 09:55:56 +02:00
parent e6ce4b32c7
commit 6ac9ddb8f9
4 changed files with 26 additions and 11 deletions

View file

@ -112,10 +112,10 @@
type = "zfs_fs";
mountpoint = "/opt";
};
media = {
type = "zfs_fs";
mountpoint = "/media";
};
# media = {
# type = "zfs_fs";
# mountpoint = "/media";
# };
};
};
};

Binary file not shown.

View file

@ -18,6 +18,7 @@
vpn-endpoint = "193.32.248.70";
enable-services = true;
wg-config = "/mnt/wg.conf";
jellyfin-gid = 989;
ports-list = pkgs.lib.attrsets.mapAttrsToList (name: value: value.port) ports;
in {
@ -30,9 +31,7 @@ in {
system.activationScripts."make-${vm-name}-data-dir" = lib.stringAfter ["var"] ''
mkdir -p /var/lib/${vm-name}
chmod -R 777 /var/lib/${vm-name}
chown -R microvm /var/lib/${vm-name}
chmod -R 777 /media
# chown -R microvm:jellyfin /var/lib/${vm-name}
'';
microvm.vms.${vm-name} = {
@ -67,7 +66,7 @@ in {
}
{
tag = "media-dir";
source = "/media";
source = "/var/lib/media";
mountPoint = "/media";
inherit proto;
}
@ -131,6 +130,18 @@ in {
programs.nano.enable = lib.mkForce false;
programs.vim.enable = true;
# Fix permissions with groups
users.users = {
sonarr.extraGroups = ["jellyfin"];
radarr.extraGroups = ["jellyfin"];
transmission.extraGroups = ["jellyfin"];
jackett.extraGroups = ["jellyfin"];
};
users.groups.jellyfin = {
gid = jellyfin-gid;
};
# Services
services.sonarr = pkgs.lib.mkIf enable-services {
enable = true;

View file

@ -6,6 +6,7 @@
}: let
host = "127.0.0.1";
port = 8096;
gid = 989;
in {
imports = [./nginx.nix];
# Enable VAAPI
@ -23,11 +24,14 @@ in {
];
};
# Set declarative gid
config.users.groups.jellyfin.gid = gid;
# Create folder for media
config.system.activationScripts."jellyfinMediaFolder" = lib.stringAfter ["var"] ''
mkdir -p /media
chmod -R 775 /media
chown -R jellyfin:jellyfin /media
mkdir -p /var/lib/media
chmod -R 775 /var/lib/media
chown -R jellyfin:jellyfin /var/lib/media
'';
# Enable Jellyfin