Compare commits

...

2 commits

Author SHA1 Message Date
bb7b08a630 Kde: set up gtk with home-manager 2023-11-04 02:03:47 +01:00
2ec7a30da1 Kde: deprecate system wide gtk settings 2023-11-04 02:03:24 +01:00

View file

@ -1,19 +1,6 @@
{ config, pkgs, lib, flakeSelf, ... }:
let
themeName = "Breeze";
gtk3and4settings = lib.generators.toINI {} {
Settings = {
gtk-theme-name = themeName;
gtk-cursor-theme-name = "breeze_cursors";
};
};
gtk2settings = ''
include "/run/current-system/sw/share/themes/${themeName}-Dark/gtk-2.0/gtkrc"
gtk-theme-name="${themeName}-Dark"
'';
# Set up the default kde options
kdeglobals = lib.generators.toINI {} {
KDE.LookAndFeelPackage = "org.kde.breezedarktint.desktop";
@ -88,41 +75,9 @@ in
displayManager.defaultSession = "plasmawayland";
};
# GTK apps need dconf to grab the correct theme on Wayland
programs.dconf.enable = true;
# The NixOS dconf module doesn't support creating databases
# (https://github.com/NixOS/nixpkgs/issues/54150), so I'm
# doing it manualy
# https://help.gnome.org/admin/system-admin-guide/stable/dconf-custom-defaults.html.en
environment.etc = {
"dconf/profile/user".text = "user-db:user\nsystem-db:local";
"dconf/db/local.d/00-defaultTheme".text = ''
[org/gnome/desktop/interface]
gtk-theme='${themeName}'
'';
};
system.activationScripts = {
dconf = {
text= ''
echo "updating system dconf database..."
${pkgs.dconf}/bin/dconf update
'';
deps = [ "etc" ];
};
};
# Set up GTK to use Breeze instead of adwaita by default
# Theese only seem to work on X11, not wayland
environment.etc = {
"xdg/gtk-4.0/settings.ini".text = gtk3and4settings;
"xdg/gtk-3.0/settings.ini".text = gtk3and4settings;
"gtk-2.0/gtkrc".text = gtk2settings;
};
/*
Install the patched Breeze color schemes and look and feel packages,
as well as the plasma default configs
@ -132,6 +87,15 @@ in
# Plasma configs should be on all users
home-manager.sharedModules = [{
imports = [ flakeSelf.inputs.plasma-manager.homeManagerModules.plasma-manager ];
gtk = {
enable = true;
cursorTheme = { package = pkgs.breeze-icons; name = "breeze-cursors"; };
iconTheme = { package = pkgs.breeze-icons; name = "breeze-dark"; };
theme = { package = pkgs.breeze-gtk; name = "Breeze"; };
# Gtk2 doesn't have a dark mode, so I just tell gtk 3 and 4 to use the dark variant
gtk3.extraConfig.gtk-application-prefer-dark-theme = true;
gtk4.extraConfig.gtk-application-prefer-dark-theme = true;
};
programs.plasma = {
enable = true;
workspace.clickItemTo = "select";