mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-01 06:31:04 +01:00
dconf: Provide dconf package and dbus service file
With the dconf package and its dbus service file provided by home-manager, there is no need for it to be provided by the system.
This commit is contained in:
parent
c310818dca
commit
ff73544e4a
1 changed files with 61 additions and 64 deletions
|
|
@ -33,8 +33,7 @@ in
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
dconf = {
|
dconf = {
|
||||||
enable = lib.mkOption {
|
enable = lib.mkEnableOption "dconf" // {
|
||||||
type = types.bool;
|
|
||||||
# While technically dconf on darwin could work, our activation step
|
# While technically dconf on darwin could work, our activation step
|
||||||
# requires dbus, which only *lightly* supports Darwin in general, and
|
# requires dbus, which only *lightly* supports Darwin in general, and
|
||||||
# not at all in the way it's packaged in nixpkgs. Because of this, we
|
# not at all in the way it's packaged in nixpkgs. Because of this, we
|
||||||
|
|
@ -43,14 +42,6 @@ in
|
||||||
# re-enabled, unclear whether there's actual value in it though.
|
# re-enabled, unclear whether there's actual value in it though.
|
||||||
default = !pkgs.stdenv.hostPlatform.isDarwin;
|
default = !pkgs.stdenv.hostPlatform.isDarwin;
|
||||||
visible = false;
|
visible = false;
|
||||||
description = ''
|
|
||||||
Whether to enable dconf settings.
|
|
||||||
|
|
||||||
Note, if you use NixOS then you must add
|
|
||||||
`programs.dconf.enable = true`
|
|
||||||
to your system configuration. Otherwise you will see a systemd error
|
|
||||||
message when your configuration is activated.
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
|
|
@ -85,7 +76,12 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (cfg.enable && cfg.settings != { }) {
|
config = lib.mkIf cfg.enable (
|
||||||
|
{
|
||||||
|
home.packages = [ pkgs.dconf ];
|
||||||
|
dbus.packages = [ pkgs.dconf ];
|
||||||
|
}
|
||||||
|
// lib.mkIf (cfg.settings != { }) {
|
||||||
# Make sure the dconf directory exists.
|
# Make sure the dconf directory exists.
|
||||||
xdg.configFile."dconf/.keep".source = builtins.toFile "keep" "";
|
xdg.configFile."dconf/.keep".source = builtins.toFile "keep" "";
|
||||||
|
|
||||||
|
|
@ -150,5 +146,6 @@ in
|
||||||
unset DCONF_DBUS_RUN_SESSION
|
unset DCONF_DBUS_RUN_SESSION
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue