fixed nfs

This commit is contained in:
Geir Okkenhaug Jerstad 2025-06-07 16:33:34 +00:00
parent 9bfddf14ce
commit 4a57978f45
6 changed files with 21 additions and 20 deletions

View file

@ -39,7 +39,7 @@
# Mount remote filesystem
fileSystems."/mnt/remote/media" = {
device = "sleeper-service:/mnt/storage";
device = "sleeper-service:/mnt/storage/media";
fsType = "nfs";
options = [
"x-systemd.automount"
@ -94,7 +94,7 @@
# Firewall
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 22 23231];
networking.firewall.allowedTCPPorts = [ 22 3000 23231];
networking.firewall.allowedUDPPorts = [ 22 23231 ];
networking.nftables.enable = true;
system.stateVersion = "23.05"; # Do not change this, it maintains data compatibility.

View file

@ -22,10 +22,7 @@
{ device = "/dev/disk/by-uuid/E251-F60A";
fsType = "vfat";
};
fileSystems."/mnt/remote/media" =
{ device = "sleeper-service:/mnt/storage";
fsType = "nfs";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -72,7 +72,7 @@
"git.geokkjer.eu" = {
addSSL = true;
enableACME = true;
locations."/".proxyPass = "http://apps:3000";
locations."/".proxyPass = "http://grey-area:3000";
};
#"geokkjer.eu" = {
# default = true;
@ -85,7 +85,7 @@
# Stream configuration for SSH forwarding to Git server
streamConfig = ''
upstream git_ssh_backend {
server apps:22;
server grey-area:22;
}
server {

View file

@ -58,10 +58,10 @@
# ];
# Create mount directories early in boot process
systemd.tmpfiles.rules = [
"d /mnt/storage 0755 root root -"
"d /mnt/storage/media 0755 root root -"
];
# systemd.tmpfiles.rules = [
# "d /mnt/storage 0755 root root -"
# "d /mnt/storage/media 0755 root root -"
# ];
# Network configuration - using working setup from old config
# networking.hostName = "sleeper-service";

View file

@ -10,18 +10,19 @@
# Allow access from both local network and Tailscale network
exports = ''
/mnt/storage 10.0.0.0/24(rw,sync,no_subtree_check,no_root_squash) 100.64.0.0/10(rw,sync,no_subtree_check,no_root_squash)
/mnt/storage/media 10.0.0.0/24(rw,sync,no_subtree_check,no_root_squash) 100.64.0.0/10(rw,sync,no_subtree_check,no_root_squash)
'';
# Create exports on startup
createMountPoints = true;
};
# Ensure the storage subdirectories exist (ZFS dataset is mounted at /mnt/storage)
systemd.tmpfiles.rules = [
"d /mnt/storage/media 0755 sma users -"
"d /mnt/storage/downloads 0755 sma users -"
"d /mnt/storage/backups 0755 sma users -"
"d /mnt/storage/shares 0755 sma users -"
];
# systemd.tmpfiles.rules = [
# "d /mnt/storage/media 0755 sma users -"
# "d /mnt/storage/downloads 0755 sma users -"
# "d /mnt/storage/backups 0755 sma users -"
# "d /mnt/storage/shares 0755 sma users -"
# ];
# Required packages for NFS
environment.systemPackages = with pkgs; [

View file

@ -7,6 +7,7 @@
users.users.sma = {
description = "Diziet Sma - System Administrator";
isNormalUser = true;
uid = 1001; # Fixed UID for consistency across machines
group = "sma"; # Primary group
# Admin privileges
@ -132,5 +133,7 @@
];
# Create the sma group
users.groups.sma = {};
users.groups.sma = {
gid = 992; # Fixed GID for consistency across machines
};
}