GNOME: Difference between revisions

Klinger (talk | contribs)
added link to nixos manual
reformat code
(3 intermediate revisions by the same user not shown)
Line 50: Line 50:


<syntaxhighlight lang="nixos">
<syntaxhighlight lang="nixos">
dconf = {
{
        enable = true;
  dconf = {
        settings = {
    enable = true;
                "org/gnome/shell" = {
    settings = {
                        disabled-user-extensions = false; # enables user extensions (disabled by default)
      "org/gnome/shell" = {
                        enabled-extensions = [
        disabled-user-extensions = false; # enables user extensions (disabled by default)
                                "blur-my-shell@aunetx"
        enabled-extensions = [
                                # ****
          "blur-my-shell@aunetx"
                        ];
          # ****
                };
        ];
      };


                # Configure individual extensions
      # Configure individual extensions
                "org/gnome/shell/extensions/blur-my-shell" = {
      "org/gnome/shell/extensions/blur-my-shell" = {
                        brightness = 0.75;
        brightness = 0.75;
                        noise-amount = 0;
        noise-amount = 0;
                };
      };
        };
    };
};
  };
}
</syntaxhighlight>
</syntaxhighlight>


To learn about settings that can be configured with dconf either look into "dconf editor" program or type <syntaxhighlight lang="shell">dconf watch /</syntaxhighlight> in the terminal and change settings from the GUI and see which options are responsible for that component/element.
To learn about settings that can be configured with dconf either look into "dconf editor" program or type <syntaxhighlight lang="shell">dconf watch /</syntaxhighlight> in the terminal and change settings from the GUI and see which options are responsible for that component/element.


=== Dark mode ===
=== Dark mode ===


Change default color theme for all GTK4 applications to dark using [[Home Manager]]. Change <code>myuser</code> to the user you want to apply the configuration to.
Change default color theme for all GTK4 applications to dark using [[Home Manager]].


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
home-manager.users.myuser = {
{
        dconf = {
  dconf = {
                enable = true;
    enable = true;
                settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
    settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
        };
  };
};
}
</syntaxhighlight>
</syntaxhighlight>


Line 144: Line 145:
Big [https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 merge request] against Mutter improves the performance of the window manager by a lot (and is already used by Ubuntu). Not merged into nixpkgs due to [https://github.com/NixOS/nixpkgs/issues/197181 philosophy of nixpkgs], but users are free to add this overlay to get it too.
Big [https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 merge request] against Mutter improves the performance of the window manager by a lot (and is already used by Ubuntu). Not merged into nixpkgs due to [https://github.com/NixOS/nixpkgs/issues/197181 philosophy of nixpkgs], but users are free to add this overlay to get it too.


For NixOS 23.11 (gnome 45), add the following:
For NixOS 24.05 (gnome 46), add the following to your NixOS configuration:
 
<syntaxhighlight lang="nix">
nixpkgs.overlays = [
        (final: prev: {
                gnome = prev.gnome.overrideScope (gnomeFinal: gnomePrev: {
                        mutter = gnomePrev.mutter.overrideAttrs ( old: {
                                src = pkgs.fetchgit {
                                        url = "https://gitlab.gnome.org/vanvugt/mutter.git";
                                        rev = "0b896518b2028d9c4d6ea44806d093fd33793689";
                                        sha256 = "sha256-mzNy5GPlB2qkI2KEAErJQzO//uo8yO0kPQUwvGDwR4w=";
                                };
                        });
                });
        })
];
</syntaxhighlight>
 
For NixOS 24.05 (gnome 46), add the following:
 
<syntaxhighlight lang="nix">
nixpkgs.overlays = [
        (final: prev: {
                gnome = prev.gnome.overrideScope (gnomeFinal: gnomePrev: {
                        mutter = gnomePrev.mutter.overrideAttrs ( old: {
                                src = pkgs.fetchgit {
                                        url = "https://gitlab.gnome.org/vanvugt/mutter.git";
                                        rev = "663f19bc02c1b4e3d1a67b4ad72d644f9b9d6970";
                                        sha256 = "sha256-I1s4yz5JEWJY65g+dgprchwZuPGP9djgYXrMMxDQGrs=";
                                };
                        });
                });
        })
];


<syntaxhighlight lang="nixos">
{
  nixpkgs.overlays = [
    (final: prev: {
      gnome = prev.gnome.overrideScope (
        gnomeFinal: gnomePrev: {
          mutter = gnomePrev.mutter.overrideAttrs (old: {
            src = pkgs.fetchgit {
              url = "https://gitlab.gnome.org/vanvugt/mutter.git";
              rev = "663f19bc02c1b4e3d1a67b4ad72d644f9b9d6970";
              sha256 = "sha256-I1s4yz5JEWJY65g+dgprchwZuPGP9djgYXrMMxDQGrs=";
            };
          });
        }
      );
    })
  ];
}
</syntaxhighlight>
</syntaxhighlight>