mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 22:57:55 +00:00
Gabriel Arazas
9b03f4d4aa
It is simple anyways requiring only one of the ethernet interfaces to be present to the global network while the rest can be in the local network.
63 lines
1.7 KiB
Nix
63 lines
1.7 KiB
Nix
{ config, lib, pkgs, modulesPath, ... }:
|
|
|
|
# Most of the filesystems listed here are supposed to be overriden to default
|
|
# settings of whatever image format configuration this host system will import
|
|
# from nixos-generators.
|
|
let
|
|
network = import ./networks.nix;
|
|
inherit (network) publicIP publicIPv6 privateNetworkGatewayIP;
|
|
in
|
|
|
|
{
|
|
imports = [
|
|
(modulesPath + "/profiles/qemu-guest.nix")
|
|
];
|
|
|
|
boot.loader.grub.device = "/dev/sda";
|
|
boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ];
|
|
boot.initrd.kernelModules = [ "nvme" ];
|
|
|
|
fileSystems."/" = lib.mkOverride 2000 {
|
|
label = "nixos";
|
|
fsType = "ext4";
|
|
options = [ "defaults" ];
|
|
};
|
|
|
|
fileSystems."/boot" = lib.mkOverride 2000 {
|
|
label = "boot";
|
|
fsType = "vfat";
|
|
};
|
|
|
|
zramSwap = {
|
|
enable = true;
|
|
numDevices = 1;
|
|
};
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
|
|
networking = {
|
|
useDHCP = false;
|
|
usePredictableInterfaceNames = true;
|
|
useNetworkd = true;
|
|
|
|
# We're using networkd to configure so we're disabling this
|
|
# service.
|
|
dhcpcd.enable = false;
|
|
};
|
|
|
|
# The interface configuration is based from the following discussion:
|
|
# https://discourse.nixos.org/t/nixos-on-hetzner-cloud-servers-ipv6/221/
|
|
systemd.network = {
|
|
enable = true;
|
|
networks."20-wan" = {
|
|
matchConfig.Name = "en*";
|
|
networkConfig.DHCP = "yes";
|
|
};
|
|
};
|
|
|
|
# This is to look out for any errors that will occur for my networking setup
|
|
# which is always a possibility.
|
|
systemd.services.systemd-networkd.serviceConfig.Environment = "SYSTEMD_LOG_LEVEL=debug";
|
|
}
|