mirror of
https://github.com/materusPL/nixos-config
synced 2026-06-24 17:36:41 +00:00
materusPC: Init new config
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
# 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,
|
||||
...
|
||||
}:
|
||||
let
|
||||
video = [
|
||||
"video=HDMI-A-3:1920x1080@144"
|
||||
"video=DP-3:1920x1080@240"
|
||||
];
|
||||
vmCores = "8-15,24-31";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [
|
||||
"pci-stub"
|
||||
"amdgpu"
|
||||
"i2c_dev"
|
||||
"kvm_amd"
|
||||
"vfio"
|
||||
"vfio_iommu_type1"
|
||||
"vfio-pci"
|
||||
"kvmfr"
|
||||
];
|
||||
boot.extraModprobeConfig = ''
|
||||
options kvm_amd nested=1 avic=1 npt=1 sev=0
|
||||
options vfio_iommu_type1 allow_unsafe_interrupts=1
|
||||
options kvmfr static_size_mb=64
|
||||
'';
|
||||
boot.kernel.sysctl = {
|
||||
"vm.max_map_count" = 1000000;
|
||||
"vm.swappiness" = 10;
|
||||
"net.ipv4.ip_forward" = 1;
|
||||
};
|
||||
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||
v4l2loopback
|
||||
kvmfr
|
||||
];
|
||||
|
||||
boot.kernelParams = [
|
||||
"rcu_nocbs=${vmCores}"
|
||||
"nohz_full=${vmCores}"
|
||||
"vfio_iommu_type1.allow_unsafe_interrupts=1"
|
||||
"pcie_acs_override=downstream,multifunction"
|
||||
#''vfio-pci.ids="1002:744c"''
|
||||
"nox2apic"
|
||||
"nvme_core.default_ps_max_latency_us=0"
|
||||
"nvme_core.io_timeout=255"
|
||||
"nvme_core.max_retries=10"
|
||||
"nvme_core.shutdown_timeout=10"
|
||||
"amd_iommu=on"
|
||||
"amdgpu.ppfeaturemask=0xffffffff"
|
||||
#"amdgpu.runpm=0"
|
||||
"iommu=pt"
|
||||
"psi=1"
|
||||
"i915.force_probe=!56a6"
|
||||
"xe.force_probe=56a6"
|
||||
]
|
||||
++ video;
|
||||
|
||||
boot.supportedFilesystems = [
|
||||
"ntfs"
|
||||
"btrfs"
|
||||
"vfat"
|
||||
"exfat"
|
||||
"ext4"
|
||||
];
|
||||
boot.tmp.useTmpfs = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
gfxmodeEfi = pkgs.lib.mkDefault "1920x1080@240";
|
||||
gfxmodeBios = pkgs.lib.mkDefault "1920x1080@240";
|
||||
useOSProber = true;
|
||||
memtest86.enable = true;
|
||||
};
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/materusPC_ROOT";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@"
|
||||
"noatime"
|
||||
"compress=zstd"
|
||||
"ssd"
|
||||
"space_cache=v2"
|
||||
];
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."ROOT_1".device = "/dev/disk/by-label/CRYPT_ROOT_1";
|
||||
boot.initrd.luks.devices."ROOT_2".device = "/dev/disk/by-label/CRYPT_ROOT_2";
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-label/materusPC_ROOT";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@home"
|
||||
"noatime"
|
||||
"compress=zstd"
|
||||
"ssd"
|
||||
"space_cache=v2"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-label/materusPC_ROOT";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@nix"
|
||||
"noatime"
|
||||
"compress=zstd"
|
||||
"ssd"
|
||||
"space_cache=v2"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = {
|
||||
device = "/dev/disk/by-label/materusPC_ROOT";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=@log"
|
||||
"noatime"
|
||||
"compress=zstd"
|
||||
"ssd"
|
||||
"space_cache=v2"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/materusPC_BOOT";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot/efi" = {
|
||||
device = "/dev/disk/by-label/EFI";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/etc/nixos" = {
|
||||
device = "/mkk/config";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
depends = [ "/" ];
|
||||
};
|
||||
swapDevices = [
|
||||
{ label = "materusPC_SWAP"; }
|
||||
];
|
||||
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
memoryPercent = 50;
|
||||
};
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
Experimental = true;
|
||||
FastConnectable = true;
|
||||
};
|
||||
Policy = {
|
||||
AutoEnable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user