Break networking out to its own file.
This makes it easier to figure out what needs review and changing Also switch to the latest detected hardware state.
This commit is contained in:
parent
122554c4aa
commit
bbc2bbb5e1
4 changed files with 54 additions and 24 deletions
|
|
@ -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 =
|
||||
[
|
||||
|
|
|
|||
|
|
@ -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.<interface>.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;
|
||||
}
|
||||
|
|
|
|||
18
nixos-anywhere/nocix/hardware-configuration.nix.old
Normal file
18
nixos-anywhere/nocix/hardware-configuration.nix.old
Normal file
|
|
@ -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;
|
||||
}
|
||||
25
nixos-anywhere/nocix/network.nix
Normal file
25
nixos-anywhere/nocix/network.nix
Normal file
|
|
@ -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"];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue