tests/lsp-servers: disable building unfree default packages
Currently none of the server packages we build are unfree, however if any unfree defaults are added then this test will fail. The two solutions are: 1. Filter out unfree packages - Either set `enable = false` or `package = null` 2. Allow building unfree packages - By setting `nixpkgs.config.allowUnfree = true` For now, I've gone with option 1.
This commit is contained in:
parent
1e7550e6a1
commit
4c99ccfe1e
1 changed files with 9 additions and 3 deletions
|
|
@ -58,11 +58,17 @@ let
|
|||
plugins.lsp.servers = lib.pipe options.plugins.lsp.servers [
|
||||
(lib.mapAttrs (
|
||||
server: opts:
|
||||
let
|
||||
# Some servers are defined using mkUnpackagedOption whose default will throw
|
||||
pkg = builtins.tryEval opts.package.default;
|
||||
hasPkg = opts ? package.default && pkg.success;
|
||||
isUnfree = pkg.value.meta.unfree or false;
|
||||
isDisabled = lib.elem server disabled;
|
||||
in
|
||||
{
|
||||
enable = !(lib.elem server disabled);
|
||||
enable = !isDisabled;
|
||||
}
|
||||
# Some servers are defined using mkUnpackagedOption whose default will throw
|
||||
// lib.optionalAttrs (opts ? package && !(builtins.tryEval opts.package.default).success) {
|
||||
// lib.optionalAttrs (hasPkg -> isUnfree) {
|
||||
package = null;
|
||||
}
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue