From e7486cb2c43cf7d7dea9217099aca793ffe4ef36 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 10 May 2026 01:11:42 -0700 Subject: [PATCH] Fix NixOS switch with local HyprNStack --- nixos/justfile | 3 +++ nixos/nvidia.nix | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/nixos/justfile b/nixos/justfile index b6c15acb..e8f5bf0f 100644 --- a/nixos/justfile +++ b/nixos/justfile @@ -8,6 +8,7 @@ switch *args: env PATH=/run/wrappers/bin:$PATH sudo nixos-rebuild switch --flake ".#" --impure --option warn-dirty false \ --override-input imalison-taffybar path:/home/imalison/dotfiles/dotfiles/config/taffybar \ --override-input taffybar path:/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar \ + --override-input hyprNStack path:/home/imalison/Projects/hyprNStack \ {{args}} switch-remote *args: @@ -25,6 +26,7 @@ switch-local *args: env PATH=/run/wrappers/bin:$PATH sudo nixos-rebuild switch --flake ".#" --impure --option warn-dirty false \ --override-input imalison-taffybar path:/home/imalison/dotfiles/dotfiles/config/taffybar \ --override-input taffybar path:/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar \ + --override-input hyprNStack path:/home/imalison/Projects/hyprNStack \ {{args}} switch-local-taffybar *args: @@ -40,6 +42,7 @@ switch-local-taffybar *args: nixos-rebuild switch --flake "git+https://github.com/colonelpanic8/dotfiles.git?ref=master&dir=nixos#" --impure --option warn-dirty false \ --override-input imalison-taffybar path:/home/imalison/dotfiles/dotfiles/config/taffybar \ --override-input taffybar path:/home/imalison/dotfiles/dotfiles/config/taffybar/taffybar \ + --override-input hyprNStack path:/home/imalison/Projects/hyprNStack \ {{args}} remote-switch host *args: diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix index 2c3cf220..73580cd3 100644 --- a/nixos/nvidia.nix +++ b/nixos/nvidia.nix @@ -23,6 +23,13 @@ makeEnable config "myModules.nvidia" false { hardware.graphics.enable32Bit = true; hardware.graphics.extraPackages = [config.hardware.nvidia.package.out]; hardware.graphics.extraPackages32 = [config.hardware.nvidia.package.lib32]; + systemd.services.nvidia-container-toolkit-cdi-generator.serviceConfig = { + # During `nixos-rebuild switch`, the NVIDIA userspace package can be newer + # than the already-loaded kernel module. In that transient state NVML exits + # with a driver/library mismatch, but the generator succeeds again after the + # reboot that loads the matching module. + SuccessExitStatus = ["1"]; + }; services.xserver = { videoDrivers = ["nvidia"]; };