No love for GNOME?

I recently started using linux desktop with NixOS. I was originally planning to make a fancy Hyprland / Niri setup but got lazy and decided to start with the simplest thing requiring zero config - GNOME. I thought I would hate it, but I actually love it. I got this extension called PaperWM and it’s basically like Niri (at least based on the Youtube videos I’ve seen of Niri).

But the one downside is that it’s hard to declaratively manage gnome settings and extensions in NixOS / Home Manager. Partially due to the fact that GNOME seems less popular in the Nix community so many things aren’t packaged.

Anyway, this just got me wondering why there’s no love for GNOME in the Nix community?

It’s not really specifically GNOME. KDE is hard to manage declaratively as well, and significantly because of its design. You can’t control it by putting read-only files into place like many programs, so it requires a lot of specialty work. That said, you can set arbitrary dconf settings through home-manager, so you can probably get a lot done if you look into what actual settings do what you want.

10 Likes

Along these lines, it’s helpful to be able to inspect the GSettings schemas expected by your apps. Our current approach to managing schemas means that out of the box, using (for example) the gsettings utility to look for available keys to set will often fail, even when the app is part of your profile.

$ gsettings list-keys org.gnome.TextEditor
No such schema “org.gnome.TextEditor”

I keep this commandlet around to put me in a shell where the GSettings schemas for a specified set of packages are in scope:

$ nix-gsettings gnome-text-editor  # accepts multiple args

[nix-shell:~]$ gsettings list-keys org.gnome.TextEditor
auto-indent
auto-save-delay
custom-font
discover-settings
...

You can also launch dconf-editor from that shell, etc.

