Hello NixOS Community,
I’m encountering a very confusing and persistent build error while trying to configure my NixOS system using the nixos-24.11 channel. I’m consistently getting “option does not exist” errors, even under circumstances where the option definitely should exist according to the channel version.
System Information:
- Channel: nixos nixos-24.11 release nixos-24.11.717703.5b35d248e920 (verified with sudo nix-channel --list and updated with sudo nix-channel --update).
- system.stateVersion: “24.11”
The Problem(s):
Initially, I faced this error:
error: The option `hardware.graphics' does not exist. Definition values:
- In `/etc/nixos/hardware/nvidia.nix': # (or /etc/nixos/configuration.nix in minimal tests)
{
enable = true;
}
This error persisted even though checking the specified file with cat showed the correct syntax hardware.graphics.enable = true;. The error message incorrectly reported the definition value.
After extensive troubleshooting (including temporarily commenting out the nvidia.nix import), that error seemed to disappear, only to be replaced by errors related to Polkit rules.
When using the new syntax (expected for 24.11): security.polkit.rules.d = { … }; (even with an empty {}), I get:
error: The option `security.polkit.rules' does not exist. Definition values:
- In `/etc/nixos/system/security.nix':
{
d = { # Or just {} in the empty test case
# ...
};
}
IGNORE_WHEN_COPYING_START
content_copy download
Use code with caution.
IGNORE_WHEN_COPYING_END
When testing by reverting to the old syntax : security.polkit.extraRules = ‘’…‘’;, I correctly get:
error: The option `security.polkit.extraRules' does not exist. Definition values:
- In `/etc/nixos/system/security.nix':
''
# ... rules content ...
'';
IGNORE_WHEN_COPYING_START
content_copy download
Use code with caution.
IGNORE_WHEN_COPYING_END
This confirms the system expects the new rules.d syntax but then claims the parent rules option doesn’t exist when I try to use it. And the initial hardware.graphics error remains baffling as it reported the wrong definition value.
Troubleshooting Steps Taken:
- Verified syntax meticulously for hardware.graphics.enable, security.polkit.enable, security.polkit.rules.d, and security.polkit.extraRules.
- Confirmed file content with cat immediately before building.
- Used both modular configuration and a minimal single configuration.nix. The errors persisted in both structures.
- Searched for conflicting definitions using grep -R. None found.
- Tested switching the nixos channel to 24.05 (stable) and setting stateVersion to 24.05. The hardware.graphics error still occurred, which shouldn’t happen on stable (as the option definitely exists there, though Polkit would need extraRules). Switched back to 24.11.
- Ran sudo nix-collect-garbage -d and sudo nix-store --optimise.
- Restarted the Nix daemon (sudo systemctl restart nix-daemon.service).
- Verified Nix store integrity (sudo nix-store --verify --check-contents), which reported no errors.
Current Minimal Configuration (Still Fails):
/etc/nixos/configuration.nix:
# /etc/nixos/configuration.nix (MINIMAL TEST CONFIG)
{ config, pkgs, lib, ... }:
{
imports = [ ./hardware-configuration.nix ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "nixos-test";
networking.networkmanager.enable = true;
time.timeZone = "Europe/Warsaw";
i18n.defaultLocale = "ru_RU.UTF-8";
users.users.yakatze = { isNormalUser = true; extraGroups = [ "wheel" ]; shell = pkgs.zsh; };
programs.zsh.enable = true;
nixpkgs.config.allowUnfree = true;
# Correct graphics option (still caused errors previously, seems ok now?)
hardware.graphics.enable = true;
# Correct Polkit option for 24.11 (Causes "security.polkit.rules does not exist")
security.polkit.enable = true;
security.polkit.rules.d = {
"50-placeholder.rules" = '' /* Placeholder to ensure non-empty */ '';
# Even fails with: security.polkit.rules.d = {};
};
system.stateVersion = "24.11";
}
IGNORE_WHEN_COPYING_START
content_copy download
Use code with caution. Nix
IGNORE_WHEN_COPYING_END
/etc/nixos/hardware-configuration.nix (Standard generated content):
(You might want to paste your actual hardware-configuration.nix content here)
Request:
I’m stuck. It seems Nix is misinterpreting option definitions or the module system itself might have an issue specific to my setup or the current state of the nixos-24.11 channel. The contradictory errors for both hardware.graphics (reporting wrong value) and security.polkit.rules (not existing when rules.d is used) are very confusing.
Does anyone have any idea what might be causing this or suggest further diagnostic steps? I can provide the full --show-trace output if needed (it’s very long).
Thank you!