Added NixOS configs
This commit is contained in:
		
							
								
								
									
										30
									
								
								Hardware/boot.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								Hardware/boot.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
{ config, lib, pkgs, modulesPath, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
 | 
			
		||||
 | 
			
		||||
  boot = {
 | 
			
		||||
    initrd={
 | 
			
		||||
      availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
 | 
			
		||||
      kernelModules = [ ];
 | 
			
		||||
    };
 | 
			
		||||
    kernelModules = [ "kvm-intel" ];
 | 
			
		||||
    extraModulePackages = [ ];
 | 
			
		||||
    loader = {
 | 
			
		||||
      efi = {
 | 
			
		||||
        canTouchEfiVariables = true;
 | 
			
		||||
        efiSysMountPoint = "/boot/efi";
 | 
			
		||||
      };
 | 
			
		||||
      grub = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        useOSProber = true;
 | 
			
		||||
        efiSupport =  true;
 | 
			
		||||
        device = "nodev";
 | 
			
		||||
        splashImage = "/etc/cirno.png"; #hehe
 | 
			
		||||
        splashMode = "stretch";
 | 
			
		||||
        configurationName = "nixbruh";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    kernelParams = [ "nvidia-drm.modeset=1" "intel_pstate=active"]; 
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										30
									
								
								Hardware/graphicshit.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								Hardware/graphicshit.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
{lib, config, pkgs, ... }:
 | 
			
		||||
let
 | 
			
		||||
  nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
 | 
			
		||||
    export __NV_PRIME_RENDER_OFFLOAD=1
 | 
			
		||||
    export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
 | 
			
		||||
    export __GLX_VENDOR_LIBRARY_NAME=nvidia
 | 
			
		||||
    export __VK_LAYER_NV_optimus=NVIDIA_only
 | 
			
		||||
    exec -a "$0" "$@"
 | 
			
		||||
  '';
 | 
			
		||||
in
 | 
			
		||||
  {
 | 
			
		||||
    environment.systemPackages = with pkgs; [
 | 
			
		||||
      nvidia-offload
 | 
			
		||||
    ];
 | 
			
		||||
    hardware = {
 | 
			
		||||
      opengl = {
 | 
			
		||||
        driSupport32Bit = true;
 | 
			
		||||
        #package = pkgs.mesa_drivers;
 | 
			
		||||
        enable = true;
 | 
			
		||||
      };
 | 
			
		||||
      nvidia = {
 | 
			
		||||
        prime = {
 | 
			
		||||
          offload = { enable = true; };
 | 
			
		||||
          intelBusId = "PCI:0:2:0";
 | 
			
		||||
          nvidiaBusId = "PCI:1:0:0";
 | 
			
		||||
        };
 | 
			
		||||
        modesetting = { enable = true; };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
							
								
								
									
										7
									
								
								Hardware/power.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Hardware/power.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
{ config, lib, pkgs, modulesPath, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  powerManagement = {
 | 
			
		||||
    cpuFreqGovernor = lib.mkDefault "powersave";
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										26
									
								
								Hardware/xorg.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Hardware/xorg.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
 | 
			
		||||
{ config, lib, pkgs, modulesPath, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  services = {
 | 
			
		||||
    xserver = {
 | 
			
		||||
      enable = true;
 | 
			
		||||
      libinput= {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        mouse = {
 | 
			
		||||
          accelSpeed = "0";
 | 
			
		||||
        };
 | 
			
		||||
        touchpad = {
 | 
			
		||||
          middleEmulation = false;
 | 
			
		||||
          clickMethod = "buttonareas";
 | 
			
		||||
          tapping = true;
 | 
			
		||||
          naturalScrolling =true;
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      displayManager = {startx = {enable = true; }; };
 | 
			
		||||
      videoDrivers = [ "nvidia" ];
 | 
			
		||||
      layout = "us";
 | 
			
		||||
      xkbVariant = "colemak";
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user