From dae1d1a875e934d3f42d5deb1b2981ac9d90002e Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Sat, 13 Apr 2024 23:03:34 +0800 Subject: [PATCH] gtk2: add force option Add a gtk.gtk2.force option so that users can force overwrite the configuration file if other applications (e.g. KDE Plasma) updates them. --- modules/misc/gtk.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/misc/gtk.nix b/modules/misc/gtk.nix index 6454eb2a..38d9a8db 100644 --- a/modules/misc/gtk.nix +++ b/modules/misc/gtk.nix @@ -139,6 +139,14 @@ in { }; gtk2 = { + force = mkOption { + type = types.bool; + default = false; + description = '' + Whether to force replace the existing configuration. + ''; + }; + extraConfig = mkOption { type = types.lines; default = ""; @@ -269,9 +277,12 @@ in { cfg.cursorTheme ]; - home.file.${cfg2.configLocation}.text = - concatMapStrings (l: l + "\n") (mapAttrsToList formatGtk2Option gtkIni) - + cfg2.extraConfig + "\n"; + home.file.${cfg2.configLocation} = { + force = cfg2.force; + text = + concatMapStrings (l: l + "\n") (mapAttrsToList formatGtk2Option gtkIni) + + cfg2.extraConfig + "\n"; + }; home.sessionVariables.GTK2_RC_FILES = cfg2.configLocation;