Move individual custom firewall rules to their own service files

This commit is contained in:
Bun 2025-03-18 03:27:12 -04:00
parent 7635beefb7
commit 505298331e
7 changed files with 61 additions and 43 deletions

View file

@ -1,14 +1,24 @@
{ config, ... }:
{ config, lib, ... }:
{
imports = [ ./user ];
services.nfs.server = {
enable = config.system.fileserver.enable;
exports = ''
/storage/Files *(rw,sync,no_subtree_check)
/storage/Media *(rw,sync,no_subtree_check)
/storage/Music *(rw,sync,no_subtree_check)
/srv/minecraft *(rw,sync,no_subtree_check)
'';
config = lib.mkIf config.system.fileserver.enable {
services.nfs.server = {
enable = true;
exports = ''
/storage/Files *(rw,sync,no_subtree_check)
/storage/Media *(rw,sync,no_subtree_check)
/storage/Music *(rw,sync,no_subtree_check)
/srv/minecraft *(rw,sync,no_subtree_check)
'';
};
networking.nftables.tables.nfs = {
family = "inet";
content = ''
chain input {
ip saddr 10.0.0.0/8 tcp dport 2049 accept comment "Accept NFS"
}
'';
};
};
}