Unverified Commit 4ff02731 authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 6ed06bc0 62f0186c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -294,6 +294,9 @@ checkConfigOutput '^"42"$' config.value ./declare-coerced-value.nix
checkConfigOutput '^"24"$' config.value ./declare-coerced-value.nix ./define-value-string.nix
checkConfigError 'A definition for option .* is not.*string or signed integer convertible to it.*. Definition values:\n\s*- In .*: \[ \]' config.value ./declare-coerced-value.nix ./define-value-list.nix

# Check coerced option merging.
checkConfigError 'The option .value. in .*/declare-coerced-value.nix. is already declared in .*/declare-coerced-value-no-default.nix.' config.value ./declare-coerced-value.nix ./declare-coerced-value-no-default.nix

# Check coerced value with unsound coercion
checkConfigOutput '^12$' config.value ./declare-coerced-value-unsound.nix
checkConfigError 'A definition for option .* is not of type .*. Definition values:\n\s*- In .*: "1000"' config.value ./declare-coerced-value-unsound.nix ./define-value-string-bigint.nix
+9 −0
Original line number Diff line number Diff line
{ lib, ... }:

{
  options = {
    value = lib.mkOption {
      type = lib.types.coercedTo lib.types.int builtins.toString lib.types.str;
    };
  };
}
+1 −1
Original line number Diff line number Diff line
@@ -1035,7 +1035,7 @@ rec {
        getSubOptions = finalType.getSubOptions;
        getSubModules = finalType.getSubModules;
        substSubModules = m: coercedTo coercedType coerceFunc (finalType.substSubModules m);
        typeMerge = t1: t2: null;
        typeMerge = t: null;
        functor = (defaultFunctor name) // { wrapped = finalType; };
        nestedTypes.coercedType = coercedType;
        nestedTypes.finalType = finalType;
+6 −0
Original line number Diff line number Diff line
@@ -243,6 +243,12 @@
    github = "48cf";
    githubId = 32851089;
  };
  _4ever2 = {
    email = "eske@cs.au.dk";
    github = "4ever2";
    githubId = 3417013;
    name = "Eske Nielsen";
  };
  _6543 = {
    email = "6543@obermui.de";
    github = "6543";
+21 −1
Original line number Diff line number Diff line
@@ -12,7 +12,27 @@
# nix-build build.nix --argstr maintainer <yourname> --argstr system aarch64-linux

let
  pkgs = import ./../../default.nix (removeAttrs args [ "maintainer" ]);
  # This avoids a common situation for maintainers, where due to Git's behavior of not tracking
  # directories, they have an empty directory somewhere in `pkgs/by-name`. Because that directory
  # exists, `pkgs/top-level/by-name-overlay.nix` picks it up and attempts to read `package.nix` out
  # of it... which doesn't exist, since it's empty.
  #
  # We don't want to run the code below on every instantiation of `nixpkgs`, as the `pkgs/by-name`
  # eval machinery is quite performance sensitive. So we use the internals of the `by-name` overlay
  # to implement our own way to avoid an evaluation failure for this script.
  #
  # See <https://github.com/NixOS/nixpkgs/issues/338227> for more motivation for this code block.
  overlay = self: super: {
    _internalCallByNamePackageFile =
      file: if builtins.pathExists file then super._internalCallByNamePackageFile file else null;
  };

  nixpkgsArgs = removeAttrs args [ "maintainer" "overlays" ] // {
    overlays = args.overlays or [] ++ [ overlay ];
  };

  pkgs = import ./../../default.nix nixpkgsArgs;

  maintainer_ = pkgs.lib.maintainers.${maintainer};
  packagesWith = cond: return: set:
    (pkgs.lib.flatten
Loading