From 4afb5bbf4a5bfb9d16777bbd3d3d68d532ebd087 Mon Sep 17 00:00:00 2001 From: YI Date: Sat, 21 Sep 2024 11:27:38 +0800 Subject: [PATCH] Nixos: update nvidia settings --- flake.lock | 202 ++++++++++++++++++++----------------------------- nix/common.nix | 10 +++ nix/home.nix | 1 - nix/prefs.nix | 8 +- 4 files changed, 98 insertions(+), 123 deletions(-) diff --git a/flake.lock b/flake.lock index 5aaecc5..3ab7091 100644 --- a/flake.lock +++ b/flake.lock @@ -17,11 +17,11 @@ "systems": "systems_7" }, "locked": { - "lastModified": 1722339003, - "narHash": "sha256-ZeS51uJI30ehNkcZ4uKqT4ZDARPyqrHADSKAwv5vVCU=", + "lastModified": 1723293904, + "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", "owner": "ryantm", "repo": "agenix", - "rev": "3f1dae074a12feb7327b4bf43cbac0d124488bb7", + "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", "type": "github" }, "original": { @@ -321,11 +321,11 @@ }, "dotfiles": { "locked": { - "lastModified": 1723293044, - "narHash": "sha256-3eJTQ8WkEEeB8OIIOat95MOL/85ApZO8lLeG3elUHog=", + "lastModified": 1724756255, + "narHash": "sha256-YphEgy62TaGRt4x/GNRQ7BS7n6ISG/8hlPOyIFvW9+A=", "owner": "contrun", "repo": "dotfiles", - "rev": "68ed898e14108ecd0faf7cfef591d904d48a48e6", + "rev": "b8a247989e6534f3c06f0b7a366fe6d2c0f06765", "type": "github" }, "original": { @@ -366,11 +366,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1723427190, - "narHash": "sha256-GHemfC5ZoenPENbXOUBgp6ilzUhVNR7tNDxeSTsaAkk=", + "lastModified": 1725959624, + "narHash": "sha256-Ap9Kt23p81zXbnp23R5wXg7i9AToz7sSSamHJbBmMRc=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "406b85d2b06b4cfab0f0f31b08758fac8e02a691", + "rev": "9c64b595f3ba6670c7ac89d57e6822c0fce7d46e", "type": "github" }, "original": { @@ -411,28 +411,6 @@ "type": "github" } }, - "fenix": { - "inputs": { - "nixpkgs": [ - "microvm", - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1722580276, - "narHash": "sha256-VaNcSh7n8OaFW/DJsR6Fm23V+EGpSei0DyF71RKB+90=", - "owner": "nix-community", - "repo": "fenix", - "rev": "286f371b3cfeaa5c856c8e6dfb893018e86cc947", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -554,11 +532,11 @@ ] }, "locked": { - "lastModified": 1723424779, - "narHash": "sha256-BEM/f/uPPcyG27o4VdxRz9mBn33/ijv4mUSkQ2/Bflo=", + "lastModified": 1725902172, + "narHash": "sha256-wvFuL/qmVQqaWNyELByFWCKiSPMbfA82QJiQxN8cs/M=", "owner": "colemickens", "repo": "flake-firefox-nightly", - "rev": "6fed9761b87006da2977b61a59a3785885a52cb6", + "rev": "0b043aabf820ebed345693ebd1f9a693ad68f1eb", "type": "github" }, "original": { @@ -853,11 +831,11 @@ ] }, "locked": { - "lastModified": 1722589758, - "narHash": "sha256-sbbA8b6Q2vB/t/r1znHawoXLysCyD4L/6n6/RykiSnA=", + "lastModified": 1725515722, + "narHash": "sha256-+gljgHaflZhQXtr3WjJrGn8NXv7MruVPAORSufuCFnw=", "owner": "tweag", "repo": "gomod2nix", - "rev": "4e08ca09253ef996bd4c03afa383b23e35fe28a1", + "rev": "1c6fd4e862bf2f249c9114ad625c64c6c29a8a08", "type": "github" }, "original": { @@ -898,11 +876,11 @@ ] }, "locked": { - "lastModified": 1720042825, - "narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", + "lastModified": 1725703823, + "narHash": "sha256-tDgM4d8mLK0Hd6YMB2w1BqMto1XBXADOzPEaLl10VI4=", "owner": "nix-community", "repo": "home-manager", - "rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", + "rev": "208df2e558b73b6a1f0faec98493cb59a25f62ba", "type": "github" }, "original": { @@ -960,11 +938,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1722943159, - "narHash": "sha256-emFl0ASIBI9hXrthDhg5BJ0eKUU5Y07+ObJVs/U1FBY=", + "lastModified": 1725540928, + "narHash": "sha256-DsnVmhZn6FLpjF0Q7bJgrzdwhtmAuNx//zYuEIb49kQ=", "owner": "jtojnar", "repo": "nixfiles", - "rev": "3746f9218215c0db72559aae715891f0f1c7001c", + "rev": "7100e0768a22907db2d392d032319572e39aef08", "type": "github" }, "original": { @@ -979,11 +957,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1723378259, - "narHash": "sha256-8JZVHJAoDgbAk9nn7blBB+wnQbgCq1lIxBsyT7qgeI8=", + "lastModified": 1725797487, + "narHash": "sha256-1NqTS6PePeoLVH8UY6poIoxlNq1Hhgn7RZs+OT8b2wQ=", "owner": "nix-community", "repo": "lib-aggregate", - "rev": "8834c9b308bf4d9d448dd73be5f9782f4635d4ca", + "rev": "3c180ce6583583285ef1b105cbc1667ba00c3e8d", "type": "github" }, "original": { @@ -998,11 +976,11 @@ "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1723378259, - "narHash": "sha256-8JZVHJAoDgbAk9nn7blBB+wnQbgCq1lIxBsyT7qgeI8=", + "lastModified": 1725797487, + "narHash": "sha256-1NqTS6PePeoLVH8UY6poIoxlNq1Hhgn7RZs+OT8b2wQ=", "owner": "nix-community", "repo": "lib-aggregate", - "rev": "8834c9b308bf4d9d448dd73be5f9782f4635d4ca", + "rev": "3c180ce6583583285ef1b105cbc1667ba00c3e8d", "type": "github" }, "original": { @@ -1061,7 +1039,6 @@ }, "microvm": { "inputs": { - "fenix": "fenix", "flake-utils": [ "flake-utils" ], @@ -1071,11 +1048,11 @@ "spectrum": "spectrum" }, "locked": { - "lastModified": 1723407630, - "narHash": "sha256-iBvdy5KAYWew4sAIVbrqrNL7jCMWFoB5hObocCXkHiY=", + "lastModified": 1725664757, + "narHash": "sha256-kUMgeF3hHJM8aBpdazNgtCeeOTrWext6lHfrYmC6otU=", "owner": "astro", "repo": "microvm.nix", - "rev": "802ef1704f6a050f272bed5e226d0e86fa3e8c39", + "rev": "caac7808d1e31f8a0fa408338cd3736947cb226d", "type": "github" }, "original": { @@ -1113,11 +1090,11 @@ ] }, "locked": { - "lastModified": 1722576181, - "narHash": "sha256-0YYH6dTJK+mzqH7KvXep5Zv/qjHCGv+hM1eLMd0aBM4=", + "lastModified": 1725216861, + "narHash": "sha256-GaCobLXfPYBuhxy2TdlEDAfS3PD4mrUj6NQIPOzQq48=", "owner": "thiagokokada", "repo": "nix-alien", - "rev": "5d41c9c1aac104c15d06808f0c35c23e26809875", + "rev": "f92c20327b240ce2098d227c3674d7c02beea51b", "type": "github" }, "original": { @@ -1241,11 +1218,11 @@ ] }, "locked": { - "lastModified": 1720926593, - "narHash": "sha256-fW6e27L6qY6s+TxInwrS2EXZZfhMAlaNqT0sWS49qMA=", + "lastModified": 1723352546, + "narHash": "sha256-WTIrvp0yV8ODd6lxAq4F7EbrPQv0gscBnyfn559c3k8=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "5fe5b0cdf1268112dc96319388819b46dc051ef4", + "rev": "ec78079a904d7d55e81a0468d764d0fffb50ac06", "type": "github" }, "original": { @@ -1268,11 +1245,11 @@ "nmd": "nmd" }, "locked": { - "lastModified": 1721670745, - "narHash": "sha256-rjTQ14dqQ90EaHQy4g/mGylrJ1aZJYc3wCXc4A3GHJg=", + "lastModified": 1725658585, + "narHash": "sha256-P29z4Gt89n5ps1U7+qmIrj0BuRXGZQSIaOe2+tsPgfw=", "owner": "t184256", "repo": "nix-on-droid", - "rev": "248cc0806120fac9214f503dee0eaf0f47740dd0", + "rev": "5d88ff2519e4952f8d22472b52c531bb5f1635fc", "type": "github" }, "original": { @@ -1283,11 +1260,11 @@ }, "nixlib": { "locked": { - "lastModified": 1722732880, - "narHash": "sha256-do2Mfm3T6SR7a5A804RhjQ+JTsF5hk4JTPGjCTRM/m8=", + "lastModified": 1725757153, + "narHash": "sha256-c1a6iLmCVPFI9EUVMrBN8xdmFxFXEjcVwiTSVmqajOs=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "8bebd4c74f368aacb047f0141db09ec6b339733c", + "rev": "68584f89dd0eb16fea5d80ae127f3f681f6a5df7", "type": "github" }, "original": { @@ -1304,11 +1281,11 @@ ] }, "locked": { - "lastModified": 1723078345, - "narHash": "sha256-HSxOQEKNZXiJe9aWnckTTCThOhcRCabwHa32IduDKLk=", + "lastModified": 1725843519, + "narHash": "sha256-Z6DglUwgFDz6fIvQ89wx/uBVWrGvEGECq0Ypyk/eigE=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "d6c5d29f58acc10ea82afff1de2b28f038f572bd", + "rev": "214efbd73241d72a8f48b8b9a73bb54895cd51a7", "type": "github" }, "original": { @@ -1335,11 +1312,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723175592, - "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", "type": "github" }, "original": { @@ -1383,11 +1360,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1723337705, - "narHash": "sha256-znSU0DeNDPt7+LMAfFkvKloMaeQ6yl/U5SqV/ktl1vA=", + "lastModified": 1725757153, + "narHash": "sha256-c1a6iLmCVPFI9EUVMrBN8xdmFxFXEjcVwiTSVmqajOs=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "ace7856d327b618d3777e31b1f224b3ab57ed71a", + "rev": "68584f89dd0eb16fea5d80ae127f3f681f6a5df7", "type": "github" }, "original": { @@ -1398,11 +1375,11 @@ }, "nixpkgs-lib_2": { "locked": { - "lastModified": 1723337705, - "narHash": "sha256-znSU0DeNDPt7+LMAfFkvKloMaeQ6yl/U5SqV/ktl1vA=", + "lastModified": 1725757153, + "narHash": "sha256-c1a6iLmCVPFI9EUVMrBN8xdmFxFXEjcVwiTSVmqajOs=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "ace7856d327b618d3777e31b1f224b3ab57ed71a", + "rev": "68584f89dd0eb16fea5d80ae127f3f681f6a5df7", "type": "github" }, "original": { @@ -1429,11 +1406,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1723282977, - "narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=", + "lastModified": 1725826545, + "narHash": "sha256-L64N1rpLlXdc94H+F6scnrbuEu+utC03cDDVvvJGOME=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc", + "rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9", "type": "github" }, "original": { @@ -1445,11 +1422,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1723282977, - "narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=", + "lastModified": 1725826545, + "narHash": "sha256-L64N1rpLlXdc94H+F6scnrbuEu+utC03cDDVvvJGOME=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc", + "rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9", "type": "github" }, "original": { @@ -1493,11 +1470,11 @@ }, "nixpkgs-stable_5": { "locked": { - "lastModified": 1721524707, - "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", + "lastModified": 1725762081, + "narHash": "sha256-vNv+aJUW5/YurRy1ocfvs4q/48yVESwlC/yHzjkZSP8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "556533a23879fc7e5f98dd2e0b31a6911a213171", + "rev": "dc454045f5b5d814e5862a6d057e7bb5c29edc05", "type": "github" }, "original": { @@ -1509,11 +1486,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1723175592, - "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", "type": "github" }, "original": { @@ -1533,11 +1510,11 @@ ] }, "locked": { - "lastModified": 1723400678, - "narHash": "sha256-7sbF4AIremKHQm5KvXEatmW+xUSwejXWR5Y1mMnY1e0=", + "lastModified": 1725953752, + "narHash": "sha256-g0elLnAvsNBa7hixMHfY6L1SbghdcAtLu0VEYit5iEM=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "9f566ee2fcb6bebac1c59e8c813c9bbd161f5f2a", + "rev": "4a8ae9db6e6c36521e3d1646461460a0777aed11", "type": "github" }, "original": { @@ -1548,11 +1525,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1722813957, - "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", + "lastModified": 1725432240, + "narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", + "rev": "ad416d066ca1222956472ab7d0555a6946746a80", "type": "github" }, "original": { @@ -1564,11 +1541,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1723282977, - "narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=", + "lastModified": 1725826545, + "narHash": "sha256-L64N1rpLlXdc94H+F6scnrbuEu+utC03cDDVvvJGOME=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc", + "rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9", "type": "github" }, "original": { @@ -1714,11 +1691,11 @@ }, "nur-no-pkgs": { "locked": { - "lastModified": 1723435450, - "narHash": "sha256-2LN4YI0wWDvYZj7hzYxY7NTiyXXcI37kh5G0LJZSj7c=", + "lastModified": 1725963513, + "narHash": "sha256-bSQ1g629DPfEL1xAkw5QwKcZRBpSdxBd4165x0Qoxuo=", "owner": "nix-community", "repo": "NUR", - "rev": "6292b376c645574019c76a48a738f34633ca6168", + "rev": "1ad74cbeecbe5429c422a97929335aa174c0c9d7", "type": "github" }, "original": { @@ -1844,23 +1821,6 @@ "wallabag-client": "wallabag-client" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1722521768, - "narHash": "sha256-FvJ4FaMy1kJbZ3Iw1RyvuiUAsbHJXoU2HwylzaFzj1o=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "f149dc5029d8406fae8b2c541603bcac06e30deb", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "safe-coloured-text": { "flake": false, "locked": { @@ -1998,11 +1958,11 @@ "nixpkgs-stable": "nixpkgs-stable_5" }, "locked": { - "lastModified": 1722897572, - "narHash": "sha256-3m/iyyjCdRBF8xyehf59QlckIcmShyTesymSb+N4Ap4=", + "lastModified": 1725922448, + "narHash": "sha256-ruvh8tlEflRPifs5tlpa0gkttzq4UtgXkJQS7FusgFE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "8ae477955dfd9cbf5fa4eb82a8db8ddbb94e79d9", + "rev": "cede1a08039178ac12957733e97ab1006c6b6892", "type": "github" }, "original": { diff --git a/nix/common.nix b/nix/common.nix index d113322..193a7e8 100644 --- a/nix/common.nix +++ b/nix/common.nix @@ -888,6 +888,16 @@ in modesetting.enable = prefs.enableNvidiaModesetting; powerManagement.enable = prefs.enableNvidiaPowerManagement; powerManagement.finegrained = prefs.enableNvidiaPowerManagementFinegrained; + # Nvidia driver broken in latest kernel + # https://discourse.nixos.org/t/unable-to-build-nix-due-to-nvidia-drivers-due-or-kernel-6-10/49266/18 + package = config.boot.kernelPackages.nvidiaPackages.mkDriver { + version = "555.58.02"; + sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM="; + sha256_aarch64 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY="; + openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY="; + settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8="; + persistencedSha256 = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM="; + }; } // (lib.optionalAttrs prefs.enableNvidiaPrimeConfig { prime = prefs.nvidiaPrimeConfig; }); diff --git a/nix/home.nix b/nix/home.nix index b5448f7..f25f26c 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -541,7 +541,6 @@ let "uget" "udptunnel" "wireguard-tools" - "gomuks" "irssi" # "chromium" # "ungoogled-chromium" diff --git a/nix/prefs.nix b/nix/prefs.nix index 1ab670b..dd296d5 100644 --- a/nix/prefs.nix +++ b/nix/prefs.nix @@ -745,7 +745,7 @@ let nixosRebuildFlags = [ ]; onCalendar = "04:30"; }; - extraOutputsToInstall = [ "dev" "lib" "doc" "info" "devdoc" "out" "man" ]; + extraOutputsToInstall = [ "dev" "lib" "doc" "info" "out" "man" ]; }; hostSpecific = self: super: @@ -1055,6 +1055,12 @@ let enableAllOciContainers = false; enableWireguard = false; enableContainerWired = false; + pkgsRelatedPrefs = super.pkgsRelatedPrefs // { + # https://discourse.nixos.org/t/unable-to-build-nix-due-to-nvidia-drivers-due-or-kernel-6-10/49266 + # nvidia driver is frequently broken, use a slightly older kernel version + # kernelPackages = pkgs.linuxPackages_xanmod_latest; + # kernelPackages = pkgs.linuxPackages_zen; + }; videoDrivers = [ "nvidia" "modesetting" ]; enableNvidiaPrimeConfig = true; enableNvidiaModesetting = true;