Add network configuration in a different module
This commit is contained in:
parent
c754716596
commit
9f39802d28
|
@ -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*
|
||||
|
|
|
@ -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
|
||||
];
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue