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

Merge release-23.11 into staging-next-23.11

parents d5e34f5e ee7dc395
Loading
Loading
Loading
Loading
+22 −10
Original line number Diff line number Diff line
@@ -3,6 +3,11 @@

{ lib }:

let
  inherit (lib) matchAttrs any all;
  inherit (builtins) isString;

in
rec {


@@ -83,14 +88,21 @@ rec {
     We can inject these into a pattern for the whole of a structured platform,
     and then match that.
  */
  platformMatch = platform: elem: let
      pattern =
        if builtins.isString elem
        then { system = elem; }
        else if elem?parsed
        then elem
        else { parsed = elem; };
    in lib.matchAttrs pattern platform;
  platformMatch = platform: elem: (
    # Check with simple string comparison if elem was a string.
    #
    # The majority of comparisons done with this function will be against meta.platforms
    # which contains a simple platform string.
    #
    # Avoiding an attrset allocation results in significant  performance gains (~2-30) across the board in OfBorg
    # because this is a hot path for nixpkgs.
    if isString elem then platform ? system && elem == platform.system
    else matchAttrs (
      # Normalize platform attrset.
      if elem ? parsed then elem
      else { parsed = elem; }
    ) platform
  );

  /* Check if a package is available on a given platform.

@@ -102,8 +114,8 @@ rec {
       2. None of `meta.badPlatforms` pattern matches the given platform.
  */
  availableOn = platform: pkg:
    ((!pkg?meta.platforms) || lib.any (platformMatch platform) pkg.meta.platforms) &&
    lib.all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or []);
    ((!pkg?meta.platforms) || any (platformMatch platform) pkg.meta.platforms) &&
    all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or []);

  /* Get the corresponding attribute in lib.licenses
     from the SPDX ID.
+20 −0
Original line number Diff line number Diff line
@@ -1948,4 +1948,24 @@ runTests {
  testGetExe'FailureSecondArg = testingThrow (
    getExe' { type = "derivation"; } "dir/executable"
  );

  testPlatformMatch = {
    expr = meta.platformMatch { system = "x86_64-linux"; } "x86_64-linux";
    expected = true;
  };

  testPlatformMatchAttrs = {
    expr = meta.platformMatch (systems.elaborate "x86_64-linux") (systems.elaborate "x86_64-linux").parsed;
    expected = true;
  };

  testPlatformMatchNoMatch = {
    expr = meta.platformMatch { system = "x86_64-darwin"; } "x86_64-linux";
    expected = false;
  };

  testPlatformMatchMissingSystem = {
    expr = meta.platformMatch { } "x86_64-linux";
    expected = false;
  };
}
+7 −0
Original line number Diff line number Diff line
@@ -10064,6 +10064,13 @@
    githubId = 2472678;
    name = "Lucas Desgouilles";
  };
  ldprg = {
    email = "lukas_4dr@gmx.at";
    matrix = "@ldprg:matrix.org";
    github = "LDprg";
    githubId = 71488985;
    name = "LDprg";
  };
  league = {
    email = "league@contrapunctus.net";
    github = "league";
+2 −0
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@

- [c2FmZQ](https://github.com/c2FmZQ/c2FmZQ/), an application that can securely encrypt, store, and share files, including but not limited to pictures and videos. Available as [services.c2fmzq-server](#opt-services.c2fmzq-server.enable).

- [preload](http://sourceforge.net/projects/preload), a service that makes applications run faster by prefetching binaries and shared objects.  Available as [services.preload](#opt-services.preload.enable).

## Backward Incompatibilities {#sec-release-23.11-incompatibilities}

- `services.postgresql.ensurePermissions` has been deprecated in favor of `services.postgresql.ensureUsers.*.ensureDBOwnership` which simplifies the setup of database owned by a certain system user
+1 −0
Original line number Diff line number Diff line
@@ -722,6 +722,7 @@
  ./services/misc/podgrab.nix
  ./services/misc/polaris.nix
  ./services/misc/portunus.nix
  ./services/misc/preload.nix
  ./services/misc/prowlarr.nix
  ./services/misc/pufferpanel.nix
  ./services/misc/pykms.nix
Loading