From 636a7529c71041aa8b9e5dd6587b0d26fa53aa28 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 12 Nov 2024 15:35:52 -0800 Subject: [PATCH] feat: add ucodenix and auto update microcode --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 5 +++++ hosts/adrastea/configuration.nix | 5 +++++ hosts/adrastea/default.nix | 1 + 4 files changed, 32 insertions(+) diff --git a/flake.lock b/flake.lock index f024b33..3ae60ab 100755 --- a/flake.lock +++ b/flake.lock @@ -850,6 +850,7 @@ "nixpkgs": "nixpkgs_2", "spicetify": "spicetify", "stylix": "stylix", + "ucode": "ucode", "vesktop-bin": "vesktop-bin", "viminal": "viminal", "wallpapers": "wallpapers", @@ -1090,6 +1091,26 @@ "type": "github" } }, + "ucode": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731428847, + "narHash": "sha256-x+Q0I+R+aBZoJIEuBFDDJFjFu+todWsZJXrQkAuVh/o=", + "owner": "e-tho", + "repo": "ucodenix", + "rev": "404f4adc330b4a4047cecbc4457d4ae2abe69bed", + "type": "github" + }, + "original": { + "owner": "e-tho", + "repo": "ucodenix", + "type": "github" + } + }, "vesktop-bin": { "inputs": { "flake-utils": [ diff --git a/flake.nix b/flake.nix index 6d5de76..6aef2d5 100755 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,11 @@ inputs.flake-parts.follows = "flake-parts"; }; + ucode = { + url = "github:e-tho/ucodenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + lix-module = { url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.1-1.tar.gz"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/adrastea/configuration.nix b/hosts/adrastea/configuration.nix index 9da9ed5..f8d2df5 100755 --- a/hosts/adrastea/configuration.nix +++ b/hosts/adrastea/configuration.nix @@ -59,6 +59,11 @@ initrd.systemd.enable = true; }; + services.ucodenix = { + enable = true; + cpuModelId = "00A50F00"; + }; + # boot.lanzaboote = { # enable = false; # pkiBundle = "/etc/secureboot"; diff --git a/hosts/adrastea/default.nix b/hosts/adrastea/default.nix index a9ce515..461897f 100644 --- a/hosts/adrastea/default.nix +++ b/hosts/adrastea/default.nix @@ -46,5 +46,6 @@ ++ (with inputs; [ lix-module.nixosModules.default home-manager.nixosModules.home-manager + ucode.nixosModules.default ]); }