2017-12-21 17:16:19 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
2014-04-02 18:21:00 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.dconf;
|
|
|
|
|
|
|
|
mkDconfProfile = name: path:
|
|
|
|
{ source = path; target = "dconf/profile/${name}"; };
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
programs.dconf = {
|
2017-12-21 17:16:19 +01:00
|
|
|
enable = mkEnableOption "dconf";
|
2014-04-02 18:21:00 +02:00
|
|
|
|
|
|
|
profiles = mkOption {
|
|
|
|
type = types.attrsOf types.path;
|
|
|
|
default = {};
|
|
|
|
description = "Set of dconf profile files.";
|
|
|
|
internal = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
2017-12-21 17:16:19 +01:00
|
|
|
config = mkIf (cfg.profiles != {} || cfg.enable) {
|
|
|
|
environment.etc = optionals (cfg.profiles != {})
|
2014-04-02 18:21:00 +02:00
|
|
|
(mapAttrsToList mkDconfProfile cfg.profiles);
|
2017-12-21 17:16:19 +01:00
|
|
|
|
2018-09-04 21:19:31 +02:00
|
|
|
services.dbus.packages = [ pkgs.gnome3.dconf ];
|
|
|
|
|
2017-12-21 17:16:19 +01:00
|
|
|
environment.variables.GIO_EXTRA_MODULES = optional cfg.enable
|
|
|
|
"${pkgs.gnome3.dconf.lib}/lib/gio/modules";
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/31891
|
|
|
|
#environment.variables.XDG_DATA_DIRS = optional cfg.enable
|
2018-02-25 03:23:58 +01:00
|
|
|
# "$(echo ${pkgs.gnome3.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-*)";
|
2014-04-02 18:21:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|