Test nixosModules option
This commit is contained in:
parent
55198246ae
commit
ea91ff1991
1 changed files with 22 additions and 0 deletions
|
|
@ -169,6 +169,17 @@ rec {
|
|||
partitionedAttrs.devShells = "dev";
|
||||
});
|
||||
|
||||
nixosModulesFlake = mkFlake
|
||||
{
|
||||
inputs.self = { outPath = "/test/path"; };
|
||||
}
|
||||
{
|
||||
systems = [ ];
|
||||
flake.nixosModules.example = { lib, ... }: {
|
||||
options.test.option = lib.mkOption { default = "nixos-test"; };
|
||||
};
|
||||
};
|
||||
|
||||
runTests = ok:
|
||||
|
||||
assert empty == {
|
||||
|
|
@ -255,6 +266,17 @@ rec {
|
|||
|
||||
assert builtins.isAttrs partitionWithoutExtraInputsFlake.devShells.x86_64-linux;
|
||||
|
||||
assert nixosModulesFlake.nixosModules.example._class == "nixos";
|
||||
|
||||
assert nixosModulesFlake.nixosModules.example._file == "/test/path/flake.nix#nixosModules.example";
|
||||
|
||||
assert (lib.evalModules {
|
||||
class = "nixos";
|
||||
modules = [
|
||||
nixosModulesFlake.nixosModules.example
|
||||
];
|
||||
}).config.test.option == "nixos-test";
|
||||
|
||||
ok;
|
||||
|
||||
result = runTests "ok";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue