Skip to content

Commit

Permalink
Merge pull request #1117 from rohaquinlop/fix-bug-testLicense
Browse files Browse the repository at this point in the history
feat(build): #1099 fix testlicense bug
  • Loading branch information
dsalaza4 authored Jul 4, 2023
2 parents 4340e83 + 4f33658 commit 91ee9fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 6 additions & 2 deletions docs/src/api/builtins/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ Test the license of a project using [reuse](https://reuse.software/).

Types:

- testLicense: Empty attribute set.
- testLicense:
- enable (`bool`): Optional.
Defaults to `false`.

Example:

=== "makes.nix"

```nix
{
testLicense = {};
testLicense = {
enable = true;
};
}
```

Expand Down
4 changes: 3 additions & 1 deletion makes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@
};
};
};
testLicense = {};
testLicense = {
enable = true;
};
testPython = {
example = {
python = "3.11";
Expand Down
9 changes: 7 additions & 2 deletions src/evaluator/modules/test-license/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
...
}: {
options = {
testLicense = {};
testLicense = {
enable = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
};
config = {
outputs = {
"/testLicense" = testLicense;
"/testLicense" = lib.mkIf config.testLicense.enable testLicense;
};
};
}

0 comments on commit 91ee9fe

Please sign in to comment.