Add networking and hardware-configuration modules

This commit is contained in:
coolneng 2021-04-06 11:10:49 +02:00
parent 6273a5e999
commit 08db88e202
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
};
swapDevices = [ ];
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
}

40
modules/networking.nix Normal file
View File

@ -0,0 +1,40 @@
{ config, lib, pkgs, ... }:
{
# Assign a static IP
networking = {
hostName = "aegis";
hostId = "78bb604d";
interfaces.eth0 = {
useDHCP = false;
ipv4.addresses = [{
address = "10.0.1.4";
prefixLength = 24;
}];
};
defaultGateway = {
address = "10.0.1.1";
interface = "eth0";
};
nameservers = [ "1.1.1.1" "8.8.8.8" ];
enableIPv6 = false;
};
# Enable zeroconf
services.avahi = {
enable = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
};
};
# Firewall configuration
networking.firewall = {
allowedTCPPorts = [ ];
allowedUDPPorts = [ ];
};
}