Here’s the definition, as it appears in my home.packages. Hope it’s helpful to someone.

      (writeShellApplication {
        name = "nix-gsettings";
        runtimeInputs = [ config.nix.package ];
        text = ''
          exec nix-shell --expr "
          let
            pkgs = import <nixpkgs> { };
          in
          pkgs.mkShell {
            name = \"nix-gsettings-shell\";
            shellHook = '''
              export XDG_DATA_DIRS=\$XDG_DATA_DIRS'''\''${XDG_DATA_DIRS:+:}\''${
                pkgs.lib.concatMapStringsSep \":\"
                  (pkg: \"\''${pkg.outPath}/share/gsettings-schemas/\''${pkg.name}\")
                  (with pkgs; [ $(printf '(%s) ' "$@") ])
              }
            ''';
          }
          "
        '';
      })
2 Likes

GNOME can be totally declaratively confngured through dconf using home-manager. there are no specific modules to make the process really comfy, but in practice it’s not very hard

4 Likes

Which settings/extensions? Anything you can’t do with dconf settings in home manager? Home Manager - Option Search

1 Like

GNOME is likely by far the most popular desktop among NixOS users. If something’s missing it just means no one found it important enough to package, generally - you’re welcome to submit PRs for packages that you want to see stick around.

6 Likes

GNOME is “boring” because it just works (generally). The customization community is far more likely to post stuff that they spent days or more on customizing. That does not reflect normal usage nor necessarily even the people who contribute to nixpkgs.

3 Likes

Gnome works great for me. I tried setting up hyprland once, but seems like there are million config options, and I couldn’t find some I could just copy. - My only grip with Gnome is that I can’t get Flameshot to work, so screenshotting an then annotating the screenshot doesn’t work.

2 Likes

Sure, flameshot is a qt app, I think qt and gtk interop has always had some issues… I have it working fine on sway.

1 Like

I know more people that use a custom-built desktop from parts than Gnome and Plasma users combined. :joy:

4 Likes

In @waffle8946 's defense, I think that’s because the large cohort of people using gnome/plasma aren’t generally the kinds of people you would get to know. Guesstimating by posts I see on Help, I’d say a good 60% are from gnome/plasma users (and even then I believe plasma is significantly over-represented).

It’s like how the browser poll puts Firefox on top (and librewolf in second), even though statistically it should be like 2% of users. Birds of a feather flock together :wink:

7 Likes

Yeah, that’s a super common feeling in the Nix world. It’s awesome that you found a setup you actually like with GNOME + PaperWM, though! A lot of people write it off without giving it a fair shot.

I think the main reason GNOME doesn’t get as much love from the Nix crowd is that it’s kinda the opposite of the Nix philosophy. GNOME is designed to be configured through GUIs and gsettings, not plain text files. So when you try to “declare” your entire system, you end up fighting against how it’s meant to be used. Wrangling all those extensions and settings can be a real pain, as you’ve noticed.

Window managers like Hyprland or Niri are built from the ground up to be configured with a single config file, which fits the Nix model perfectly. That’s why they’re so popular here.

Since you were originally looking at Hyprland/Niri, you might wanna check out LabWC if you ever get the itch to try something else. It’s a fantastic Wayland compositor that sits in a nice middle ground. It’s stacking by default, but you can easily make it tile, and you’re not locked into one paradigm.

The best part for a Nix user is how dead simple it is to configure declaratively. You don’t even need fancy home-manager modules, you can just dump the config right into your configuration.nix. For example, here’s a snippet of mine:

# environment.etc
environment.etc = {
  # xdg/labwc/autostart
  "xdg/labwc/autostart" = {
    text = ''
      /run/current-system/sw/bin/kitty --start-as=fullscreen &
    '';
  };

  # xdg/labwc/environment
  "xdg/labwc/environment".text = ''
    XKB_DEFAULT_MODEL=pc105
    XKB_DEFAULT_LAYOUT=us,ru
    XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
  '';

  # xdg/labwc/rc.xml
  "xdg/labwc/rc.xml".text = ''
    <?xml version="1.0"?>
    <labwc_config>
      <windowRules>
        <windowRule identifier="*" serverDecoration="no"/>
      </windowRules>
    </labwc_config>
  '';
};

So you get full control over your keybindings, window rules, autostart apps, all right there in your main Nix config. No more hunting for obscure gsettings keys!

Anyway, just thought I’d throw it out there as an option. Happy tinkering

2 Likes

Also, I’m guessing that XFCE is a big competitor to GNOME among NixOS users, especially since it’s so stable in BOTH senses of the word. NixOS makes desktop managers discoverable so we all know about XFCE, whereas I bet most other Linux users have never even heard of it.

1 Like

In home manager, I’m doing something along these lines:

      dconf = {
        enable = true;
        settings = {
          "org/gnome/desktop/interface" = {
            color-scheme = "prefer-dark";
            enable-hot-corners = false;
          };
        };

When I want to do a new setting, i run:
dconf dump / > old-conf.txt
Change the setting in the UI and then run:
dconf dump / > new-conf.txt
Then diff the two files. I can now see what has changed and what I should put into the nix config

7 Likes

You may want to use Gradia. Configured via dconf and in combination with a custom keyboard shortcut it’s a lovely experience.

wait, I got it working. If it’s a problem where your shortcut doesn’t work, for some reason it only works if you call it through a script. I just have a script called flameshot-fix in my $home/.local/bin with this

#!/usr/bin/env bash

flameshot gui

and for some reason this works, but calling flameshot gui from gnome shortcuts doesn’t.

1 Like

You can do a lot of customization for GNOME without Home-manager as well FWIW

I keep a comment in my nix file to dump settings
dconf dump / > dconf-backup.txt
which then can be organized like so

programs.dconf = {
  enable = true;
  profiles.user.databases = [
  {
    lockAll = true; # prevents overriding
    settings = lib.fix (_self: with lib.gvariant; {
      # BASIC GNOME SETTINGS
      “org/gnome/desktop/interface” = {
        color-scheme = “prefer-dark”;
        gtk-theme = “Yaru-blue-dark”;
        gtk-enable-primary-paste = false;
        show-battery-percentage = false;
        enable-hot-corners = false;
        …

Full file + extensions + gnome terminal config

2 Likes

Thank you! I’ll check it out

Hmmm. Just tried frameshot again and it did work! Awesome :rocket:

1 Like

I’m also using PaperWM with Gnome and I’m pretty satisfied with it. The only thing I miss is having the possibility to scale the UI .25% from its current size, as the small font in every menu and toolbar is making me blind and stress my eyes constantly.

I remember asking about declarative configuration of PaperWM and it is possible:

But I have not made any further explorations.

Talking about GNOME love among Nix users, if anyone knows about scaling the UI a little bit there, let me know.

TIA