Skip to content

Commit

Permalink
feat(host/desktop): setup firewall in teruko module
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichthagel committed Jun 17, 2024
1 parent 59db3f4 commit c7eb7bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hosts/jdnixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
./forgejo.nix
./renovate.nix
./rss.nix
./teruko_os.nix

inputs.nixos-hardware.nixosModules.common-cpu-amd
inputs.nixos-hardware.nixosModules.common-cpu-amd-pstate
Expand Down Expand Up @@ -157,7 +158,6 @@

# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [
3030
3456
22000
];
Expand Down
2 changes: 0 additions & 2 deletions hosts/jdnixos/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
...
}:
{
imports = [ ./teruko.nix ];

home.packages = with pkgs; [
calibre
anki
Expand Down
9 changes: 8 additions & 1 deletion hosts/jdnixos/teruko.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ inputs', ... }:
{
systemd.user.services.teruko = {
home-manager.users.licht.systemd.user.services.teruko = {
Unit = {
Description = "Teruko";
After = [ "network.target" ];
Expand All @@ -21,4 +21,11 @@
WantedBy = [ "default.target" ];
};
};

networking.nftables.tables.nixos-fw.content = ''
chain input-allow {
iifname wg0 tcp dport { 3030 } accept
ip saddr 192.168.1.0/24 tcp dport { 3030 } accept
}
'';
}

0 comments on commit c7eb7bd

Please sign in to comment.