diff --git a/nixos-anywhere/nocix/configuration.nix b/nixos-anywhere/nocix/configuration.nix index df11acb..9df223f 100644 --- a/nixos-anywhere/nocix/configuration.nix +++ b/nixos-anywhere/nocix/configuration.nix @@ -9,6 +9,7 @@ (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") ./disk-config.nix + ./network.nix ]; boot.loader.grub = { # no need to set devices, disko will add all devices that have a EF02 partition to the list already @@ -21,28 +22,6 @@ pkgs.dig pkgs.gitMinimal ]; - networking = { - defaultGateway = { - address = "107.150.59.201"; - interface = "enp2s0"; - }; - defaultGateway6 = { - address = "2604:4300:a:27e::1"; - interface = "enp2s0"; - }; - interfaces.enp2s0 = { - ipv4.addresses = [{ - address = "107.150.59.202"; - prefixLength = 29; - }]; - ipv6.addresses = [{ - address = "2604:4300:a:27e::2"; - prefixLength = 64; - }]; - }; - nameservers = ["192.187.107.16"]; - search = ["nocix.net"]; - }; services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ diff --git a/nixos-anywhere/nocix/hardware-configuration.nix b/nixos-anywhere/nocix/hardware-configuration.nix index b28296a..b3c19c3 100644 --- a/nixos-anywhere/nocix/hardware-configuration.nix +++ b/nixos-anywhere/nocix/hardware-configuration.nix @@ -9,10 +9,18 @@ ]; boot.initrd.availableKernelModules = [ "ahci" "ohci_pci" "ehci_pci" "xhci_pci" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } diff --git a/nixos-anywhere/nocix/hardware-configuration.nix.old b/nixos-anywhere/nocix/hardware-configuration.nix.old new file mode 100644 index 0000000..b28296a --- /dev/null +++ b/nixos-anywhere/nocix/hardware-configuration.nix.old @@ -0,0 +1,18 @@ +# 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 = [ "ahci" "ohci_pci" "ehci_pci" "xhci_pci" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos-anywhere/nocix/network.nix b/nixos-anywhere/nocix/network.nix new file mode 100644 index 0000000..591b46e --- /dev/null +++ b/nixos-anywhere/nocix/network.nix @@ -0,0 +1,25 @@ +{ lib, ... }: +{ + networking = { + defaultGateway = { + address = "63.141.227.153"; + interface = "enp3s0"; + }; + defaultGateway6 = { + address = "2604:4300:a:88::1"; + interface = "enp3s0"; + }; + interfaces.enp2s0 = { + ipv4.addresses = [{ + address = "63.141.227.154"; + prefixLength = 29; + }]; + ipv6.addresses = [{ + address = "2604:4300:a:88::2"; + prefixLength = 64; + }]; + }; + nameservers = ["8.8.8.8"]; + search = ["nocix.net"]; + }; +}