Push these changes to a branch cause I'm kind of giving up
This commit is contained in:
parent
d9469fc321
commit
e3bacb2d84
229 changed files with 1496 additions and 1479 deletions
23
hosts/JimDesktop/configuration.nix
Normal file
23
hosts/JimDesktop/configuration.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
imports = [
|
||||
# Base configs
|
||||
./../../system
|
||||
./../../system/pc.nix
|
||||
|
||||
# Hardware
|
||||
./hardware-configuration.nix
|
||||
./../../system/modules/boot/systemd
|
||||
];
|
||||
|
||||
# Enable Nvidia drivers
|
||||
drivers.nvidia.enable = true;
|
||||
|
||||
# Set hostname
|
||||
networking.hostName = "JimDesktop";
|
||||
|
||||
# Force Electron to use Wayland
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = "24.05";
|
||||
}
|
113
hosts/JimDesktop/hardware-configuration.nix
Normal file
113
hosts/JimDesktop/hardware-configuration.nix
Normal file
|
@ -0,0 +1,113 @@
|
|||
{ config, lib, pkgs, outputs, modulesPath, ... }: let
|
||||
# Set common boot paramaters
|
||||
commonKernelParams = [
|
||||
# Nvidia settings
|
||||
"nvidia_drm.fbdev=1"
|
||||
"nouveau.config=NvGspRm=1"
|
||||
|
||||
# VM/GPU passthrough
|
||||
"amd_iommu=on"
|
||||
"iommu=pt"
|
||||
"nested=1"
|
||||
|
||||
# Virtualization nonsense
|
||||
"transparent_hugepage=never"
|
||||
|
||||
# Isolate devices into IOMMU groups
|
||||
"pcie_acs_override=downstream,multifunction"
|
||||
"pci=routeirq"
|
||||
];
|
||||
in {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# Set all boot options
|
||||
boot = {
|
||||
# Set a kernel version and load/blacklist drivers
|
||||
kernelPackages = pkgs.unstable.linuxPackages_zen;
|
||||
blacklistedKernelModules = [
|
||||
"pcspkr"
|
||||
];
|
||||
kernel.sysctl."vm.max_map_count" = 2147483642;
|
||||
kernelParams = commonKernelParams ++ [
|
||||
"vfio-pci.ids=10de:1f82,10de:10fa"
|
||||
];
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
kernelModules = [
|
||||
"vfio"
|
||||
"vfio_pci"
|
||||
"vfio_iommu_type1"
|
||||
"kvm-amd"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Additional entry to boot from the second GPU
|
||||
specialisation = {
|
||||
gputwo.configuration = {
|
||||
boot.kernelParams = commonKernelParams ++ ["vfio-pci.ids=10de:2504,10de:228e"];
|
||||
};
|
||||
};
|
||||
|
||||
# Mount everything as necessary
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/f0786b07-8303-416f-87ff-276bfd696387";
|
||||
fsType = "bcachefs";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/EF6D-9009";
|
||||
fsType = "vfat";
|
||||
};
|
||||
"/etc/libvirt" = {
|
||||
device = "/dev/disk/by-label/Qemu";
|
||||
options = ["nosuid" "nodev" "nofail"];
|
||||
};
|
||||
"/var/lib/libvirt" = {
|
||||
depends = ["/etc/libvirt"];
|
||||
device = "/etc/libvirt/varlibvirt";
|
||||
options = ["bind" "rw"];
|
||||
};
|
||||
"/mnt/Linux1" = {
|
||||
device = "/dev/disk/by-label/Linux1";
|
||||
options = ["nosuid" "nodev" "nofail" "x-gvfs-show"];
|
||||
};
|
||||
"/mnt/Linux2" = {
|
||||
device = "/dev/disk/by-label/Linux2";
|
||||
options = ["nosuid" "nodev" "nofail" "x-gvfs-show"];
|
||||
};
|
||||
"/mnt/Windows1" = {
|
||||
device = "/dev/disk/by-label/Windows1";
|
||||
options = ["nosuid" "nodev" "noauto"];
|
||||
};
|
||||
"/mnt/Windows2" = {
|
||||
device = "/dev/disk/by-label/Windows2";
|
||||
options = ["nosuid" "nodev" "noauto"];
|
||||
};
|
||||
"/home/jimbo/JimboNFS" = {
|
||||
device = "${outputs.ips.server}:/export/JimboNFS";
|
||||
fsType = "nfs4";
|
||||
options = ["x-systemd.automount" "_netdev" "nofail" "noauto"];
|
||||
};
|
||||
};
|
||||
|
||||
# Set the swap partition
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/2e4c5120-716d-4cdc-84a0-c9e6391760db";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
26
hosts/JimDesktop/home.nix
Normal file
26
hosts/JimDesktop/home.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{config, ...}: {
|
||||
imports = [
|
||||
# Common modules
|
||||
./../../home
|
||||
./../../home/pc.nix
|
||||
];
|
||||
|
||||
# Useful
|
||||
general.enable = true;
|
||||
chat.enable = true;
|
||||
avtools.enable = true;
|
||||
production.enable = true;
|
||||
obs.enable = true;
|
||||
remotedesktop.enable = false;
|
||||
school.enable = true;
|
||||
|
||||
# Gaming
|
||||
pcgaming.enable = true;
|
||||
emulators.enable = false;
|
||||
xash3d.enable = true;
|
||||
|
||||
# Symlinks
|
||||
home.file = {
|
||||
"VMs".source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs";
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue