nixos-config/tests/modules/wrapper-manager/dconf/basic.nix
Gabriel Arazas 6b4422c8cd
wrapper-manager/dconf: add test and fix module
More proof that I don't do testing in this project. :)
2024-08-29 20:07:28 +08:00

27 lines
662 B
Nix

{ 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
'';
};
}