Skip to content

Commit 7271bb5

Browse files
committedMar 4, 2025
bootloader, nvidia: simplify by using 6.12
Got a crash that led to my initrd apparently disappearing. After a trip through the woes of nixos-enter, we're back! In light of this, let's *not* pull in the new nvidia drivers. We'll stick to 6.12, since I can't get the drivers from unstable without re-evaluating nixpkgs to allow unfree. Anyways, if me or someone else needs it, here's the commands I used to get nixos-enter working. The wiki was very little help (surprise), but this guide was super useful: https://www.adyxax.org/blog/2023/11/13/recovering-a-nixos-installation-from-a-linux-rescue-image/ ```bash sudo mount /dev/nvmeblahblah2 /mnt cd /mnt sudo mount /dev/nvme0n1p6 boot // Maybe required, idk sudo mount -o bind /dev /mnt/dev sudo mount -o bind /proc /mnt/proc sudo mount -o bind /sys /mnt/sys // Probably not required sudo chroot /mnt /nix/var/nix/profiles/system/activate # Wiki doesn't include the /system part sudo nixos-enter nix shell nixpkgs#git # Required for using flakes with nixos-rebuild nixos-rebuild boot --flake /home/username/location/of/flake#hostname --option sandbox false # Might not need the sandbox ```
1 parent 3fd6937 commit 7271bb5

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed
 

‎config/core/bootloader.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
blacklistedKernelModules = [ ];
88
extraModulePackages = with config.boot.kernelPackages; [ ];
99
initrd.kernelModules = [ ];
10-
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; # 6.13 breaking some stuff
10+
kernelPackages = lib.mkDefault pkgs.linuxPackages_6_12; # 6.13 breaking some stuff on stable, see https://github.com/NixOS/nixpkgs/issues/375730#issuecomment-2625157971
1111

1212
kernelParams = [ "boot.shell_on_fail" ]; # Open terminal environment if we fail to boot
1313
};

‎hosts/desktop/config/nvidia.nix

+3-22
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
1-
{ config, ... }:
1+
{ inputs, lib, config, ... }:
22
{
33

4-
hardware.nvidia =
5-
{
6-
modesetting.enable = true;
4+
imports = lib.singleton inputs.nixos-hardware.nixosModules.common-gpu-nvidia-nonprime;
75

8-
powerManagement.enable = false;
9-
10-
powerManagement.finegrained = false;
11-
12-
open = false;
13-
nvidiaSettings = true;
14-
15-
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
16-
version = "570.124.04";
17-
sha256_64bit = "sha256-G3hqS3Ei18QhbFiuQAdoik93jBlsFI2RkWOBXuENU8Q=";
18-
sha256_aarch64 = "sha256-KCGUyu/XtmgcBqJ8NLw/iXlaqB9/exg51KFx0Ta5ip0=";
19-
openSha256 = "sha256-KCGUyu/XtmgcBqJ8NLw/iXlaqB9/exg51KFx0Ta5ip0=";
20-
settingsSha256 = "sha256-LNL0J/sYHD8vagkV1w8tb52gMtzj/F0QmJTV1cMaso8=";
21-
persistencedSha256 = "sha256-xctt4TPRlOJ685S52h5W6PT6/3Zy2R4ASNFPu8TSHKM=";
22-
};
23-
};
24-
25-
services.xserver.videoDrivers = ["nvidia"]; # Use proprietary drivers
6+
hardware.nvidia.open = true;
267
}

0 commit comments

Comments
 (0)
Please sign in to comment.