1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-09 04:39:44 +01:00
home-manager/tests/modules/programs/ne/defprefs.nix
Robert Helgesson cb09a968e9
tests: add option test.stubs
This option provides a more convenient way to overlay dummy packages.
It also adds a function `config.lib.test.mkStubPackage` that can,
e.g., be used for `package` options.
2021-09-26 23:26:38 +02:00

35 lines
737 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
defpref = ''
defined through defaultPreferences
'';
autopref = ''
defined through automaticPreferences
'';
in {
config = {
programs.ne = {
enable = true;
defaultPreferences = defpref;
automaticPreferences.".default" = autopref;
};
test.stubs.ne = { };
nmt = {
description =
"Check that it gracefully handles the case of both defaultPreferences and automaticPreferences.'.default' being set, defaulting to the former.";
script = ''
assertFileExists home-files/.ne/.default#ap
assertFileContent home-files/.ne/.default#ap ${
builtins.toFile "defpref" defpref
}
'';
};
};
}