1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 14:11:36 +00:00
nixpkgs/nixos/modules/programs/dconf.nix

48 lines
938 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.dconf;
mkDconfProfile = name: path:
{
name = "dconf/profile/${name}";
value.source = path;
};
in
{
###### interface
options = {
programs.dconf = {
enable = mkEnableOption "dconf";
profiles = mkOption {
type = types.attrsOf types.path;
default = {};
description = "Set of dconf profile files.";
internal = true;
};
};
};
###### implementation
config = mkIf (cfg.profiles != {} || cfg.enable) {
environment.etc = optionalAttrs (cfg.profiles != {})
(mapAttrs' mkDconfProfile cfg.profiles);
2019-11-30 23:11:47 +00:00
services.dbus.packages = [ pkgs.dconf ];
# For dconf executable
2019-11-30 23:11:47 +00:00
environment.systemPackages = [ pkgs.dconf ];
# 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" ];
};
}