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