fixed nfs
This commit is contained in:
parent
9bfddf14ce
commit
4a57978f45
6 changed files with 21 additions and 20 deletions
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
# Mount remote filesystem
|
# Mount remote filesystem
|
||||||
fileSystems."/mnt/remote/media" = {
|
fileSystems."/mnt/remote/media" = {
|
||||||
device = "sleeper-service:/mnt/storage";
|
device = "sleeper-service:/mnt/storage/media";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
options = [
|
options = [
|
||||||
"x-systemd.automount"
|
"x-systemd.automount"
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
# Firewall
|
# Firewall
|
||||||
networking.firewall.enable = true;
|
networking.firewall.enable = true;
|
||||||
networking.firewall.allowedTCPPorts = [ 22 23231];
|
networking.firewall.allowedTCPPorts = [ 22 3000 23231];
|
||||||
networking.firewall.allowedUDPPorts = [ 22 23231 ];
|
networking.firewall.allowedUDPPorts = [ 22 23231 ];
|
||||||
networking.nftables.enable = true;
|
networking.nftables.enable = true;
|
||||||
system.stateVersion = "23.05"; # Do not change this, it maintains data compatibility.
|
system.stateVersion = "23.05"; # Do not change this, it maintains data compatibility.
|
||||||
|
|
|
@ -22,10 +22,7 @@
|
||||||
{ device = "/dev/disk/by-uuid/E251-F60A";
|
{ device = "/dev/disk/by-uuid/E251-F60A";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
fileSystems."/mnt/remote/media" =
|
|
||||||
{ device = "sleeper-service:/mnt/storage";
|
|
||||||
fsType = "nfs";
|
|
||||||
};
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# 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
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
"git.geokkjer.eu" = {
|
"git.geokkjer.eu" = {
|
||||||
addSSL = true;
|
addSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/".proxyPass = "http://apps:3000";
|
locations."/".proxyPass = "http://grey-area:3000";
|
||||||
};
|
};
|
||||||
#"geokkjer.eu" = {
|
#"geokkjer.eu" = {
|
||||||
# default = true;
|
# default = true;
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
# Stream configuration for SSH forwarding to Git server
|
# Stream configuration for SSH forwarding to Git server
|
||||||
streamConfig = ''
|
streamConfig = ''
|
||||||
upstream git_ssh_backend {
|
upstream git_ssh_backend {
|
||||||
server apps:22;
|
server grey-area:22;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|
|
@ -58,10 +58,10 @@
|
||||||
# ];
|
# ];
|
||||||
|
|
||||||
# Create mount directories early in boot process
|
# Create mount directories early in boot process
|
||||||
systemd.tmpfiles.rules = [
|
# systemd.tmpfiles.rules = [
|
||||||
"d /mnt/storage 0755 root root -"
|
# "d /mnt/storage 0755 root root -"
|
||||||
"d /mnt/storage/media 0755 root root -"
|
# "d /mnt/storage/media 0755 root root -"
|
||||||
];
|
# ];
|
||||||
|
|
||||||
# Network configuration - using working setup from old config
|
# Network configuration - using working setup from old config
|
||||||
# networking.hostName = "sleeper-service";
|
# networking.hostName = "sleeper-service";
|
||||||
|
|
|
@ -9,19 +9,20 @@
|
||||||
# Export the storage directory (ZFS dataset)
|
# Export the storage directory (ZFS dataset)
|
||||||
# Allow access from both local network and Tailscale network
|
# Allow access from both local network and Tailscale network
|
||||||
exports = ''
|
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 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
|
# Create exports on startup
|
||||||
createMountPoints = true;
|
createMountPoints = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Ensure the storage subdirectories exist (ZFS dataset is mounted at /mnt/storage)
|
# Ensure the storage subdirectories exist (ZFS dataset is mounted at /mnt/storage)
|
||||||
systemd.tmpfiles.rules = [
|
# systemd.tmpfiles.rules = [
|
||||||
"d /mnt/storage/media 0755 sma users -"
|
# "d /mnt/storage/media 0755 sma users -"
|
||||||
"d /mnt/storage/downloads 0755 sma users -"
|
# "d /mnt/storage/downloads 0755 sma users -"
|
||||||
"d /mnt/storage/backups 0755 sma users -"
|
# "d /mnt/storage/backups 0755 sma users -"
|
||||||
"d /mnt/storage/shares 0755 sma users -"
|
# "d /mnt/storage/shares 0755 sma users -"
|
||||||
];
|
# ];
|
||||||
|
|
||||||
# Required packages for NFS
|
# Required packages for NFS
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
users.users.sma = {
|
users.users.sma = {
|
||||||
description = "Diziet Sma - System Administrator";
|
description = "Diziet Sma - System Administrator";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
|
uid = 1001; # Fixed UID for consistency across machines
|
||||||
group = "sma"; # Primary group
|
group = "sma"; # Primary group
|
||||||
|
|
||||||
# Admin privileges
|
# Admin privileges
|
||||||
|
@ -132,5 +133,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
# Create the sma group
|
# Create the sma group
|
||||||
users.groups.sma = {};
|
users.groups.sma = {
|
||||||
|
gid = 992; # Fixed GID for consistency across machines
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue