mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #85992 from symphorien/ibus-db
ibus: fix dconf database
This commit is contained in:
commit
56619d6ebb
4 changed files with 44 additions and 21 deletions
|
@ -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,24 @@ 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 = mkIf (cfg.profiles != {} || cfg.packages != []) {
|
||||
source = cfgDir;
|
||||
};
|
||||
|
||||
services.dbus.packages = [ pkgs.dconf ];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue