]> Git — Sourcephile - julm/julm-nix.git/blob - hosts/oignon/networking.nix
openvpn-calyx: fix nftables
[julm/julm-nix.git] / hosts / oignon / networking.nix
1 { pkgs, lib, ... }:
2 {
3 imports = [
4 ../../nixos/profiles/dnscrypt-proxy2.nix
5 ../../nixos/profiles/wireguard/wg-intra.nix
6 ../../nixos/profiles/networking/ssh.nix
7 ../../nixos/profiles/networking/wifi.nix
8 ../../nixos/profiles/openvpn/calyx.nix
9 ./wireguard.nix
10 networking/nftables.nix
11 ];
12 install.substituteOnDestination = false;
13 #networking.domain = "sourcephile.fr";
14 networking.useDHCP = false;
15
16 networking.nftables.ruleset = lib.mkAfter ''
17 table inet filter {
18 chain input {
19 goto input-net
20 }
21 chain output {
22 ip daddr 10.0.0.0/8 counter goto output-lan
23 ip daddr 172.16.0.0/12 counter goto output-lan
24 ip daddr 192.168.0.0/16 counter goto output-lan
25 ip daddr 224.0.0.0/3 counter goto output-lan
26 jump output-net
27 log level warn prefix "output-net: " counter drop
28 }
29 }
30 '';
31
32 networking.interfaces = { };
33
34 networking.networkmanager = {
35 enable = true;
36 unmanaged = [
37 ];
38 };
39 environment.etc."NetworkManager/system-connections/Prixtel.nmconnection" = {
40 mode = "600";
41 text = ''
42 [connection]
43 id=Prixtel
44 uuid=b223f550-dff1-4ba3-9755-cd4557faaa5a
45 type=gsm
46 autoconnect=false
47 permissions=user:julm:;
48
49 [gsm]
50 apn=sl2sfr
51 number=*99#
52 home-only=true
53
54 [ppp]
55
56 [ipv4]
57 method=auto
58
59 [ipv6]
60 addr-gen-mode=stable-privacy
61 method=disabled
62
63 [proxy]
64 '';
65 };
66
67 environment.systemPackages = [
68 pkgs.iw
69 pkgs.modem-manager-gui
70 ];
71
72 systemd.services.sshd.serviceConfig.LoadCredentialEncrypted = [
73 "host.key:${ssh/host.key.cred}"
74 ];
75 }