Fast boot is different from that Windows feature, the windows feature involves some voodoo with EFI variables and power states. It’s a Windows setting and has nothing to do with BIOS settings.
The only obvious problem I see is that you’re not booting the generation you think you are. My suspicion is that the configuration that’s actually running is not what you have in your flake, whether that is because of Windows boot shenanigans or because you’re not running the correct command remains to be seen.
If you use nixos-rebuild build --flake .# in your flake’s root directory, and then inspect the result symlink, are the nvidia modules in result/kernel-modules/lib/modules/6.12.49/kernel/drivers?
No, this just is a pretty conclusive indicator that the configuration is in fact correct, but you’re not booting what you think you are. I would guess that this is a version where you had boot.initrd.kernelModules = [ "nvidia" ] set, but didn’t actually have the nvidia driver installed. That would explain why the kernel fails to load the module, it’s simply not installed, and for some reason you have not actually updated your generation since.
This is why I recommend never manually setting boot.initrd.kernelModules & co, by the way - this should almost always be done by the modules you enable instead.
Please do the following:
Switch to systemd-boot for my sanity
Check the contents of /boot/loader/loader.conf, noting down the generation that is set in default
In the same directory as the nixos-rebuild build, run:
nixos-rebuild boot --flake .# --use-remote-sudo
Check the contents of /boot/loader/loader.conf again
Reboot
After this sequence, does the nvidia driver load correctly, and what does this command give you:
turns out that i just didn’t make any changes to config so it didn’t generate new version (nvidia-simple.nix was uncommented), everything is alright now, i’ll reboot then text you as soon as possible
Yep, this is pretty crazy. Your configuration is producing the output I’d expect and certainly correct, but when booted into it it seems to have different contents than it does at build time. This seems pretty much impossible.
I’ve never seen anything like it before. Maybe this is some severe bug. I only have one remaining guess; if you reboot and press space, does grub or systemd-boot’s boot menu come up? It shouldn’t matter, since you are booted into the correct generation, but maybe you’re booting the wrong kernel while activating another system on top of it?
Can you also explicitly select the correct generation (70) there, just to be sure?
If that all still looks fine, I’m kind of out of ideas. The only remaining thing at that point would be to start with a fresh configuration.nix and configure only what you need to boot + nvidia, just to confirm I’m not overlooking any options you’re setting. Basically just the boot loader, nvidia and system.stateVersion, plus what’s in hardware-configuration.nix.
started with fresh config generated by nixos-generate-config (or something like that, i forgor) + nvidia
guess what? it finally works! the only thing left is to figure out what could be causing problems
Yeah, that’s even weirder. The only line that could have any such effect IMO is this one, but that should just be you tautologically re-defining defaults again.
That said, the path from here is simple: just add configuration back block-by-block until it breaks.
i figured out what could cause those problems - nvidia-x11 (or nvidia-settings). when i added nixpkgs.allowUnfreePackages = true, everything broke again. i think i’ll need this option, but i don’t want to break my system by those 2 packages, don’t really know how to do it
or maybe delete just those two things, just removing unfree packages line doesn’t help
just used the default config generated by nixos-generate-config, added my user and nvidia drivers. only after adding allowUnfreePackages issue showed up again
allowUnfreePackages is definitely unrelated to the behavior of nvidia. It only has evaluation-time effects, and doesn’t affect runtime behavior at all.
If you set services.xserver.videoDrivers = [ "nvidia" ], you should be getting an error from nixos-rebuild that tells you that the nvidia-x11 package is unfree and cannot be installed without allowing unfree packages. Are you just ignoring this error?
If I simplify your configuration to the bare minimum on my end, and leave out allowUnfreePackages:
~/Downloads/aria/nixos> nixos-rebuild build --flake .#nixos
building the system configuration...
error:
… while calling the 'head' builtin
at /nix/store/lvwgkdy9nrki8qcrdsqnpfrk7562m1dc-source/lib/attrsets.nix:1701:13:
1700| if length values == 1 || pred here (elemAt values 1) (head values) then
1701| head values
| ^
1702| else
… while evaluating the attribute 'value'
at /nix/store/lvwgkdy9nrki8qcrdsqnpfrk7562m1dc-source/lib/modules.nix:1118:7:
1117| // {
1118| value = addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
1119| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: Package ‘nvidia-x11-580.82.09-6.12.47’ in /nix/store/lvwgkdy9nrki8qcrdsqnpfrk7562m1dc-source/pkgs/os-specific/linux/nvidia-x11/generic.nix:329 has an unfree license (‘unfreeRedistributable’), refusing to evaluate.
a) To temporarily allow unfree packages, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_UNFREE=1
Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
then pass `--impure` in order to allow use of environment variables.
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.
Alternatively you can configure a predicate to allow specific packages:
{ nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"nvidia-x11"
];
}
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.
i understand it, i meant that nvidia-x11 breaks everything, but since you said that it’s indivisible part of drivers, i guess that’s still nvidia’s fault
yep, i guess i just booted up to config with nvidia drivers disabled while thinking they were declared in built config. sorry, my bad
i might try to completely uninstall windows and then reinstall nixos (this time doing it via tui, not calamares). i don’t know would it actually solve the problem, but i guess it could be better than just blindly trying everything, especially when even you are out of ideas.
after that, i’ll try to install windows alongside with nixos again and see what will happen. if everything works when installing windows again, then it’ll be calamares’s fault, otherwise - windows’s. (either way both microsoft and nvidia should be obliterated from this world). i’ll let you know when i finish, i don’t think it’ll be done quickly though