1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 15:09:46 +01:00

gtk: use dconf module for settings

This commit is contained in:
Robert Helgesson 2018-11-04 21:10:40 +01:00
parent a0162dacf6
commit 4104ff2b6a
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -8,8 +8,6 @@ let
cfg2 = config.gtk.gtk2; cfg2 = config.gtk.gtk2;
cfg3 = config.gtk.gtk3; cfg3 = config.gtk.gtk3;
dag = config.lib.dag;
toGtk3Ini = generators.toINI { toGtk3Ini = generators.toINI {
mkKeyValue = key: value: mkKeyValue = key: value:
let let
@ -29,16 +27,6 @@ let
in in
"${n} = ${v'}"; "${n} = ${v'}";
toDconfIni = generators.toINI {
mkKeyValue = key: value:
let
tweakVal = v:
if isString v then "'${v}'"
else toString v;
in
"${key}=${tweakVal value}";
};
fontType = types.submodule { fontType = types.submodule {
options = { options = {
package = mkOption { package = mkOption {
@ -216,21 +204,8 @@ in
xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss; xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss;
home.activation = mkIf cfg3.waylandSupport { dconf.settings = mkIf cfg3.waylandSupport {
gtk3 = dag.entryAfter ["installPackages"] ( "org/gnome/desktop/interface" = dconfIni;
let
iniText = toDconfIni { "/" = dconfIni; };
iniFile = pkgs.writeText "gtk3.ini" iniText;
dconfPath = "/org/gnome/desktop/interface/";
in
''
if [[ -v DRY_RUN ]]; then
echo ${pkgs.gnome3.dconf}/bin/dconf load ${dconfPath} "<" ${iniFile}
else
${pkgs.gnome3.dconf}/bin/dconf load ${dconfPath} < ${iniFile}
fi
''
);
}; };
} }
); );