From 8658febe8d28abc593cb220a84b60401f7c46636 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Thu, 29 Aug 2024 21:08:24 +0800 Subject: [PATCH] wrapper-manager/dconf: add keyfiles option --- modules/wrapper-manager/dconf.nix | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/modules/wrapper-manager/dconf.nix b/modules/wrapper-manager/dconf.nix index 4755bfcd..b9130172 100644 --- a/modules/wrapper-manager/dconf.nix +++ b/modules/wrapper-manager/dconf.nix @@ -41,13 +41,19 @@ in "dconf-profile" (lib.concatMapStrings (db: "${db}\n") submoduleCfg.profile); - dconfDirName = "wrapper-manager-dconf-${config.executableName}"; dconfSettings = - settingsFormat.generate dconfDirName submoduleCfg.settings; + settingsFormat.generate "wrapper-manager-dconf-${config.executableName}-settings" submoduleCfg.settings; + + keyfilesDir = pkgs.symlinkJoin { + name = "wrapper-manager-dconf-${config.executableName}"; + paths = submoduleCfg.keyfiles ++ [ "${dconfSettings}/dconf" ]; + }; dconfSettingsDatabase = - pkgs.runCommand "wrapper-manager-dconf-${config.executableName}-database" { nativeBuildInputs = [ submoduleCfg.package ]; } '' - dconf compile ${builtins.placeholder "out"} "${dconfSettings}/dconf" + pkgs.runCommand "wrapper-manager-dconf-${config.executableName}-database" { + nativeBuildInputs = [ submoduleCfg.package ]; + } '' + dconf compile ${builtins.placeholder "out"} "${keyfilesDir}" ''; in { options.dconf = { @@ -73,6 +79,20 @@ in ''; }; + keyfiles = lib.mkOption { + type = with lib.types; listOf path; + description = '' + Additional list of keyfiles to be included as part of the dconf + database. + ''; + default = [ ]; + example = lib.literalExpression '' + [ + ./config/dconf/90-extra-settings.conf + ] + ''; + }; + profile = lib.mkOption { type = with lib.types; listOf str; description = ''