nixos-config/modules/programs/gnome/default.nix

153 lines
4.3 KiB
Nix

{ pkgs, config, lib, ... }:
let
cfg = config.ptw.services.gnome;
in {
options.ptw.services.gnome = {
enable = lib.mkEnableOption "Configure GNOME using HomeManager";
};
config = lib.mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
arc-theme
gnomeExtensions.appindicator
gnomeExtensions.caffeine
gnomeExtensions.gnome-40-ui-improvements
gnomeExtensions.notification-timeout
gnomeExtensions.window-is-ready-remover
gnomeExtensions.application-volume-mixer
gnomeExtensions.tiling-assistant
gnomeExtensions.tilingnome
gnomeExtensions.tray-icons-reloaded
gnomeExtensions.gsconnect
gnomeExtensions.blur-my-shell
gnomeExtensions.forge
gnome.eog
gnome.nautilus
gnome.evince
unstable.gnome.gnome-shell
gnome.gnome-terminal
pinentry-gnome
dconf # For home-manager
libsForQt5.qtstyleplugin-kvantum
];
gnome.excludePackages = pkgs.gnome.optionalPackages;
};
services = {
accounts-daemon.enable = true;
colord.enable = false;
geoclue2.enable = false;
dleyna-renderer.enable = false;
dleyna-server.enable = false;
gvfs.enable = true;
telepathy.enable = false;
gnome = {
chrome-gnome-shell.enable = false;
gnome-initial-setup.enable = false;
gnome-remote-desktop.enable = false;
rygel.enable = false;
gnome-online-accounts.enable = false;
evolution-data-server.enable = lib.mkForce false;
tracker.enable = false;
tracker-miners.enable = false;
core-utilities.enable = false;
games.enable = false;
};
udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
xserver = {
enable = true;
layout = "de";
libinput.enable = true;
desktopManager.gnome.enable = true;
displayManager.gdm = {
enable = true;
wayland = true;
};
};
};
xdg.portal = {
enable = true;
#extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
gtkUsePortal = true;
};
qt5 = {
style = "adwaita-dark";
platformTheme = "gnome";
enable = true;
};
home-manager.users."${config.ptw.system.singleUser}" = {
#xdg.configFile = {
# # Make QT apps use a dark theme
# "Kvantum/kvantum.kvconfig".text = ''
# [General]
# theme=KvArcDark
# '';
#};
dconf.settings = {
# The packages come in from modules/programs/gnome
# Theme
"org/gnome/desktop/interface" = {
gtk-theme = "Arc-Dark";
};
# Nightlight (TODO: ?)
"org/gnome/settings-daemon/plugins/color" = {
night-light-enabled = true;
};
# Extensions
"org/gnome/shell" = {
enabled-extensions = let
isMiku = config.ptw.system.hostName == "miku";
isNishimiya = config.ptw.system.hostName == "nishimiya";
in [
"caffeine@patapon.info"
"notification-timeout@chlumskyvaclav.gmail.com"
"gnome-ui-tune@itstime.tech"
"volume-mixer@evermiss.net"
"windowIsReady_Remover@nunofarruca@gmail.com"
"blur-my-shell@aunetx"
"gsconnect@andyholmes.github.io"
"trayIconsReloaded@selfmade.pl"
] ++ (lib.optional isMiku "tiling-assistant@leleat-on-github")
++ (lib.optional (isNishimiya || isMiku) "tilingnome@rliang.github.com");
};
"org/gnome/shell/extensions/caffeine" = {
show-notifications = false;
inhibit-apps = [ "mpv.desktop" ];
};
"org/gnome/shell/extensions/notification-timeout" = {
timeout = 3000;
};
"org/gnome/shell/extensions/gnome-ui-tune" = {
hide-search = true;
};
# Shortcuts
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
binding = "<Alt>Return";
command = "gnome-terminal";
name = "Terminal";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = {
binding = "<Super>s";
command = "systemctl suspend";
name = "Suspend";
};
};
};
};
}