From 9b34a80034b7df7190342a07c5ae10e8616b3ebf Mon Sep 17 00:00:00 2001 From: BuyMyMojo Date: Tue, 25 Mar 2025 04:04:03 +1100 Subject: [PATCH 1/4] Add nh --- nixos/configuration.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 8761d1c..b502e69 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -186,7 +186,10 @@ openrazer-daemon + # === nix related === comma + nh + # === nix related === rustc cargo From 9533f584bb332cc1b5a225c0ddc8fadff81feb8d Mon Sep 17 00:00:00 2001 From: BuyMyMojo Date: Tue, 25 Mar 2025 04:07:32 +1100 Subject: [PATCH 2/4] Set FLAKE var --- nixos/configuration.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index b502e69..c5eba3e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -338,11 +338,15 @@ ''; }; - # === Prefer RADV driver === environment.variables = { + # === Prefer RADV driver === AMD_VULKAN_ICD = "RADV"; }; + environment.sessionVariables = { + FLAKE = "/etc/nixos"; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave From bd5a8ad9176815ea88437f662f4bebd01c0c726b Mon Sep 17 00:00:00 2001 From: BuyMyMojo Date: Tue, 25 Mar 2025 04:10:36 +1100 Subject: [PATCH 3/4] Set FLAKE var properly & move AMD_VULKAN_ICD to session vars --- nixos/configuration.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c5eba3e..7844193 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -338,13 +338,13 @@ ''; }; - environment.variables = { - # === Prefer RADV driver === - AMD_VULKAN_ICD = "RADV"; - }; + # environment.variables = { + # }; environment.sessionVariables = { - FLAKE = "/etc/nixos"; + # === Prefer RADV driver === + AMD_VULKAN_ICD = "RADV"; + FLAKE = "/home/buymymojo/etc/nixos/"; }; # This value determines the NixOS release from which the default From 5582cd6ad92aafa9b63f4ddaec004d4a7b438fe2 Mon Sep 17 00:00:00 2001 From: BuyMyMojo Date: Tue, 25 Mar 2025 04:53:08 +1100 Subject: [PATCH 4/4] Add CPU micro code updater --- nixos/configuration.nix | 91 ++++++++++++++++++++++++----------------- nixos/flake.lock | 36 ++++++++++++++++ nixos/flake.nix | 5 +++ 3 files changed, 94 insertions(+), 38 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 7844193..407cd7e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -2,7 +2,13 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, unstable, ... }: +{ + config, + pkgs, + unstable, + inputs, + ... +}: # let # berkeley-mono-typeface = pkgs.callPackage ./packages/berkeley-mono-typeface.nix; @@ -17,8 +23,14 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + inputs.ucodenix.nixosModules.default ]; + services.ucodenix = { + enable = true; + cpuModelId = "00A20F12"; # AMD 5900X + }; + # Use the latest linux Kernel boot.kernelPackages = pkgs.linuxPackages_latest; @@ -163,51 +175,54 @@ # List packages installed in system profile. To search, run: # $ nix search wget - environment.systemPackages = with pkgs; with unstable; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - fzf - nixfmt-rfc-style - dwarfs + environment.systemPackages = + with pkgs; + with unstable; + [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + fzf + nixfmt-rfc-style + dwarfs - wineWowPackages.stable - winetricks - steamtinkerlaunch + wineWowPackages.stable + winetricks + steamtinkerlaunch - amdgpu_top - mangohud + amdgpu_top + mangohud - unstable.svt-av1-psy - unstable.ffmpeg-full - unstable.ab-av1 - unstable.whisper-cpp-vulkan + unstable.svt-av1-psy + unstable.ffmpeg-full + unstable.ab-av1 + unstable.whisper-cpp-vulkan - vscode.fhs # .fhs version will be more compatable even if slightly less nix flavoured + vscode.fhs # .fhs version will be more compatable even if slightly less nix flavoured - openrazer-daemon + openrazer-daemon - # === nix related === - comma - nh - # === nix related === + # === nix related === + comma + nh + # === nix related === - rustc - cargo - go - pnpm - zig - maven - gradle - gcc + rustc + cargo + go + pnpm + zig + maven + gradle + gcc - # noisetorch - # yad - # unzip - # wget - # xdotool - # xxd - # xorg.xwininfo - ]; + # noisetorch + # yad + # unzip + # wget + # xdotool + # xxd + # xorg.xwininfo + ]; programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [ diff --git a/nixos/flake.lock b/nixos/flake.lock index e099e34..f40c46d 100644 --- a/nixos/flake.lock +++ b/nixos/flake.lock @@ -1,5 +1,22 @@ { "nodes": { + "cpu-microcodes": { + "flake": false, + "locked": { + "lastModified": 1742753109, + "narHash": "sha256-hneAwNElAMkaTdToS6DUa47gFkXoIIR77CesMKUW21A=", + "owner": "platomav", + "repo": "CPUMicrocodes", + "rev": "f093bec842057ebf35d0525fcd69f649714f4485", + "type": "github" + }, + "original": { + "owner": "platomav", + "repo": "CPUMicrocodes", + "rev": "f093bec842057ebf35d0525fcd69f649714f4485", + "type": "github" + } + }, "home-manger": { "inputs": { "nixpkgs": [ @@ -40,9 +57,28 @@ "inputs": { "home-manger": "home-manger", "nixpkgs": "nixpkgs", + "ucodenix": "ucodenix", "unstable": "unstable" } }, + "ucodenix": { + "inputs": { + "cpu-microcodes": "cpu-microcodes" + }, + "locked": { + "lastModified": 1742827057, + "narHash": "sha256-eRUBUdKGKHxCTPkF6zoQsIKPdu58AkiPU0bxX8nuRoQ=", + "owner": "e-tho", + "repo": "ucodenix", + "rev": "1e8747f89ed13826cd7698be5a559bdbc50258fe", + "type": "github" + }, + "original": { + "owner": "e-tho", + "repo": "ucodenix", + "type": "github" + } + }, "unstable": { "locked": { "lastModified": 1742669843, diff --git a/nixos/flake.nix b/nixos/flake.nix index 7001169..82b32df 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -7,6 +7,9 @@ home-manger.url = "github:nix-community/home-manager"; home-manger.inputs.nixpkgs.follows = "nixpkgs"; + + # CPU microcode updater + ucodenix.url = "github:e-tho/ucodenix"; }; outputs = @@ -19,6 +22,7 @@ nixosConfigurations.nixos = nixpkgs.lib.nixosSystem { specialArgs = { + inherit inputs; pkgs = import nixpkgs { inherit system; config.allowUnfree = true; @@ -31,6 +35,7 @@ modules = [ ./configuration.nix ]; + }; };