programs.dconf: simlify the config
This commit is contained in:
@@ -16,26 +16,19 @@ let
|
|||||||
text = lib.generators.toDconfINI p.gsettings;
|
text = lib.generators.toDconfINI p.gsettings;
|
||||||
}) enabledPrograms;
|
}) enabledPrograms;
|
||||||
|
|
||||||
|
profilePackage = pkgs.writeTextFile {
|
||||||
|
name = "dconf-user-profile";
|
||||||
|
destination = "/etc/dconf/profile/user";
|
||||||
|
text = ''
|
||||||
|
user-db:user
|
||||||
|
system-db:site
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
cfg = config.sane.programs.dconf;
|
cfg = config.sane.programs.dconf;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
sane.programs.dconf = {
|
sane.programs.dconf = {
|
||||||
configOption = with lib; mkOption {
|
|
||||||
type = types.submodule {
|
|
||||||
options = {
|
|
||||||
site = mkOption {
|
|
||||||
# TODO: this option shouldn't be necessary; generate it all directly from `gsettings`
|
|
||||||
type = types.listOf types.package;
|
|
||||||
default = [];
|
|
||||||
description = ''
|
|
||||||
dconf values to link into /etc/dconf
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
default = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
packageUnwrapped = pkgs.rmDbusServicesInPlace pkgs.dconf;
|
packageUnwrapped = pkgs.rmDbusServicesInPlace pkgs.dconf;
|
||||||
sandbox.whitelistDbus = [ "user" ];
|
sandbox.whitelistDbus = [ "user" ];
|
||||||
persist.byStore.private = [
|
persist.byStore.private = [
|
||||||
@@ -51,24 +44,12 @@ in
|
|||||||
# supposedly necessary for packages which haven't been wrapped (i.e. wrapGtkApp?),
|
# supposedly necessary for packages which haven't been wrapped (i.e. wrapGtkApp?),
|
||||||
# but in practice seems unnecessary.
|
# but in practice seems unnecessary.
|
||||||
# env.GIO_EXTRA_MODULES = "${pkgs.dconf.lib}/lib/gio/modules";
|
# env.GIO_EXTRA_MODULES = "${pkgs.dconf.lib}/lib/gio/modules";
|
||||||
|
|
||||||
config.site = sitePackages ++ [
|
|
||||||
(pkgs.writeTextFile {
|
|
||||||
name = "dconf-user-profile";
|
|
||||||
destination = "/etc/dconf/profile/user";
|
|
||||||
text = ''
|
|
||||||
user-db:user
|
|
||||||
system-db:site
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO: get dconf to read these from ~/.config/dconf ?
|
|
||||||
environment.etc.dconf = lib.mkIf cfg.enabled {
|
environment.etc.dconf = lib.mkIf cfg.enabled {
|
||||||
source = pkgs.symlinkJoin {
|
source = pkgs.symlinkJoin {
|
||||||
name = "dconf-system-config";
|
name = "dconf-system-config";
|
||||||
paths = map (x: "${x}/etc/dconf") cfg.config.site;
|
paths = map (x: "${x}/etc/dconf") ([profilePackage] ++ sitePackages);
|
||||||
nativeBuildInputs = [ (lib.getBin pkgs.dconf) ];
|
nativeBuildInputs = [ (lib.getBin pkgs.dconf) ];
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
if test -d $out/db; then
|
if test -d $out/db; then
|
||||||
|
Reference in New Issue
Block a user