Closed kero0 closed 3 years ago
This is probably more related to NixOS rather than Nixpkgs, so I am not sure the discussion should be here.
However, would you mind sharing your entire configuration nix
? Since the problem is more likely that xserver is in conflict with some other package or service as I don't believe just having services.xserver.enable = true
in your configuration file would result in a build error.
Here's a minimum version of my config where adding that line causes the same error: configuration.nix and hardware-configuration.nix
I've removed everything else from my config so the error has to be happening somewhere here.
Interestingly after a few days of not working it just suddenly worked. I was commenting out one thing at a time to get it to build I commented out my nix.extraOptions
, it built successfully. Then I re-added it and it still successfully built so I'm not really sure what happened.
By default nix caches the derivations, so it might be that it still doesn't work, but since the derivation is built it's happy now.
You could test with something like nix-build -A font-cursor-misc --check
to force rebuilding (not 100% sure about the attribute name) with the different nix settings.
This is https://github.com/NixOS/nixpkgs/pull/133303 which was supposedly already fixed but is not yet in nixpkgs-unstable
and friends. Building just the xorg.fontcursormisc
derivation won't reproduce the issue since this happens by virtue of a NixOS module which will try to add default fonts (and something cursor related) when, among other things, xserver.enable = true
.
I think you're both right. I had done my search for similar errors quite a few hours before I posted so when I found that pull request I didn't see anybody mention the error and so I thought I was having a different issue, but it probably is the same one now that I see they are having the same error.
It also probably is only working because of some cached build, which it shouldn't be since that means that as things stand now, my config only builds based off some state, i.e. commenting out parts of the config and building part of it then building the other part later.
Should I close this since it's already been fixed in that pull request?
I'd leave it open until the fix landed on nixpkgs-unstable
, that way people who're affected can just look at this issue and don't have to open a new one.
This is still broken for me
The PR has gone through fully, so it might be that it's not solved.
Indeed
~/private/nixpkgs on nixpkgs-unstable •
$ git branch --contains 9e8fcb0184170a97b4d0a933783bd7c83aff2ab2
master
* nixpkgs-unstable
@rnhmjoj the fix you pushed doesn't seem to solve this issue for some (?) of us
What is the error you see?
I don't see any issue in any of the unstable channels (nixos-unstable, nixos-unstable-small, nixpkgs-unstable) with:
nix-build -I nixpkgs=https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz '<nixpkgs/nixos>' -A vm --arg configuration '{ hardware.video.hidpi.enable = true; services.xserver.enable = true; services.xserver.dpi = 284; }'
I was getting the same error as OP, but just now I updated my flake and now I'm getting
$ sudo nixos-rebuild switch --flake .
building the system configuration...
error: undefined variable 'nvidiaSettings'
at /nix/store/0lrz7njdb4dicrx2mwqjjf989far0imf-source/nixos/modules/hardware/video/nvidia.nix:292:20:
291| environment.systemPackages = [ nvidia_x11.bin ]
292| ++ optionals nvidiaSettings [ nvidia_x11.settings ]
| ^
293| ++ optionals nvidiaPersistencedEnabled [ nvidia_x11.persistenced ];
(use '--show-trace' to show detailed location information)
$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 5.10.60, NixOS, 21.11 (Porcupine)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.4pre20210802_47e96bb`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
{
"unstable": {
"locked": {
"lastModified": 1630140382,
"narHash": "sha256-ntXepAHFlAEtaYIU5EzckRUODeeMgpu1u2Yug+4LFNc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "08ef0f28e3a41424b92ba1d203de64257a9fca6a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
}
}
Here's the configuration.nix
but I don't have a whole lot of nvidia settings:
~/dotfiles on master
$ rg nvidia
hosts/nixos/configuration.nix
100: videoDrivers = [ "nvidia" ];
That looks completely unrelated. I'm closing this issue as I'm pretty sure my original mistake has been fixed in all channels.
Describe the bug
System works perfectly fine unless I add
services.xserver.enable = true
. This is currently limiting me to only using wayland and launching from tty instead of using a display manager.Steps To Reproduce
services.xserver.enable = true
to configsudo nixos-rebuild test
from terminalAdditional context
Pastebin of result. Seems to imply that the issue has something to do with fonts.
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.