2017-12-21 16:16:19 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.dconf;
|
|
|
|
|
|
|
|
mkDconfProfile = name: path:
|
2019-09-14 17:51:29 +00:00
|
|
|
{
|
|
|
|
name = "dconf/profile/${name}";
|
|
|
|
value.source = path;
|
|
|
|
};
|
2014-04-02 16:21:00 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
programs.dconf = {
|
2017-12-21 16:16:19 +00:00
|
|
|
enable = mkEnableOption "dconf";
|
2014-04-02 16:21:00 +00: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) {
|
2019-09-14 17:51:29 +00:00
|
|
|
environment.etc = optionalAttrs (cfg.profiles != {})
|
|
|
|
(mapAttrs' mkDconfProfile cfg.profiles);
|
2017-12-21 16:16:19 +00:00
|
|
|
|
2019-11-30 23:11:47 +00:00
|
|
|
services.dbus.packages = [ pkgs.dconf ];
|
2018-09-04 19:19:31 +00:00
|
|
|
|
2019-08-19 01:54:00 +00:00
|
|
|
# For dconf executable
|
2019-11-30 23:11:47 +00:00
|
|
|
environment.systemPackages = [ pkgs.dconf ];
|
2019-08-19 01:54:00 +00:00
|
|
|
|
|
|
|
# Needed for unwrapped applications
|
2019-11-30 23:11:47 +00:00
|
|
|
environment.variables.GIO_EXTRA_MODULES = mkIf cfg.enable [ "${pkgs.dconf.lib}/lib/gio/modules" ];
|
2014-04-02 16:21:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|