diff options
author | worldofpeace <worldofpeace@protonmail.ch> | 2020-04-24 15:49:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 15:49:01 -0400 |
commit | 78a9359b2aae2bdf407ae4b1085fe84329c3cd5d (patch) | |
tree | 805e2feeb991d3c2aff72e41907906260f1b0039 /nixos/modules/programs | |
parent | a3467dfa824de34d56c6305c7b15911fb9fd4f32 (diff) | |
parent | 5b7ffe61403bdbc955e02f40ad0270f337a56475 (diff) | |
download | nixlib-78a9359b2aae2bdf407ae4b1085fe84329c3cd5d.tar nixlib-78a9359b2aae2bdf407ae4b1085fe84329c3cd5d.tar.gz nixlib-78a9359b2aae2bdf407ae4b1085fe84329c3cd5d.tar.bz2 nixlib-78a9359b2aae2bdf407ae4b1085fe84329c3cd5d.tar.lz nixlib-78a9359b2aae2bdf407ae4b1085fe84329c3cd5d.tar.xz nixlib-78a9359b2aae2bdf407ae4b1085fe84329c3cd5d.tar.zst nixlib-78a9359b2aae2bdf407ae4b1085fe84329c3cd5d.zip |
Merge pull request #85892 from symphorien/ibus-db
ibus: fix dconf db installation
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r-- | nixos/modules/programs/dconf.nix | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/nixos/modules/programs/dconf.nix b/nixos/modules/programs/dconf.nix index 6702e8efd1cb..30fbd72a9abf 100644 --- a/nixos/modules/programs/dconf.nix +++ b/nixos/modules/programs/dconf.nix @@ -4,13 +4,24 @@ with lib; let cfg = config.programs.dconf; - - mkDconfProfile = name: path: - { - name = "dconf/profile/${name}"; - value.source = path; - }; - + cfgDir = pkgs.symlinkJoin { + name = "dconf-system-config"; + paths = map (x: "${x}/etc/dconf") cfg.packages; + postBuild = '' + mkdir -p $out/profile + mkdir -p $out/db + '' + ( + concatStringsSep "\n" ( + mapAttrsToList ( + name: path: '' + ln -s ${path} $out/profile/${name} + '' + ) cfg.profiles + ) + ) + '' + ${pkgs.dconf}/bin/dconf update $out/db + ''; + }; in { ###### interface @@ -22,18 +33,22 @@ in profiles = mkOption { type = types.attrsOf types.path; default = {}; - description = "Set of dconf profile files."; + description = "Set of dconf profile files, installed at <filename>/etc/dconf/profiles/<replaceable>name</replaceable></filename>."; internal = true; }; + packages = mkOption { + type = types.listOf types.package; + default = []; + description = "A list of packages which provide dconf profiles and databases in <filename>/etc/dconf</filename>."; + }; }; }; ###### implementation config = mkIf (cfg.profiles != {} || cfg.enable) { - environment.etc = optionalAttrs (cfg.profiles != {}) - (mapAttrs' mkDconfProfile cfg.profiles); + environment.etc.dconf.source = mkIf (cfg.profiles != {} || cfg.packages != []) cfgDir; services.dbus.packages = [ pkgs.dconf ]; |