aboutsummaryrefslogtreecommitdiffstats
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/arrakis/default.nix35
1 files changed, 18 insertions, 17 deletions
diff --git a/hosts/arrakis/default.nix b/hosts/arrakis/default.nix
index dae348c..1bb0c32 100644
--- a/hosts/arrakis/default.nix
+++ b/hosts/arrakis/default.nix
@@ -258,9 +258,7 @@
wantedBy = [ "multi-user.target" ];
};
- "nftables-extra" = {
- description = "nftables extra firewall rules";
- script = ''
+ "nftables-extra" = let rules_script = ''
${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "wlp5s0" tcp dport { http, https } counter accept # 80, 443'
${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "wlp5s0" udp dport { netbios-ns, netbios-dgm } counter accept # 137, 138'
${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "wlp5s0" tcp dport { netbios-ssn, microsoft-ds } counter accept # 139, 445'
@@ -273,20 +271,23 @@
${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "wlp5s0" ip saddr 192.168.1.0/24 tcp dport { 27036, 27037 } counter accept # Steam Remote Play'
${pkgs.nftables}/bin/nft insert rule inet nixos-fw input 'iifname "wlp5s0" udp dport 51820 counter accept # WireGuard'
${pkgs.nftables}/bin/nft -f ${config.sops.secrets."nftables/ssh".path}
- '';
- serviceConfig = {
- RemainAfterExit = true;
- Type = "oneshot";
- };
- unitConfig = {
- ConditionPathExists = [
- config.sops.secrets."nftables/ssh".path
- ];
- ReloadPropagatedFrom = "nftables.service";
- };
- wantedBy = [ "multi-user.target" ];
- after = [ "nftables.service" ];
- partOf = [ "nftables.service" ];
+ ''; in {
+ description = "nftables extra firewall rules";
+ reload = rules_script;
+ script = rules_script;
+ serviceConfig = {
+ RemainAfterExit = true;
+ Type = "oneshot";
+ };
+ unitConfig = {
+ ConditionPathExists = [
+ config.sops.secrets."nftables/ssh".path
+ ];
+ ReloadPropagatedFrom = "nftables.service";
+ };
+ wantedBy = [ "multi-user.target" ];
+ after = [ "nftables.service" ];
+ partOf = [ "nftables.service" ];
};
"prowlarr" = {