]> Git — Sourcephile - julm/julm-nix.git/blob - nixos/profiles/networking.nix
zfs: relax scrubbing and trimming intervals
[julm/julm-nix.git] / nixos / profiles / networking.nix
1 { config, pkgs, lib, hostName, ... }:
2 let
3 wg-intra-peers = import wireguard/wg-intra/peers.nix;
4 in
5 {
6 networking = {
7 hostName = hostName;
8 domain = lib.mkDefault "localdomain";
9 #search = [ "sourcephile.fr" ];
10 firewall = {
11 enable = lib.mkDefault true;
12 allowPing = lib.mkDefault true;
13 };
14 networkmanager = {
15 enable = lib.mkDefault config.services.xserver.enable;
16 #dhcp = "dhcpcd";
17 logLevel = lib.mkDefault "INFO";
18 wifi = {
19 #backend = "iwd";
20 #backend = "wpa_supplicant";
21 powersave = lib.mkDefault false;
22 };
23 };
24 };
25
26 programs.mtr.enable = true;
27 programs.usbtop.enable = true;
28
29 services.avahi = {
30 enable = lib.mkDefault true;
31 nssmdns = lib.mkDefault true;
32 openFirewall = lib.mkDefault false;
33 publish.enable = lib.mkDefault false;
34 };
35
36 services.openssh = {
37 enable = lib.mkDefault true;
38 forwardX11 = lib.mkDefault true;
39 openFirewall = lib.mkDefault false;
40 listenAddresses = [
41 { addr = wg-intra-peers.${hostName}.ipv4; port = 22; }
42 ];
43 };
44 networking.firewall.extraCommands = lib.mkIf config.services.openssh.enable ''
45 ip46tables -A nixos-fw -i wg-intra -p tcp -m tcp --dport 22 -j ACCEPT
46 '';
47 systemd.services.sshd.after = ["wireguard-wg-intra.service"];
48 }