diff --git a/README.org b/README.org index 14e5093..d6a1da3 100644 --- a/README.org +++ b/README.org @@ -8,6 +8,6 @@ - ZFS pool configuration: hardware-configuration.nix - Network configuration: networking.nix - - Printing and scanner server: printing.nix + - Printing and scanner client: printing.nix All the modules are imported in *configuration.nix* diff --git a/configuration.nix b/configuration.nix index 273d4a6..9e5723b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -3,6 +3,7 @@ { # Kernel configuration boot = { + kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ "zfs.zfs_arc_max=536870912" ]; kernelModules = [ "i915" "acpi_call" ]; extraModulePackages = with config.boot.kernelPackages; [ acpi_call ]; @@ -44,4 +45,15 @@ # Clean tmp directory on shutdown boot.cleanTmpDir = true; + # Rotate logs after 7 days + services.journald.extraConfig = "SystemMaxFiles=7"; + + # Allow propietary software + nixpkgs.config.allowUnfree = true; + + # Import other configuration modules + imports = [ + ./modules/networking.nix + ]; + } diff --git a/modules/networking.nix b/modules/networking.nix new file mode 100644 index 0000000..badbf05 --- /dev/null +++ b/modules/networking.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + avahi + wireguard + ]; + + # Set hostname and hostid + networking = { + hostName = "panacea"; + hostId = ""; + }; + + # Enable zeroconf + services.avahi = { + enable = true; + nssmdns = true; + publish = { + enable = true; + userServices = true; + }; + reflector = true; + }; + + # Wireguard setup + networking.wireguard.interfaces = { + wg0 = { + ips = [ "10.8.0.4/32" ]; + privateKeyFile = "/home/coolneng/.wg/keys/privatekey"; + peers = [ + # zion + { + publicKey = "GN8lqPBZYOulh6xD4GhkoEWI65HMMCpSxJSH5871YnU="; + allowedIPs = [ "0.0.0.0/0" ]; + endpoint = "coolneng.duckdns.org:1194"; + persistentKeepalive = 25; + } + ]; + }; + }; + +}