]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/courge/networking.nix
julm: oignon: install transmission-remote-gtk
[julm/julm-nix.git] / hosts / courge / networking.nix
1 { pkgs, lib, ... }:
2 {
3 imports = [
4 ../../nixos/profiles/dnscrypt-proxy2.nix
5 ../../nixos/profiles/networking/remote.nix
6 ./nebula.nix
7 networking/nftables.nix
8 ];
9 install.substituteOnDestination = false;
10
11 networking.nftables.ruleset = lib.mkAfter ''
12 table inet filter {
13 chain input {
14 ip daddr 10.0.0.0/8 counter goto input-lan
15 ip daddr 172.16.0.0/12 counter goto input-lan
16 ip daddr 192.168.0.0/16 counter goto input-lan
17 ip daddr 224.0.0.0/3 counter goto input-lan
18 goto input-net
19 }
20 chain output {
21 ip daddr 10.0.0.0/8 counter goto output-lan
22 ip daddr 172.16.0.0/12 counter goto output-lan
23 ip daddr 192.168.0.0/16 counter goto output-lan
24 ip daddr 224.0.0.0/3 counter goto output-lan
25 jump output-net
26 log level warn prefix "output-net: " counter drop
27 }
28 }
29 '';
30
31 networking.networkmanager.enable = true;
32 services.avahi.enable = true;
33 services.openssh.settings.X11Forwarding = true;
34 services.vnstat.enable = true;
35 systemd.services.sshd.serviceConfig.LoadCredentialEncrypted = [
36 "host.key:${ssh/host.key.cred}"
37 ];
38 services.openssh.extraConfig = ''
39 Match User julm
40 ForceCommand systemd-inhibit --who="SSH session" --why="Active ssh user blocks suspend" --what=idle --mode=block bash
41 '';
42 }