parent
d57c59e7cb
commit
5e6f09795c
|
@ -92,6 +92,18 @@ in {
|
|||
<filename>~/.gtkrc-2.0</filename>.
|
||||
'';
|
||||
};
|
||||
|
||||
configLocation = mkOption {
|
||||
type = types.path;
|
||||
default = "${config.home.homeDirectory}/.gtkrc-2.0";
|
||||
defaultText =
|
||||
literalExample ''"''${config.home.homeDirectory}/.gtkrc-2.0"'';
|
||||
example =
|
||||
literalExample ''"''${config.xdg.configHome}/gtk-2.0/gtkrc"'';
|
||||
description = ''
|
||||
The location to put the GTK configuration file.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
gtk3 = {
|
||||
|
@ -154,10 +166,12 @@ in {
|
|||
home.packages = optionalPackage cfg.font ++ optionalPackage cfg.theme
|
||||
++ optionalPackage cfg.iconTheme;
|
||||
|
||||
home.file.".gtkrc-2.0".text =
|
||||
home.file.${cfg2.configLocation}.text =
|
||||
concatStringsSep "\n" (mapAttrsToList formatGtk2Option ini) + "\n"
|
||||
+ cfg2.extraConfig;
|
||||
|
||||
home.sessionVariables.GTK2_RC_FILES = cfg2.configLocation;
|
||||
|
||||
xdg.configFile."gtk-3.0/settings.ini".text =
|
||||
toGtk3Ini { Settings = ini // cfg3.extraConfig; };
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ import nmt {
|
|||
] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [
|
||||
./modules/config/i18n
|
||||
./modules/misc/debug
|
||||
./modules/misc/gtk
|
||||
./modules/misc/numlock
|
||||
./modules/misc/pam
|
||||
./modules/misc/qt
|
||||
|
@ -106,10 +107,10 @@ import nmt {
|
|||
./modules/services/fluidsynth
|
||||
./modules/services/kanshi
|
||||
./modules/services/lieer
|
||||
./modules/services/redshift-gammastep
|
||||
./modules/services/pbgopy
|
||||
./modules/services/playerctld
|
||||
./modules/services/polybar
|
||||
./modules/services/redshift-gammastep
|
||||
./modules/services/sxhkd
|
||||
./modules/services/window-managers/i3
|
||||
./modules/services/window-managers/sway
|
||||
|
|
5
tests/modules/misc/gtk/default.nix
Normal file
5
tests/modules/misc/gtk/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
gtk2-basic-config = ./gtk2-basic-config.nix;
|
||||
gtk2-config-file-location = ./gtk2-config-file-location.nix;
|
||||
}
|
||||
|
1
tests/modules/misc/gtk/gtk-basic-config-expected.conf
Normal file
1
tests/modules/misc/gtk/gtk-basic-config-expected.conf
Normal file
|
@ -0,0 +1 @@
|
|||
gtk-can-change-accels = 1
|
21
tests/modules/misc/gtk/gtk2-basic-config.nix
Normal file
21
tests/modules/misc/gtk/gtk2-basic-config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
gtk = {
|
||||
enable = true;
|
||||
gtk2.extraConfig = "gtk-can-change-accels = 1";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.gtkrc-2.0
|
||||
assertFileContents home-files/.gtkrc-2.0 ${
|
||||
./gtk-basic-config-expected.conf
|
||||
}
|
||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'GTK2_RC_FILES=.*/.gtkrc-2.0'
|
||||
'';
|
||||
};
|
||||
}
|
16
tests/modules/misc/gtk/gtk2-config-file-location.nix
Normal file
16
tests/modules/misc/gtk/gtk2-config-file-location.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
gtk.enable = true;
|
||||
gtk.gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/gtk-2.0/gtkrc
|
||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'GTK2_RC_FILES=.*/\.config/gtk-2.0/gtkrc'
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue