mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 04:09:47 +01:00
cb09a968e9
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.
35 lines
737 B
Nix
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
|
|
}
|
|
'';
|
|
};
|
|
};
|
|
}
|