summary refs log tree commit diff
path: root/modules/gnome.nix
blob: 26d8a8d947faacb672a31228171292066b77cafb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ config, pkgs, ... }:

{
  services.xserver.enable = true;

  # i dont like how the icon looks :)
  services.xserver.excludePackages = [ pkgs.xterm ];

  services.displayManager.gdm.enable = true;
  services.desktopManager.gnome.enable = true;

  environment.gnome.excludePackages = with pkgs; [
    gnome-console
  ];

  environment.systemPackages = (with pkgs; [
    gnome-terminal gnome-tweaks dconf-editor
  ]) ++ (with pkgs.gnomeExtensions; [
    runcat vitals just-perfection window-is-ready-remover caffeine
  ]);

  environment.sessionVariables = {
    # see: https://github.com/NixOS/nixpkgs/issues/416322
    # revert default renderer to ngl, as vulkan is still broken.
    # upstream will fix this soon.
    GSK_RENDERER = "ngl";
  };

  # legacy apps dark mode support
  services.desktopManager.gnome.extraGSettingsOverrides = ''
    # set dark theme for legacy applications
    [org.gnome.desktop.interface]
    gtk-theme="Adwaita"

    # minimize windows when middle-clicking on titlebar
    [org.gnome.desktop.wm.preferences]
    action-middle-click-titlebar="minimize"

    # map caps-lock to escape key, map compose key to right-alt
    [org.gnome.desktop.input-sources]
    xkb-options=['caps:escape', 'compose:ralt']
  '';

  environment.etc = {
    "xdg/gtk-2.0/gtkrc".text = ''
      gtk-application-prefer-dark-theme = 1
    '';
    "xdg/gtk-3.0/settings.ini".text = ''
      [Settings]
      gtk-application-prefer-dark-theme = 1
    '';
    "xdg/gtk-4.0/settings.ini".text = ''
      [Settings]
      gtk-application-prefer-dark-theme = 1
    '';
  };
}