Change network

This commit is contained in:
muon 2024-09-12 18:09:17 +00:00
parent e73f27a94c
commit 103f7c4813
2 changed files with 44 additions and 47 deletions

View file

@ -4,19 +4,18 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/03e49688-cc62-49c9-a906-e2ea87a38891"; device = "/dev/disk/by-uuid/03e49688-cc62-49c9-a906-e2ea87a38891";
fsType = "ext4"; fsType = "ext4";
}; };
boot.initrd.luks.devices = { boot.initrd.luks.devices = {
"luks-root".device = "luks-root".device =
@ -25,23 +24,24 @@
"/dev/disk/by-uuid/0418acfc-792c-43f4-a887-cc8bb51fa7c3"; "/dev/disk/by-uuid/0418acfc-792c-43f4-a887-cc8bb51fa7c3";
}; };
fileSystems."/mnt/bulk" = fileSystems."/mnt/bulk" = {
{ device = "/dev/disk/by-uuid/11c2c896-d49a-4d9b-a846-b0a550128395"; device = "/dev/disk/by-uuid/11c2c896-d49a-4d9b-a846-b0a550128395";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = fileSystems."/boot" = {
{ device = "/dev/disk/by-uuid/CCCC-449E"; device = "/dev/disk/by-uuid/CCCC-449E";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };
swapDevices = [{ swapDevices = [
device = "/dev/disk/by-uuid/e7cf209d-386d-41db-8a35-6c9fff014722"; { device = "/dev/disk/by-uuid/e7cf209d-386d-41db-8a35-6c9fff014722"; }
} { {
device = "/var/lib/swapfile"; device = "/var/lib/swapfile";
size = 8*1024; size = 8 * 1024;
}]; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's
@ -50,10 +50,11 @@
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.docker0.useDHCP = lib.mkDefault true; # networking.interfaces.docker0.useDHCP = lib.mkDefault true;
networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
networking.interfaces.enp0s31f6.mtu = 1200; # networking.interfaces.enp0s31f6.mtu = 1200;
# networking.interfaces.tun0.useDHCP = lib.mkDefault true; # networking.interfaces.tun0.useDHCP = lib.mkDefault true;
# networking.interfaces.vboxnet0.useDHCP = lib.mkDefault true; # networking.interfaces.vboxnet0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }

View file

@ -6,9 +6,7 @@
}; };
}; };
imports = [ imports = [ ./steam.nix ];
./steam.nix
];
config = lib.mkIf config.mods.containers.enable { config = lib.mkIf config.mods.containers.enable {
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
@ -18,26 +16,26 @@
}; };
networking.nat = { networking.nat = {
enable = true; enable = true;
internalInterfaces = ["ve-+"]; internalInterfaces = [ "ve-+" ];
externalInterface = "enp0s31f6"; externalInterface = "enp0s31f6";
}; };
networking.networkmanager.unmanaged = [ "interface-name:ve-*" ]; networking.networkmanager.unmanaged = [ "interface-name:ve-*" ];
networking = { # networking = {
bridges.br0.interfaces = [ "enp0s31f6" ]; # Adjust interface accordingly # bridges.br0.interfaces = [ "enp0s31f6" ]; # Adjust interface accordingly
# Get bridge-ip with DHCP # # Get bridge-ip with DHCP
useDHCP = false; # useDHCP = false;
interfaces."br0".useDHCP = true; # interfaces."br0".useDHCP = true;
# Set bridge-ip static # # Set bridge-ip static
interfaces."br0".ipv4.addresses = [{ # interfaces."br0".ipv4.addresses = [{
address = "192.168.1.171"; # address = "192.168.1.171";
prefixLength = 24; # prefixLength = 24;
}]; # }];
defaultGateway = "192.168.1.1"; # defaultGateway = "192.168.1.1";
nameservers = [ "192.168.1.1" ]; # nameservers = [ "192.168.1.1" ];
}; # };
# networking.firewall.allowedTCPPorts = [ 4713 6000 ]; # networking.firewall.allowedTCPPorts = [ 4713 6000 ];
# hardware.pulseaudio = { # hardware.pulseaudio = {
@ -47,8 +45,6 @@
# tcp = { enable = true; anonymousClients = { allowedIpRanges = ["127.0.0.1" "192.168.100.0/24"]; }; }; # tcp = { enable = true; anonymousClients = { allowedIpRanges = ["127.0.0.1" "192.168.100.0/24"]; }; };
# }; # };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [ xorg.xhost ];
xorg.xhost
];
}; };
} }