mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
wrapper-manager/dconf: add test and fix module
More proof that I don't do testing in this project. :)
This commit is contained in:
parent
4011c89612
commit
6b4422c8cd
@ -39,14 +39,15 @@ in
|
||||
dconfProfileFile =
|
||||
pkgs.writeText
|
||||
"dconf-profile"
|
||||
(lib.concatMapStrings (profile: "${profile}\n") submoduleCfg.profiles);
|
||||
(lib.concatMapStrings (db: "${db}\n") submoduleCfg.profile);
|
||||
|
||||
dconfDirName = "wrapper-manager-dconf-${config.executableName}";
|
||||
dconfSettings =
|
||||
settingsFormat.generate "wrapper-manager-dconf-${config.executableName}" submoduleCfg.settings;
|
||||
settingsFormat.generate dconfDirName submoduleCfg.settings;
|
||||
|
||||
dconfSettingsDatabase =
|
||||
pkgs.runCommand "wrapper-manager-dconf-${config.executableName}-database" { nativeBuildInputs = [ submoduleCfg.package ]; } ''
|
||||
dconf compile ${builtins.placeholder "out"} ${dconfSettings}
|
||||
dconf compile ${builtins.placeholder "out"} "${dconfSettings}/dconf"
|
||||
'';
|
||||
in {
|
||||
options.dconf = {
|
||||
|
26
tests/modules/wrapper-manager/dconf/basic.nix
Normal file
26
tests/modules/wrapper-manager/dconf/basic.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
section = "one/foodogsquared/SomeMadeUpCrap";
|
||||
key = "somemadeupkey";
|
||||
value = true;
|
||||
in
|
||||
{
|
||||
wrappers.dconf-test = {
|
||||
arg0 = lib.getExe' pkgs.dconf "dconf";
|
||||
dconf = {
|
||||
enable = true;
|
||||
settings.${section}.${key} = value;
|
||||
};
|
||||
};
|
||||
|
||||
build.extraPassthru.tests = {
|
||||
dconfCheck = pkgs.runCommand "dconf-wrapped-test" { } ''
|
||||
export HOME=$TMPDIR
|
||||
|
||||
# We've hardcoded the value for now since Nix toString function makes the
|
||||
# boolean either "1" or an empty string.
|
||||
[ "$(${lib.getExe' config.build.toplevel "dconf-test"} read '/${section}/${key}')" = 'true' ] && touch $out
|
||||
'';
|
||||
};
|
||||
}
|
3
tests/modules/wrapper-manager/dconf/default.nix
Normal file
3
tests/modules/wrapper-manager/dconf/default.nix
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
basic = ./basic.nix;
|
||||
}
|
@ -21,4 +21,5 @@ in
|
||||
boxxy = runTests ./sandboxing/boxxy { };
|
||||
zellij = runTests ./programs/zellij { };
|
||||
jujutsu = runTests ./programs/jujutsu { };
|
||||
dconf = runTests ./dconf { };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user