2017-12-21 16:16:19 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
2014-04-02 17:21:00 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.dconf;
|
|
|
|
|
|
|
|
mkDconfProfile = name: path:
|
|
|
|
{ source = path; target = "dconf/profile/${name}"; };
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
programs.dconf = {
|
2017-12-21 16:16:19 +00:00
|
|
|
enable = mkEnableOption "dconf";
|
2014-04-02 17:21:00 +01:00
|
|
|
|
|
|
|
profiles = mkOption {
|
|
|
|
type = types.attrsOf types.path;
|
|
|
|
default = {};
|
|
|
|
description = "Set of dconf profile files.";
|
|
|
|
internal = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
2017-12-21 16:16:19 +00:00
|
|
|
config = mkIf (cfg.profiles != {} || cfg.enable) {
|
|
|
|
environment.etc = optionals (cfg.profiles != {})
|
2014-04-02 17:21:00 +01:00
|
|
|
(mapAttrsToList mkDconfProfile cfg.profiles);
|
2017-12-21 16:16:19 +00: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 02:23:58 +00:00
|
|
|
# "$(echo ${pkgs.gnome3.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-*)";
|
2014-04-02 17:21:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|