added more config for nfs mounts

This commit is contained in:
Leyla Becker 2025-03-09 14:10:50 -05:00
parent f5c67b812f
commit 1e98b54454
6 changed files with 27 additions and 10 deletions

View file

@ -58,6 +58,7 @@
folder = "leyla";
user = "leyla";
group = "leyla";
bind = "/home/leyla/documents";
}
{
folder = "eve";
@ -69,6 +70,12 @@
user = "root";
group = "users";
}
{
folder = "media";
user = "jellyfin";
group = "jellyfin_media";
bind = config.host.jellyfin.media_directory;
}
];
nfs = {
enable = true;

View file

@ -38,23 +38,29 @@
fsType = "vfat";
};
"/mnt/leyla_home" = {
"/mnt/leyla_documents" = {
device = "defiant:/exports/leyla";
fsType = "nfs";
options = ["x-systemd.automount" "user" "noatime" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
};
"/mnt/eve_home" = {
"/mnt/eve_documents" = {
device = "defiant:/exports/eve";
fsType = "nfs";
options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
};
"/mnt/users_home" = {
"/mnt/users_documents" = {
device = "defiant:/exports/users";
fsType = "nfs";
options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
};
"/mnt/media" = {
device = "defiant:/exports/media";
fsType = "nfs";
options = ["user" "noatime" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
};
};
environment.systemPackages = with pkgs; [

View file

@ -47,13 +47,13 @@
options = ["fmask=0022" "dmask=0022"];
};
"/mnt/leyla_home" = {
"/mnt/leyla_documents" = {
device = "defiant:/exports/leyla";
fsType = "nfs";
options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];
};
"/mnt/users_home" = {
"/mnt/users_documents" = {
device = "defiant:/exports/users";
fsType = "nfs";
options = ["x-systemd.automount" "user" "nofail" "soft" "x-systemd.idle-timeout=600" "fsc"];

View file

@ -7,7 +7,6 @@
jellyfinPort = 8096;
jellyfin_data_directory = "/var/lib/jellyfin";
jellyfin_cache_directory = "/var/cache/jellyfin";
jellyfin_media_directory = "/srv/jellyfin/media";
in {
options.host.jellyfin = {
enable = lib.mkEnableOption "should jellyfin be enabled on this computer";
@ -21,6 +20,11 @@ in {
description = "ex subdomain of base domain that jellyfin will be hosted at";
default = [];
};
media_directory = lib.mkOption {
type = lib.types.str;
description = "directory jellyfin media will be hosted at";
default = "/srv/jellyfin/media";
};
};
config = lib.mkIf config.host.jellyfin.enable (
@ -126,7 +130,7 @@ in {
hideMounts = true;
directories = [
{
directory = jellyfin_media_directory;
directory = config.host.jellyfin.media_directory;
user = "jellyfin";
group = "jellyfin_media";
mode = "1770";

View file

@ -57,7 +57,7 @@ in {
# create any folders that we need to have for our exports
systemd.tmpfiles.rules =
[
"d ${config.host.network_storage.export_directory} 2770 root root -"
"d ${config.host.network_storage.export_directory} 2775 root root -"
]
++ (
builtins.map (

View file

@ -38,8 +38,8 @@
services.nfs.server = {
enable = true;
exports = lib.strings.concatLines (
builtins.map (
directory: "${directory._directory} 100.64.0.0/10(rw,sync,no_subtree_check,crossmnt)"
lib.lists.imap0 (
i: directory: "${directory._directory} 100.64.0.0/10(rw,sync,no_subtree_check,crossmnt,fsid=${builtins.toString i})"
)
(
builtins.filter (