Merge master into staging-nixos
This commit is contained in:
@@ -109,6 +109,8 @@
|
||||
|
||||
- `nodePackages.browserify` has been removed, as it was unmaintained within nixpkgs.
|
||||
|
||||
- `command-not-found` package will be enabled by default if the source of nixpkgs contains the file `programs.sqlite`. This is the case if a nixpkgs tarball from https://channels.nixos.org is used. This usage will also make the database of `command-no-found` stateless.
|
||||
|
||||
- `nodePackages.sass` has been removed, as it was unmaintained within nixpkgs.
|
||||
|
||||
- All `@tailwindcss` packages in the `nodePackages` set have been removed, as they are libraries that should instead be locked by JS projects that utilize them.
|
||||
|
||||
@@ -38,8 +38,6 @@ in
|
||||
Whether interactive shells should show which Nix package (if
|
||||
any) provides a missing command.
|
||||
|
||||
Requires nix-channels to be set and downloaded (sudo nix-channel --update.)
|
||||
|
||||
See also nix-index and nix-index-database as an alternative for flakes-based systems.
|
||||
|
||||
Additionally, having the env var NIX_AUTO_RUN set will automatically run the matching package, and with NIX_AUTO_RUN_INTERACTIVE it will confirm the package before running.
|
||||
@@ -47,38 +45,48 @@ in
|
||||
};
|
||||
|
||||
dbPath = lib.mkOption {
|
||||
default = "/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite";
|
||||
description = ''
|
||||
Absolute path to programs.sqlite.
|
||||
Absolute path to `programs.sqlite`, which contains mappings from binary names to package names.
|
||||
|
||||
By default this file will be provided by your channel
|
||||
(nixexprs.tar.xz).
|
||||
If a nixpkgs tarball from https://channels.nixos.org is used as the source of nixpkgs, this file will be provided and this option be set by default.
|
||||
|
||||
To use the stateful `programs.sqlite` database, set this option to
|
||||
`/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite`.
|
||||
If you do so, you can update it with `sudo nix-channels --update`.
|
||||
'';
|
||||
type = lib.types.path;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.bash.interactiveShellInit = ''
|
||||
command_not_found_handle() {
|
||||
'${commandNotFound}/bin/command-not-found' "$@"
|
||||
}
|
||||
'';
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
programs.command-not-found = {
|
||||
enable = lib.mkOptionDefault (builtins.pathExists cfg.dbPath);
|
||||
dbPath = pkgs.path + "/programs.sqlite";
|
||||
};
|
||||
}
|
||||
|
||||
programs.zsh.interactiveShellInit = ''
|
||||
command_not_found_handler() {
|
||||
'${commandNotFound}/bin/command-not-found' "$@"
|
||||
}
|
||||
'';
|
||||
(lib.mkIf cfg.enable {
|
||||
programs.bash.interactiveShellInit = ''
|
||||
command_not_found_handle() {
|
||||
'${commandNotFound}/bin/command-not-found' "$@"
|
||||
}
|
||||
'';
|
||||
|
||||
# NOTE: Fish by itself checks for nixos command-not-found, let's instead makes it explicit.
|
||||
programs.fish.interactiveShellInit = ''
|
||||
function fish_command_not_found
|
||||
"${commandNotFound}/bin/command-not-found" $argv
|
||||
end
|
||||
'';
|
||||
programs.zsh.interactiveShellInit = ''
|
||||
command_not_found_handler() {
|
||||
'${commandNotFound}/bin/command-not-found' "$@"
|
||||
}
|
||||
'';
|
||||
|
||||
environment.systemPackages = [ commandNotFound ];
|
||||
};
|
||||
# NOTE: Fish by itself checks for nixos command-not-found, let's instead makes it explicit.
|
||||
programs.fish.interactiveShellInit = ''
|
||||
function fish_command_not_found
|
||||
"${commandNotFound}/bin/command-not-found" $argv
|
||||
end
|
||||
'';
|
||||
|
||||
environment.systemPackages = [ commandNotFound ];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -526,11 +526,11 @@
|
||||
"vendorHash": null
|
||||
},
|
||||
"hashicorp_azurerm": {
|
||||
"hash": "sha256-22ZxBz5ZKJzgG/HMv6kce5NosPtmYPk46R7pu3Ss4OA=",
|
||||
"hash": "sha256-dLapX7pWRKR90D19e7DZZki+VTgKLP2n9ADww2CIQg8=",
|
||||
"homepage": "https://registry.terraform.io/providers/hashicorp/azurerm",
|
||||
"owner": "hashicorp",
|
||||
"repo": "terraform-provider-azurerm",
|
||||
"rev": "v4.68.0",
|
||||
"rev": "v4.69.0",
|
||||
"spdx": "MPL-2.0",
|
||||
"vendorHash": null
|
||||
},
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
|
||||
buildNpmPackage rec {
|
||||
pname = "all-the-package-names";
|
||||
version = "2.0.2413";
|
||||
version = "2.0.2421";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nice-registry";
|
||||
repo = "all-the-package-names";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-loI9wKz0EcePvM2kXqmxNx9rfC/VaMCmJtm0dTjWoOk=";
|
||||
hash = "sha256-1ES2T8PjajmXtNM2xIxM795ub5OKQ0WRa1XH9te+8+0=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-6XLDdamRG+IVq/zdyKKlIsnfUVD8pKES7K7hm+yTQ78=";
|
||||
npmDepsHash = "sha256-cYCNNc9+jM6sVBc15OlNaTo0BZ7XudI5c1SODrXD548=";
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
# https://github.com/nianeyna/ao3downloader/blob/f8399bb8aca276ae7359157b90afd13925c90056/pyproject.toml#L8
|
||||
python312Packages.buildPythonApplication (finalAttrs: {
|
||||
pname = "ao3downloader";
|
||||
version = "2026.2.0";
|
||||
version = "2026.4.7";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nianeyna";
|
||||
repo = "ao3downloader";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-NrVzRYNxvy8LOvXy0/1go0wEQyLt56inu+f93UFX1CM=";
|
||||
hash = "sha256-PlMVhvUX/XeNrKfwe+/sFv8Y4k7GEzCR+xIO/zuspxM=";
|
||||
};
|
||||
|
||||
build-system = with python312Packages; [
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "feishu-cli";
|
||||
version = "1.18.1";
|
||||
version = "1.21.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "riba2534";
|
||||
repo = "feishu-cli";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-LYhBwXkkYtc9uNXOMn/lRiCInSSy0tCf0vGsuFDuJJI=";
|
||||
hash = "sha256-4+YEU0gRL3WF19a949QweVIdtXt8BWMummjK9ypBHXQ=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-MZv772U+3+Fcanaiuhz+OCqfIsYyCG7B4iZOnEftbi8=";
|
||||
|
||||
@@ -51,9 +51,6 @@ appimageTools.wrapType2 {
|
||||
# lms cli tool
|
||||
install -m 755 ${appimageContents}/resources/app/.webpack/lms $out/bin/
|
||||
|
||||
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
|
||||
--set-rpath "${lib.getLib stdenv.cc.cc}/lib:${lib.getLib stdenv.cc.cc}/lib64:$out/lib:${
|
||||
lib.makeLibraryPath [ (lib.getLib stdenv.cc.cc) ]
|
||||
}" $out/bin/lms
|
||||
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $out/bin/lms
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "oxide-rs";
|
||||
version = "0.15.0+2026021301.0.0";
|
||||
version = "0.16.0+2026032500.0.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "oxidecomputer";
|
||||
repo = "oxide.rs";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-PFcQ4zNLh1Q5wMgBeWptix9+ii4TY2RtnI6JIyMYa14=";
|
||||
hash = "sha256-0zlH7Gws7Cn161whwx4myBF1wTL46fFcr0mjPrvCTmQ=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@@ -33,7 +33,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
"--skip=test_cmd_auth_debug_logging"
|
||||
];
|
||||
|
||||
cargoHash = "sha256-Yf5PG5jRoufP+rf3WHCwT3zvDp++68Ewl2KFTCO5w54=";
|
||||
cargoHash = "sha256-x6jYTwrfdAKl42AleIYXxWLjnwi1IYMtWnfosueiHp0=";
|
||||
|
||||
cargoBuildFlags = [
|
||||
"--package=oxide-cli"
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "plasma-panel-colorizer";
|
||||
version = "6.10.0";
|
||||
version = "7.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "luisbocanegra";
|
||||
repo = "plasma-panel-colorizer";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-s5KdQLBjy7RlgUwZScw9b6GLPsMBZzeV/kETtGdkNNE=";
|
||||
hash = "sha256-T2LodP2E5R1NtuTNPxzUNenbs6P3Ur1kbEIHGRbzah0=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -451,7 +451,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
// lib.optionalAttrs (!toolsOnly && !userOnly) {
|
||||
mainProgram = "qemu-kvm";
|
||||
}
|
||||
# userOnly: https://qemu.readthedocs.io/en/v9.0.2/user/main.html
|
||||
# userOnly: https://qemu.readthedocs.io/en/master/user/main.html#supported-operating-systems
|
||||
// lib.optionalAttrs userOnly {
|
||||
platforms = with lib.platforms; (linux ++ freebsd ++ openbsd ++ netbsd);
|
||||
description = "QEMU User space emulator - launch executables compiled for one CPU on another CPU";
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
}:
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "rimgo";
|
||||
version = "1.4.1";
|
||||
version = "1.4.2";
|
||||
|
||||
src = fetchFromCodeberg {
|
||||
owner = "rimgo";
|
||||
repo = "rimgo";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-0P2+U4wXiFybpGzV7IB1DXZWC+qIdeQtR6mtiYrrih0=";
|
||||
hash = "sha256-ZdGPZFhjn7jsqHcj8neOocpDweB5TeYXNPfrDw2m7uY=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-unqml6T50BTBzYXXGcL4cc+q9qJJ9W2b2flPBPheBpk=";
|
||||
vendorHash = "sha256-/aflGVI3M1dy6/5/CkQo1wPA59cb7m1XJcoF8nTm35Y=";
|
||||
|
||||
nativeBuildInputs = [ tailwindcss_4 ];
|
||||
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "stax";
|
||||
version = "0.25.1";
|
||||
version = "0.37.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cesarferreira";
|
||||
repo = "stax";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-HHunRVDoijBOcIzj0xknj2O+m+A1nmkkxu97XZcvmJw=";
|
||||
hash = "sha256-8LIc0/z6HJuej9VWMqpW9RTu/kGDQHN59vopDr+iF6w=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ perl ];
|
||||
|
||||
cargoHash = "sha256-cJmK5uX3HCz4own2UtXFkHdGFETjina2/UW18f/g/bA=";
|
||||
cargoHash = "sha256-lOQzFz579p89hDBh3Z7oO2iTITpJG9fFqW/rEq8DwJ0=";
|
||||
|
||||
doInstallCheck = true;
|
||||
doCheck = false;
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "the-foundation";
|
||||
version = "1.12.0";
|
||||
version = "1.12.2";
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "git.skyjake.fi";
|
||||
owner = "skyjake";
|
||||
repo = "the_Foundation";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-dAeeeu0nWS/Tz4/t/s9xKcx2io5FGooHhWiK12GHJpQ=";
|
||||
hash = "sha256-1mHZ+ihGeslOnLATf6PjaemkJBXSbqe4ULvwAluH6JM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
|
||||
python3.pkgs.buildPythonApplication (finalAttrs: {
|
||||
pname = "troubadix";
|
||||
version = "26.4.2";
|
||||
version = "26.4.4";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "greenbone";
|
||||
repo = "troubadix";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-kHi2Q+h6aRikuSZcErLmeUTGSCIXoML0uePgLKuO+Lw=";
|
||||
hash = "sha256-OByl6SYPgM6pFp2OQyHMZHGr3JJ4kTJTZByWjdEnF7c=";
|
||||
};
|
||||
|
||||
pythonRelaxDeps = [
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
ocamlPackages.buildDunePackage {
|
||||
pname = "wayland-proxy-virtwl";
|
||||
version = "0-unstable-2026-04-03";
|
||||
version = "0-unstable-2026-04-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "talex5";
|
||||
repo = "wayland-proxy-virtwl";
|
||||
rev = "34d499a119b9a903730144ba5836e70a73f812ac";
|
||||
sha256 = "sha256-eU0HU0808Tp4Mw+RY2CZVikFIL1lk6rJg6lNVWj35jg=";
|
||||
rev = "60e759ca3e4e26444c4956fb85e24b7944d4d81a";
|
||||
sha256 = "sha256-cqBXINcJJ8yrNzvMHio+6+eO0PFGUWR+sZSvBDxxOvs=";
|
||||
};
|
||||
|
||||
minimalOCamlVersion = "5.0";
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
pkg-config,
|
||||
}:
|
||||
let
|
||||
version = "1.27.0";
|
||||
version = "1.28.0";
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "websurfx";
|
||||
@@ -16,7 +16,7 @@ rustPlatform.buildRustPackage {
|
||||
owner = "neon-mmd";
|
||||
repo = "websurfx";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-j2CELNuHNMlxvdSEXOz5I7npzeq/s6hGLnFdmxN/m+c=";
|
||||
hash = "sha256-FQkwRRa4QmkDZ7JIxFjumCDLgzREVQm3K4U1ACpiZX0=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -27,7 +27,7 @@ rustPlatform.buildRustPackage {
|
||||
openssl
|
||||
];
|
||||
|
||||
cargoHash = "sha256-0MXx17Jm/uXo70HoI2dbEl7XBzXGXKMZ+PYw/dQiJ5U=";
|
||||
cargoHash = "sha256-3wq9KN1n0XCXF9b2VldtlW6DeYt2euBoSIThLWeGCWk=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/handler.rs \
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
graphql-core,
|
||||
hatchling,
|
||||
httpx,
|
||||
opentelemetry-api,
|
||||
pytest-asyncio,
|
||||
pytest-mock,
|
||||
pytestCheckHook,
|
||||
@@ -18,20 +19,16 @@
|
||||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "ariadne";
|
||||
version = "0.29.0";
|
||||
version = "1.0.1";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mirumee";
|
||||
repo = "ariadne";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-u6iKgugj30OxIEQ3P0+e05IC/Mh0hvKfTohTc/7pkUk=";
|
||||
hash = "sha256-V5/4kLdb3Apnnq91HQ3eApl1R2+pqeWhWi5Y0ULqJrI=";
|
||||
};
|
||||
|
||||
patches = [ ./remove-opentracing.patch ];
|
||||
|
||||
pythonRelaxDeps = [ "graphql-core" ];
|
||||
|
||||
build-system = [ hatchling ];
|
||||
|
||||
dependencies = [
|
||||
@@ -43,6 +40,7 @@ buildPythonPackage (finalAttrs: {
|
||||
nativeCheckInputs = [
|
||||
freezegun
|
||||
httpx
|
||||
opentelemetry-api
|
||||
pytest-asyncio
|
||||
pytest-mock
|
||||
pytestCheckHook
|
||||
@@ -53,29 +51,10 @@ buildPythonPackage (finalAttrs: {
|
||||
|
||||
pythonImportsCheck = [ "ariadne" ];
|
||||
|
||||
pytestFlags = [ "--snapshot-update" ];
|
||||
|
||||
disabledTests = [
|
||||
# TypeError: TestClient.request() got an unexpected keyword argument 'content'
|
||||
"test_attempt_parse_request_missing_content_type_raises_bad_request_error"
|
||||
"test_attempt_parse_non_json_request_raises_bad_request_error"
|
||||
"test_attempt_parse_non_json_request_body_raises_bad_request_error"
|
||||
# opentracing
|
||||
"test_query_is_executed_for_multipart_form_request_with_file"
|
||||
"test_query_is_executed_for_multipart_request_with_large_file_with_tracing"
|
||||
# AssertionError: assert not [GraphQLError(...
|
||||
"test_enum_with_int_values_from_dict"
|
||||
"test_enum_with_int_enum_values"
|
||||
"test_enum_with_str_enum_values"
|
||||
];
|
||||
|
||||
disabledTestPaths = [
|
||||
# missing graphql-sync-dataloader test dep
|
||||
"tests/test_dataloaders.py"
|
||||
"tests/wsgi/test_configuration.py"
|
||||
# both include opentracing module, which has been removed from nixpkgs
|
||||
"tests/tracing/test_opentracing.py"
|
||||
"tests/tracing/test_opentelemetry.py"
|
||||
];
|
||||
|
||||
meta = {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git a/tests/asgi/conftest.py b/tests/asgi/conftest.py
|
||||
index a703466..223586e 100644
|
||||
--- a/tests/asgi/conftest.py
|
||||
+++ b/tests/asgi/conftest.py
|
||||
@@ -8,7 +8,6 @@ from ariadne.asgi.handlers import (
|
||||
GraphQLTransportWSHandler,
|
||||
GraphQLWSHandler,
|
||||
)
|
||||
-from ariadne.contrib.tracing.opentracing import opentracing_extension
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -13,14 +13,14 @@
|
||||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "gardena-bluetooth";
|
||||
version = "2.6.0";
|
||||
version = "2.7.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elupus";
|
||||
repo = "gardena-bluetooth";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-QIjCIfsD/YOPfbmHoerynb5iqne0MBlK0y89cc7gR1U=";
|
||||
hash = "sha256-VqGcMz9tFXlrekwWQx2Wx1umbf/q3U9XkQKSkze2cCU=";
|
||||
};
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "mhcgnomes";
|
||||
version = "3.31.1";
|
||||
version = "3.32.1";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pirl-unc";
|
||||
repo = "mhcgnomes";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-SP7hE0tJXBeJ8+NJbz1e8ZpPgVimIE25BgEPyKZ1nLg=";
|
||||
hash = "sha256-6YYmIXuZXCaozkrVhqlxSQ9TG7vthHcMhVl0QpWChZE=";
|
||||
};
|
||||
|
||||
build-system = [
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "miniaudio";
|
||||
version = "1.61";
|
||||
version = "1.70";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "irmen";
|
||||
repo = "pyminiaudio";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-H3o2IWGuMqLrJTzQ7w636Ito6f57WBtMXpXXzrZ7UD8=";
|
||||
hash = "sha256-7i1ORJJwdd/an5IsW/xO1puI/LJJ5WDEdaE8DU4/laQ=";
|
||||
};
|
||||
|
||||
# TODO: Properly unvendor miniaudio c library
|
||||
|
||||
@@ -22,14 +22,17 @@ let
|
||||
assertMsg
|
||||
generators
|
||||
licenses
|
||||
nameValuePair
|
||||
recurseIntoAttrs
|
||||
replaceString
|
||||
;
|
||||
|
||||
mkUnfreePkg = name: {
|
||||
mkPkg = name: license: {
|
||||
pname = name;
|
||||
version = "1.0";
|
||||
meta.license = licenses.unfree;
|
||||
meta.license = license;
|
||||
};
|
||||
|
||||
assertValidity =
|
||||
{
|
||||
nixpkgsConfig,
|
||||
@@ -52,77 +55,97 @@ let
|
||||
toPretty = generators.toPretty { };
|
||||
in
|
||||
assertMsg (actual.success == expected) ''
|
||||
Expected validity of package ${lib.getName pkg} to be ${toPretty expected},
|
||||
but got ${toPretty actual} with config:
|
||||
Expected validity of package '${lib.getName pkg}' with unfree license
|
||||
'${licenses.toSPDX pkg.meta.license}' to be ${toPretty expected}, but got
|
||||
${toPretty actual}
|
||||
with config:
|
||||
${toPretty nixpkgsConfig}
|
||||
'';
|
||||
|
||||
runAssertions = assertions: lib.deepSeq assertions "";
|
||||
|
||||
in
|
||||
recurseIntoAttrs {
|
||||
|
||||
allowOnlyFreePackagesByDefault = assertValidity {
|
||||
nixpkgsConfig = { };
|
||||
pkg = mkUnfreePkg "forbidden";
|
||||
expected = false;
|
||||
};
|
||||
|
||||
allowAllUnfreePackages = assertValidity {
|
||||
nixpkgsConfig = {
|
||||
allowUnfree = true;
|
||||
mkTests = mkUnfreePkg: {
|
||||
allowOnlyFreePackagesByDefault = assertValidity {
|
||||
nixpkgsConfig = { };
|
||||
pkg = mkUnfreePkg "forbidden";
|
||||
expected = false;
|
||||
};
|
||||
pkg = mkUnfreePkg "allowed";
|
||||
|
||||
allowAllUnfreePackages = assertValidity {
|
||||
nixpkgsConfig = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
pkg = mkUnfreePkg "allowed";
|
||||
};
|
||||
|
||||
allowUnfreePackagesWithPredicate =
|
||||
let
|
||||
nixpkgsConfig = {
|
||||
allowUnfreePredicate = pkg: lib.getName pkg == "allowed-by-predicate";
|
||||
};
|
||||
in
|
||||
[
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-predicate";
|
||||
})
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-nothing";
|
||||
expected = false;
|
||||
})
|
||||
];
|
||||
|
||||
allowUnfreeWithPackages = runAssertions [
|
||||
(assertValidity {
|
||||
nixpkgsConfig = {
|
||||
allowUnfreePackages = [ "unfree" ];
|
||||
};
|
||||
pkg = mkUnfreePkg "unfree";
|
||||
expected = true;
|
||||
})
|
||||
];
|
||||
|
||||
allowUnfreePackagesOrPredicate =
|
||||
let
|
||||
nixpkgsConfig = {
|
||||
allowUnfreePackages = [ "allowed-by-packages" ];
|
||||
allowUnfreePredicate = pkg: lib.getName pkg == "allowed-by-predicate";
|
||||
};
|
||||
in
|
||||
runAssertions [
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-packages";
|
||||
})
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-predicate";
|
||||
})
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "forbidden";
|
||||
expected = false;
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
allowUnfreePackagesWithPredicate =
|
||||
let
|
||||
nixpkgsConfig = {
|
||||
allowUnfreePredicate = pkg: lib.getName pkg == "allowed-by-predicate";
|
||||
};
|
||||
in
|
||||
[
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-predicate";
|
||||
})
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-nothing";
|
||||
expected = false;
|
||||
})
|
||||
];
|
||||
|
||||
allowUnfreeWithPackages = runAssertions [
|
||||
(assertValidity {
|
||||
nixpkgsConfig = {
|
||||
allowUnfreePackages = [ "unfree" ];
|
||||
};
|
||||
pkg = mkUnfreePkg "unfree";
|
||||
expected = true;
|
||||
})
|
||||
unfreeLicenses = [
|
||||
licenses.unfree
|
||||
(licenses.AND [
|
||||
licenses.free
|
||||
licenses.unfree
|
||||
])
|
||||
];
|
||||
in
|
||||
|
||||
allowUnfreePackagesOrPredicate =
|
||||
let
|
||||
nixpkgsConfig = {
|
||||
allowUnfreePackages = [ "allowed-by-packages" ];
|
||||
allowUnfreePredicate = pkg: lib.getName pkg == "allowed-by-predicate";
|
||||
};
|
||||
in
|
||||
runAssertions [
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-packages";
|
||||
})
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "allowed-by-predicate";
|
||||
})
|
||||
(assertValidity {
|
||||
inherit nixpkgsConfig;
|
||||
pkg = mkUnfreePkg "forbidden";
|
||||
expected = false;
|
||||
})
|
||||
];
|
||||
}
|
||||
recurseIntoAttrs (
|
||||
builtins.listToAttrs (
|
||||
map (
|
||||
license:
|
||||
nameValuePair (replaceString " " "-" (licenses.toSPDX license)) (
|
||||
recurseIntoAttrs (mkTests (name: mkPkg name license))
|
||||
)
|
||||
) unfreeLicenses
|
||||
)
|
||||
)
|
||||
|
||||
@@ -90,7 +90,7 @@ let
|
||||
&& (
|
||||
if isList attrs.meta.license then
|
||||
any (l: elem l list) attrs.meta.license
|
||||
else if attrs.meta.license ? "type" then
|
||||
else if attrs.meta.license ? "licenseType" then
|
||||
lib.licenses.containsLicenses list attrs.meta.license
|
||||
else
|
||||
elem attrs.meta.license list
|
||||
@@ -105,7 +105,7 @@ let
|
||||
|
||||
isUnfree =
|
||||
licenses:
|
||||
if isAttrs licenses && licenses ? "type" then
|
||||
if isAttrs licenses && licenses ? "licenseType" then
|
||||
!(lib.licenses.isFree licenses)
|
||||
else if isAttrs licenses then
|
||||
!(licenses.free or true)
|
||||
|
||||
Reference in New Issue
Block a user