From 3a39d3f991deeb52fb0448a69b4141823b8dcca0 Mon Sep 17 00:00:00 2001 From: Nettika Date: Fri, 12 Jul 2024 13:26:37 -0700 Subject: [PATCH] Manually configure hardware Remove nixos-hardware from inputs --- flake.lock | 17 ------------ flake.nix | 5 ++-- marauder/default.nix | 61 ++++++++++++++++++++++++++++++++++---------- 3 files changed, 50 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index 98d88d5..3e44bbf 100644 --- a/flake.lock +++ b/flake.lock @@ -1,21 +1,5 @@ { "nodes": { - "nixos-hardware": { - "locked": { - "lastModified": 1720737798, - "narHash": "sha256-G/OtEAts7ZUvW5lrGMXSb8HqRp2Jr9I7reBuvCOL54w=", - "owner": "nixos", - "repo": "nixos-hardware", - "rev": "c5013aa7ce2c7ec90acee5d965d950c8348db751", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "master", - "repo": "nixos-hardware", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1720386169, @@ -34,7 +18,6 @@ }, "root": { "inputs": { - "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 44f32af..2c91da7 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,11 @@ { - description = "Nettika NixOS Configurations"; + description = "Nettika's NixOS Configurations"; inputs = { - nixos-hardware.url = "github:nixos/nixos-hardware/master"; nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; }; - outputs = { nixpkgs, nixos-hardware, ... }@inputs: { + outputs = { nixpkgs, ... }@inputs: { nixosConfigurations = { marauder = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; diff --git a/marauder/default.nix b/marauder/default.nix index 90df12a..74c466c 100644 --- a/marauder/default.nix +++ b/marauder/default.nix @@ -1,14 +1,8 @@ { pkgs, inputs, ... }: { - imports = [ - ./backup.nix - inputs.nixos-hardware.nixosModules.asus-rog-strix-g513im - ]; + imports = [ ./backup.nix ]; - networking = { - hostName = "marauder"; - networkmanager.enable = true; - }; + networking.hostName = "marauder"; fileSystems = { "/" = { @@ -27,10 +21,39 @@ systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; - initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" ]; - kernelModules = [ "kvm-amd" ]; + initrd = { + systemd.enable = true; + availableKernelModules = [ + "nvme" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + }; + kernelModules = ["kvm-amd"]; + kernelParams = [ "amd_pstate=active" ]; }; + hardware = { + enableRedistributableFirmware = true; + cpu.amd.updateMicrocode = true; + opengl = { + enable = true; + driSupport32Bit = true; + extraPackages = [pkgs.vaapiVdpau]; + }; + nvidia.prime = { + offload = { + enable = true; + enableOffloadCmd = true; + }; + amdgpuBusId = "PCI:05:00:0"; + nvidiaBusId = "PCI:01:00:0"; + }; + }; + + users.users = { nettika = { isNormalUser = true; @@ -93,13 +116,25 @@ dedicatedServer.openFirewall = true; }; - services.xserver = { + services.xserver = { enable = true; - desktopManager = { + videoDrivers = ["nvidia"]; + desktopManager = { cinnamon.enable = true; xterm.enable = false; }; - displayManager.defaultSession = "cinnamon"; + }; + + services.displayManager = { + defaultSession = "cinnamon"; + }; + + services.tlp = { + enable = true; + }; + + services.fstrim = { + enable = true; }; time.timeZone = "America/Los_Angeles";