1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-24 09:50:58 +01:00
home-manager/tests/modules/misc/nix/skip-check-settings.nix
Ian Chamberlain eda9c7b705
nix: skip check completely when checkConfig=false
Also add an `allowUnknownSettings` option to enable checking everything
except for unknown settings.
2025-09-28 12:43:50 -07:00

33 lines
579 B
Nix

{
config,
lib,
pkgs,
...
}:
{
nix = {
package = config.lib.test.mkStubPackage {
version = lib.getVersion pkgs.nixVersions.stable;
buildScript = ''
target=$out/bin/nix
mkdir -p "$(dirname "$target")"
echo -n "true" > "$target"
chmod +x "$target"
'';
};
extraOptions = ''
some! nonsense {
which should fail validation
'';
checkConfig = false;
};
nmt.script = ''
assertFileContent \
home-files/.config/nix/nix.conf \
${./skip-check-settings-expected.conf}
'';
}