mahtso
August 23, 2024, 5:21pm
1
Hello,
Very new to Nixos and have been enjoying it but having this one small issue.
Ive been really looking hard to try to enable VRR on my install of Nixos but the only thing I can really find is this reddit post: Reddit - Dive into anything . They have a bunch of examples but no matter what I do I get syntax errors. I have tried turning it into a module with no luck. Any help is appreciated.
Code for example:
xserver = {
enable = true;
desktopManager.gnome = {
enable = true;
extraGSettingsOverridePackages = [pkgs.gnome.mutter];
extraGSettingsOverrides = ''
[org.gnome.mutter]
experimental-features=['variable-refresh-rate', 'scale-monitor-framebuffer']
'';
};
displayManager.gdm.enable = true;
};
};
and the error when rebuilding:
… while evaluating the attribute 'config'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: syntax error, unexpected '=', expecting end of file
at /etc/nixos/configuration.nix:139:9:
138|
139| xserver = {
| ^
140| enable = true;
building Nix...
error:
… while evaluating the attribute 'config'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: syntax error, unexpected '=', expecting end of file
at /etc/nixos/configuration.nix:139:9:
138|
139| xserver = {
| ^
140| enable = true;
building the system configuration...
error:
… while evaluating the attribute 'config.system.build.toplevel'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: syntax error, unexpected '=', expecting end of file
at /etc/nixos/configuration.nix:139:9:
138|
139| xserver = {
| ^
140| enable = true;
Thanks
Basic troubleshooting guidelines: you must also show your code and show the error, please.
mahtso
August 23, 2024, 5:50pm
3
Sorry about that. Made the edits.
Did you ensure it to put it inside the top-level attrset (i.e. outermost set of curly braces)?
And did you remember the semicolon on the previous line?
mahtso
August 23, 2024, 9:35pm
5
I tried that but either I didnt do it right or something is off with my config file.
Here is my Config:
{ config, pkgs, inputs, ... }:
{
imports = [
./hardware-configuration.nix
../../etc/nixos/modules/removegnomeapps.nix # Remove Gnome Apps
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "-----"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "-----------";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Drivers for RX6700
services.xserver.videoDrivers = [ "amdgpu" ];
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable Steam
programs.steam.enable = true;
# Gamemode
programs.gamemode.enable = true;
# Virtualization
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.------ = {
isNormalUser = true;
description = "-------";
extraGroups = [ "networkmanager" "wheel" "libvirt" "gamemode"];
packages = with pkgs; [
# thunderbird
];
};
# Install firefox.
programs.firefox.enable = false;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
pkgs.librewolf
pkgs.freetube
pkgs.steam
pkgs.rpcs3
pkgs.libreoffice
pkgs.virt-manager
pkgs.neovim
pkgs.libvirt
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
system.stateVersion = "24.05"; # Did you read the comment?
# Automatic Garbage Collection
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
# Variable Refresh Rate.
xserver = {
enable = true;
desktopManager.gnome = {
enable = true;
extraGSettingsOverridePackages = [pkgs.gnome.mutter];
extraGSettingsOverrides = ''
[org.gnome.mutter]
experimental-features=['variable-refresh-rate', 'scale-monitor-framebuffer']
'';
};
displayManager.gdm.enable = true;
};
}
and here is the output after making those adjustments:
error:
… while evaluating the attribute 'config'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `xserver' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
desktopManager = {
gnome = {
enable = true;
extraGSettingsOverridePackages = [
...
building Nix...
error:
… while evaluating the attribute 'config'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `xserver' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
desktopManager = {
gnome = {
enable = true;
extraGSettingsOverridePackages = [
...
building the system configuration...
error:
… while evaluating the attribute 'config.system.build.toplevel'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `xserver' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
desktopManager = {
gnome = {
enable = true;
extraGSettingsOverridePackages = [
...
Thanks so much for your time.
The error is The option `xserver' does not exist.
It’s telling the truth; the options you’re trying to set are under services.xserver
.
One way to fix this is to change xserver = { ... };
to services.xserver = { ... };
.
Watch out, though; your config already has some services.xserver
options above. You’ll need to reconcile those with the stuff you’re adding at the end. I’d advise defining them all in one place with one big services.xserver = { ... };
block, instead of services.xserver.foo = bar;
here and there throughout your config; it’ll make it easier for you to find duplicates.
mahtso
August 23, 2024, 10:17pm
7
I tried what you said and it just starts going down the line about stuff that doesnt exist.
Heres the output.
error:
… while evaluating the attribute 'config'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `desktopManager' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
gnome = {
enable = true;
extraGSettingsOverridePackages = [
<derivation mutter-46.2>
...
building Nix...
error:
… while evaluating the attribute 'config'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `desktopManager' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
gnome = {
enable = true;
extraGSettingsOverridePackages = [
<derivation mutter-46.2>
...
building the system configuration...
error:
… while evaluating the attribute 'config.system.build.toplevel'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:9:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
… while calling the 'seq' builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:322:18:
321| options = checked options;
322| config = checked (removeAttrs config [ "_module" ]);
| ^
323| _module = checked (config._module);
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `desktopManager' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
gnome = {
enable = true;
extraGSettingsOverridePackages = [
<derivation mutter-46.2>
...
There has got to be something Im missing up above in the config. I scoured the wiki article on gnome but it doesnt talk about this at all.
This isn’t a GNOME-related issue. You’re learning the basics of writing Nix configurations here.
In Nix,
a.b.c = value;
means exactly the same thing as
a = {
b = {
c = value;
};
};
Get used to translating between the two mentally. When you see this The option `whatever'` does not exist.
error, that means you’ve written something that translates to a b.c.whatever
path that is not what it should be. You might be missing an outer level, and the correct option is a.b.c.whatever
. You might be missing an inner level, and the correct option is b.c.d.whatever
. Find the correct path for the option you’re trying to set using search , and then patiently examine the line in your config file that is producing the error message to see how the option you’re setting needs to be changed to match the correct path.
2 Likes
mahtso
August 23, 2024, 10:46pm
9
Ill see what I can do. Appreciate the help.