···1314my $ua = LWP::UserAgent->new();
15000016keys %$maintainers_json; # reset the internal iterator so a prior each() doesn't affect the loop
17while(my($k, $v) = each %$maintainers_json) {
18 my $current_user = %$v{'github'};
19 if (!defined $current_user) {
20 print "$k has no github handle\n";
21- next;
22 }
23 my $github_id = %$v{'githubId'};
24 if (!defined $github_id) {
···37 sleep($ratelimit_reset - time() + 5);
38 }
39 if ($resp->code != 200) {
40- print $current_user . " likely deleted their github account\n";
41 next;
42 }
43 my $resp_json = from_json($resp->content);
44 my $api_user = %$resp_json{"login"};
45- if (lc($current_user) ne lc($api_user)) {
46- print $current_user . " is now known on github as " . $api_user . ". Editing maintainer-list.nix…\n";
00047 my $file = path($maintainers_list_nix);
48 my $data = $file->slurp_utf8;
49 $data =~ s/github = "$current_user";$/github = "$api_user";/m;
···1314my $ua = LWP::UserAgent->new();
1516+if (!defined $ENV{GH_TOKEN}) {
17+ die "Set GH_TOKEN before running this script";
18+}
19+20keys %$maintainers_json; # reset the internal iterator so a prior each() doesn't affect the loop
21while(my($k, $v) = each %$maintainers_json) {
22 my $current_user = %$v{'github'};
23 if (!defined $current_user) {
24 print "$k has no github handle\n";
025 }
26 my $github_id = %$v{'githubId'};
27 if (!defined $github_id) {
···40 sleep($ratelimit_reset - time() + 5);
41 }
42 if ($resp->code != 200) {
43+ print "$k likely deleted their github account\n";
44 next;
45 }
46 my $resp_json = from_json($resp->content);
47 my $api_user = %$resp_json{"login"};
48+ if (!defined $current_user) {
49+ print "$k is known on github as $api_user.\n";
50+ }
51+ elsif (lc($current_user) ne lc($api_user)) {
52+ print "$k is now known on github as $api_user. Editing maintainer-list.nix…\n";
53 my $file = path($maintainers_list_nix);
54 my $data = $file->slurp_utf8;
55 $data =~ s/github = "$current_user";$/github = "$api_user";/m;
+4
nixos/doc/manual/release-notes/rl-2311.section.md
···100101- [netclient](https://github.com/gravitl/netclient), an automated WireGuard® Management Client. Available as [services.netclient](#opt-services.netclient.enable).
10200103## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
104105- `network-online.target` has been fixed to no longer time out for systems with `networking.useDHCP = true` and `networking.useNetworkd = true`.
···440 `virtualisation.fileSystems."/".autoFormat = true;`.
441442- `python3.pkgs.flitBuildHook` has been removed. Use `flit-core` and `format = "pyproject"` instead.
00443444- The `qemu-vm.nix` module now supports disabling overriding `fileSystems` with
445 `virtualisation.fileSystems`. This enables the user to boot VMs from
···100101- [netclient](https://github.com/gravitl/netclient), an automated WireGuard® Management Client. Available as [services.netclient](#opt-services.netclient.enable).
102103+- [trunk-ng](https://github.com/ctron/trunk), A fork of `trunk`: Build, bundle & ship your Rust WASM application to the web
104+105## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
106107- `network-online.target` has been fixed to no longer time out for systems with `networking.useDHCP = true` and `networking.useNetworkd = true`.
···442 `virtualisation.fileSystems."/".autoFormat = true;`.
443444- `python3.pkgs.flitBuildHook` has been removed. Use `flit-core` and `format = "pyproject"` instead.
445+446+- The `extend` function of `llvmPackages` has been removed due it coming from the `tools` attrset thus only extending the `tool` attrset. A possible replacement is to construct the set from `libraries` and `tools`, or patch nixpkgs.
447448- The `qemu-vm.nix` module now supports disabling overriding `fileSystems` with
449 `virtualisation.fileSystems`. This enables the user to boot VMs from
···39# just for human consumption. Revision is just an integer that gets increased
40# by one every (stable or unstable) release.
41revision="${snap_info[0]}"
42-sha512="${snap_info[1]}"
043upstream_version="${snap_info[2]}"
44last_updated="${snap_info[3]}"
45-46echo "Latest $channel release is $upstream_version from $last_updated."
47-48#
49# read the current spotify version from the currently *committed* nix expression
50#
···70# search-and-replace revision, hash and version
71sed --regexp-extended \
72 -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \
73- -e 's/sha512\s*=\s*"[^"]*"\s*;/sha512 = "'"${sha512}"'";/' \
74 -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \
75 -i "$spotify_nix"
76
···39# just for human consumption. Revision is just an integer that gets increased
40# by one every (stable or unstable) release.
41revision="${snap_info[0]}"
42+# We need to escape the slashes
43+hash="$(nix-hash --to-sri --type sha512 ${snap_info[1]} | sed 's|/|\\/|g')"
44upstream_version="${snap_info[2]}"
45last_updated="${snap_info[3]}"
046echo "Latest $channel release is $upstream_version from $last_updated."
047#
48# read the current spotify version from the currently *committed* nix expression
49#
···69# search-and-replace revision, hash and version
70sed --regexp-extended \
71 -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \
72+ -e 's/hash\s*=\s*"[^"]*"\s*;/hash = "'"${hash}"'";/' \
73 -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \
74 -i "$spotify_nix"
75
···4950stdenv.mkDerivation (finalAttrs: {
51 pname = "uhd";
52- # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz
53- # and xxx.yyy.zzz. Hrmpf... style keeps changing
54- version = "4.4.0.0";
005556 outputs = [ "out" "dev" ];
57···59 owner = "EttusResearch";
60 repo = "uhd";
61 rev = "v${finalAttrs.version}";
62- sha256 = "sha256-khVOHlvacZc4EMg4m55rxEqPvLY1xURpAfOW905/3jg=";
0063 };
64 # Firmware images are downloaded (pre-built) from the respective release on Github
65 uhdImagesSrc = fetchurl {
66 url = "https://github.com/EttusResearch/uhd/releases/download/v${finalAttrs.version}/uhd-images_${finalAttrs.version}.tar.xz";
67- sha256 = "V8ldW8bvYWbrDAvpWpHcMeLf9YvF8PIruDAyNK/bru4=";
0068 };
69- # TODO: Add passthru.updateScript that will update both of the above hashes...
0000007071 cmakeFlags = [
72 "-DENABLE_LIBUHD=ON"
···4950stdenv.mkDerivation (finalAttrs: {
51 pname = "uhd";
52+ # NOTE: Use the following command to update the package, and the uhdImageSrc attribute:
53+ #
54+ # nix-shell maintainers/scripts/update.nix --argstr package uhd --argstr commit true
55+ #
56+ version = "4.5.0.0";
5758 outputs = [ "out" "dev" ];
59···61 owner = "EttusResearch";
62 repo = "uhd";
63 rev = "v${finalAttrs.version}";
64+ # The updateScript relies on the `src` using `hash`, and not `sha256. To
65+ # update the correct hash for the `src` vs the `uhdImagesSrc`
66+ hash = "sha256-0EqMBaQiNr8PE542YNkPvX3o1HhnhrO0Kz1euphY6Ps=";
67 };
68 # Firmware images are downloaded (pre-built) from the respective release on Github
69 uhdImagesSrc = fetchurl {
70 url = "https://github.com/EttusResearch/uhd/releases/download/v${finalAttrs.version}/uhd-images_${finalAttrs.version}.tar.xz";
71+ # Please don't convert this to a hash, in base64, see comment near src's
72+ # hash.
73+ sha256 = "13cn41wv7vldk4vx7vy3jbb3wb3a5vpfg3ay893klpi6vzxc1dly";
74 };
75+ passthru = {
76+ updateScript = [
77+ ./update.sh
78+ # Pass it this file name as argument
79+ (builtins.unsafeGetAttrPos "pname" finalAttrs.finalPackage).file
80+ ];
81+ };
8283 cmakeFlags = [
84 "-DENABLE_LIBUHD=ON"
+27
pkgs/applications/radio/uhd/update.sh
···000000000000000000000000000
···1+#!/usr/bin/env nix-shell
2+#!nix-shell -i bash -p jq nix nix-prefetch-github
3+4+set -euo pipefail
5+echoerr() { echo "$@" 1>&2; }
6+7+fname="$1"
8+echoerr got fname $fname
9+shift
10+latest_release=$(curl --silent https://api.github.com/repos/EttusResearch/uhd/releases/latest)
11+version=$(jq -r '.tag_name' <<<"$latest_release" | cut -c2-)
12+# Update version, if needed
13+if grep -q 'version = "'$version $fname; then
14+ echoerr Current version $version is the latest available
15+ exit 0;
16+fi
17+echoerr got version $version
18+sed -i -E 's/(version = ").*(";)/\1'$version'\2/g' $fname
19+# Verify the sed command above did not fail
20+grep -q $version $fname
21+# Update srcHash
22+srcHash="$(nix-prefetch-github EttusResearch uhd --rev v${version} | jq --raw-output .hash)"
23+sed -i -E 's#(hash = ").*(";)#\1'$srcHash'\2#g' $fname
24+grep -q $srcHash $fname
25+imageHash="$(nix-prefetch-url https://github.com/EttusResearch/uhd/releases/download/v${version}/uhd-images_${version}.tar.xz)"
26+sed -i -E 's#(sha256 = ").*(";)#\1'$imageHash'\2#g' $fname
27+grep -q $imageHash $fname
···25, systemdMinimal
26, elogind
27, buildPackages
28-, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages
29# A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault).
30# Not yet investigated; it may be due to the "Make netgroup support optional"
31# patch not updating the tests correctly yet, or doing something wrong,
···25, systemdMinimal
26, elogind
27, buildPackages
28+, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
29# A few tests currently fail on musl (polkitunixusertest, polkitunixgrouptest, polkitidentitytest segfault).
30# Not yet investigated; it may be due to the "Make netgroup support optional"
31# patch not updating the tests correctly yet, or doing something wrong,
···1-From 4e8c14f1af9c332826e0454f4fd63e541edbaf5c Mon Sep 17 00:00:00 2001
2From: Nick Cao <nickcao@nichi.co>
3Date: Tue, 21 Mar 2023 15:48:49 +0800
4-Subject: [PATCH 5/6] qtbase: deal with a font face at index 0 as Regular for
5 Variable fonts
67Reference: https://bugreports.qt.io/browse/QTBUG-111994
···22 FcObjectSetDestroy(os);
23 FcPatternDestroy(pattern);
24--
25-2.39.2
26
···1+From 880fe5653a86d8091f3f577977f8af93552c48fd Mon Sep 17 00:00:00 2001
2From: Nick Cao <nickcao@nichi.co>
3Date: Tue, 21 Mar 2023 15:48:49 +0800
4+Subject: [PATCH 05/11] qtbase: deal with a font face at index 0 as Regular for
5 Variable fonts
67Reference: https://bugreports.qt.io/browse/QTBUG-111994
···22 FcObjectSetDestroy(os);
23 FcPatternDestroy(pattern);
24--
25+2.42.0
26
···1-From 61ae6e04388dd40e11c214d56f22f8f2007bf35f Mon Sep 17 00:00:00 2001
2From: Nick Cao <nickcao@nichi.co>
3Date: Wed, 12 Apr 2023 10:13:50 +0800
4-Subject: [PATCH 6/6] qtbase: qt-cmake: always use cmake from path
56The generated qt-cmake scripts embeds the absolute path of cmake used
7during the build of qtbase, bloating the runtime closure of qtbase.
···28 toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"
2930--
31-2.39.2
32
···1+From 7f573f00fb850a08017d9f1e3c73b4d7efeb84f2 Mon Sep 17 00:00:00 2001
2From: Nick Cao <nickcao@nichi.co>
3Date: Wed, 12 Apr 2023 10:13:50 +0800
4+Subject: [PATCH 06/11] qtbase: qt-cmake: always use cmake from path
56The generated qt-cmake scripts embeds the absolute path of cmake used
7during the build of qtbase, bloating the runtime closure of qtbase.
···28 toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake"
2930--
31+2.42.0
32
···1-From 31d808a7b0d52a01c3f2875202cd29410a94b39a Mon Sep 17 00:00:00 2001
2From: rewine <luhongxu@deepin.org>
3Date: Wed, 29 Mar 2023 11:51:33 +0800
4-Subject: [PATCH] qtbase-find-tools-in-PATH
561. find qt's tools in `QTTOOLSPATH` env
7 qt assumes that all components use the same install prefix
···14 We can guarantee the build order of qt components in nixpkgs
15 tools in qttools always build before qtdoc
16 qdoc_bin is not a build target now, since we find it in `QTTOOLSPATH`
17-18---
19 cmake/QtDocsHelpers.cmake | 11 ++++++++---
20 1 file changed, 8 insertions(+), 3 deletions(-)
2122diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake
23-index 48ed5a32..9409d22d 100644
24--- a/cmake/QtDocsHelpers.cmake
25+++ b/cmake/QtDocsHelpers.cmake
26@@ -47,9 +47,14 @@ function(qt_internal_add_docs)
···42 get_target_property(target_type ${target} TYPE)
43 if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
44--
45-2.38.1
46
···1+From 95b6bc2a414d381fdeab0899a3b02499c43695e7 Mon Sep 17 00:00:00 2001
2From: rewine <luhongxu@deepin.org>
3Date: Wed, 29 Mar 2023 11:51:33 +0800
4+Subject: [PATCH 07/11] qtbase-find-tools-in-PATH
561. find qt's tools in `QTTOOLSPATH` env
7 qt assumes that all components use the same install prefix
···14 We can guarantee the build order of qt components in nixpkgs
15 tools in qttools always build before qtdoc
16 qdoc_bin is not a build target now, since we find it in `QTTOOLSPATH`
017---
18 cmake/QtDocsHelpers.cmake | 11 ++++++++---
19 1 file changed, 8 insertions(+), 3 deletions(-)
2021diff --git a/cmake/QtDocsHelpers.cmake b/cmake/QtDocsHelpers.cmake
22+index 48ed5a324bf..91d8d41fb1f 100644
23--- a/cmake/QtDocsHelpers.cmake
24+++ b/cmake/QtDocsHelpers.cmake
25@@ -47,9 +47,14 @@ function(qt_internal_add_docs)
···41 get_target_property(target_type ${target} TYPE)
42 if (NOT target_type STREQUAL "INTERFACE_LIBRARY")
43--
44+2.42.0
45
···1-From 505391a31aa353b8f1cc5d3feb9861582554d9f1 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
3Date: Wed, 9 Aug 2023 16:16:21 +0200
4-Subject: [PATCH 1/3] Find qmlimportscanner in macdeployqt via environment
056The qmlimportscanner tool is provided by qtdeclarative. Because of the
7modularized installation in Nix, it can not be found via the usual
···16 1 file changed, 4 insertions(+)
1718diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
19-index 643fe5390a..b8fcc9c9bd 100644
20--- a/src/tools/macdeployqt/shared/shared.cpp
21+++ b/src/tools/macdeployqt/shared/shared.cpp
22-@@ -1270,6 +1270,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
23 if (!QFile::exists(qmlImportScannerPath))
24 qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
25···31 if (!QFile::exists(qmlImportScannerPath)) {
32 LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
33--
34-2.26.2
35
···1+From bbd9cf61b686f68d5e5eb78fb0b96a74a8921cef Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
3Date: Wed, 9 Aug 2023 16:16:21 +0200
4+Subject: [PATCH 10/11] qtbase: find qmlimportscanner in macdeployqt via
5+ environment
67The qmlimportscanner tool is provided by qtdeclarative. Because of the
8modularized installation in Nix, it can not be found via the usual
···17 1 file changed, 4 insertions(+)
1819diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
20+index 77749506ccb..48979195f40 100644
21--- a/src/tools/macdeployqt/shared/shared.cpp
22+++ b/src/tools/macdeployqt/shared/shared.cpp
23+@@ -1273,6 +1273,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
24 if (!QFile::exists(qmlImportScannerPath))
25 qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner";
26···32 if (!QFile::exists(qmlImportScannerPath)) {
33 LogError() << "qmlimportscanner not found at" << qmlImportScannerPath;
34--
35+2.42.0
36
···1-From 32df59bea18bebc18d6d308750e88be325522d2e Mon Sep 17 00:00:00 2001
2-From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
3-Date: Thu, 10 Aug 2023 14:15:34 +0200
4-Subject: [PATCH 2/3] Check in the QML folder of this library does actually
5- exist
67In a modularized installation, this folder will be the location where
8`qtbase` itself is installed, but `qtbase` does not have any QML
···12 1 file changed, 5 insertions(+), 2 deletions(-)
1314diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
15-index b8fcc9c9bd..676d34d545 100644
16--- a/src/tools/macdeployqt/shared/shared.cpp
17+++ b/src/tools/macdeployqt/shared/shared.cpp
18-@@ -1290,9 +1290,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
19 }
20 for (const QString &importPath : qmlImportPaths)
21 argumentList << "-importPath" << importPath;
···28+ argumentList.append(qmlImportsPath);
29+ }
3031- // run qmlimportscanner
32- QProcess qmlImportScanner;
33--
34-2.26.2
35
···1+From 617d27ee91aaa59c59c4f3a2cca7bab8167d9f5f Mon Sep 17 00:00:00 2001
2+From: Nick Cao <nickcao@nichi.co>
3+Date: Tue, 10 Oct 2023 10:17:00 -0400
4+Subject: [PATCH 11/11] qtbase: check in the QML folder of this library does
5+ actually exist
67In a modularized installation, this folder will be the location where
8`qtbase` itself is installed, but `qtbase` does not have any QML
···12 1 file changed, 5 insertions(+), 2 deletions(-)
1314diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
15+index 48979195f40..8415680ecda 100644
16--- a/src/tools/macdeployqt/shared/shared.cpp
17+++ b/src/tools/macdeployqt/shared/shared.cpp
18+@@ -1293,9 +1293,12 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
19 }
20 for (const QString &importPath : qmlImportPaths)
21 argumentList << "-importPath" << importPath;
···28+ argumentList.append(qmlImportsPath);
29+ }
3031+ // In a modularized installation of qt as we have in Nix, instead, we will
32+ // read the paths from the environment, as they are spread in multiple
33--
34+2.42.0
35
···1-From 39eb99dcd66f8ffb632fed6308a49896fe5ad2d3 Mon Sep 17 00:00:00 2001
2-From: =?UTF-8?q?Juan=20Pedro=20Bol=C3=ADvar=20Puente?= <raskolnikov@gnu.org>
3-Date: Thu, 10 Aug 2023 14:17:03 +0200
4-Subject: [PATCH 3/3] Pass to qmlimportscanner the QML2_IMPORT_PATH
56---
7 src/tools/macdeployqt/shared/shared.cpp | 7 +++++++
8 1 file changed, 7 insertions(+)
910diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
11-index 676d34d545..7908b07b3c 100644
12--- a/src/tools/macdeployqt/shared/shared.cpp
13+++ b/src/tools/macdeployqt/shared/shared.cpp
14-@@ -1297,6 +1297,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
15- argumentList.append(qmlImportsPath);
16- }
1718+ // In a modularized installation of qt as we have in Nix, instead, we will
19+ // read the paths from the environment, as they are spread in multiple
···26 QProcess qmlImportScanner;
27 qmlImportScanner.start(qmlImportScannerPath, argumentList);
28--
29-2.26.2
30
···1+From a5cbfb30fc53b3290578af4a87fe4c0463df4247 Mon Sep 17 00:00:00 2001
2+From: Nick Cao <nickcao@nichi.co>
3+Date: Tue, 10 Oct 2023 10:12:56 -0400
4+Subject: [PATCH 08/11] qtbase: pass to qmlimportscanner the QML2_IMPORT_PATH
56---
7 src/tools/macdeployqt/shared/shared.cpp | 7 +++++++
8 1 file changed, 7 insertions(+)
910diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp
11+index f637416cf22..77749506ccb 100644
12--- a/src/tools/macdeployqt/shared/shared.cpp
13+++ b/src/tools/macdeployqt/shared/shared.cpp
14+@@ -1293,6 +1293,13 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf
15+ argumentList.append( "-importPath");
16+ argumentList.append(qmlImportsPath);
1718+ // In a modularized installation of qt as we have in Nix, instead, we will
19+ // read the paths from the environment, as they are spread in multiple
···26 QProcess qmlImportScanner;
27 qmlImportScanner.start(qmlImportScannerPath, argumentList);
28--
29+2.42.0
30
···12 sed -i 's,set --, set -x; set --,' Makefile
13 '';
14 pname = "tinycdb";
15- version = "0.78";
16 # In general, static library (.a) goes to "dev", shared (.so) to
17 # "lib". In case of static build, there is no .so library, so "lib"
18 # output is useless and empty.
···3536 src = fetchurl {
37 url = "http://www.corpit.ru/mjt/tinycdb/${pname}-${version}.tar.gz";
38- sha256 = "0g6n1rr3lvyqc85g6z44lw9ih58f2k1i3v18yxlqvnla5m1qyrsh";
39 };
4041 meta = with lib; {
···12 sed -i 's,set --, set -x; set --,' Makefile
13 '';
14 pname = "tinycdb";
15+ version = "0.80";
16 # In general, static library (.a) goes to "dev", shared (.so) to
17 # "lib". In case of static build, there is no .so library, so "lib"
18 # output is useless and empty.
···3536 src = fetchurl {
37 url = "http://www.corpit.ru/mjt/tinycdb/${pname}-${version}.tar.gz";
38+ sha256 = "sha256-wyG5BekCwsqZo/+Kjd39iCMkf+Ht7IpLuF+Dhpxjn7g=";
39 };
4041 meta = with lib; {
···32 description = "A set of cli tools for the conventional commit and semver specifications";
33 homepage = "https://github.com/oknozor/cocogitto";
34 license = licenses.mit;
35- maintainers = with maintainers; [ travisdavis-ops ];
36 };
37}
···32 description = "A set of cli tools for the conventional commit and semver specifications";
33 homepage = "https://github.com/oknozor/cocogitto";
34 license = licenses.mit;
35+ maintainers = with maintainers; [ ];
36 };
37}
···9, testers
10, mold
11, nix-update-script
0000012}:
1314stdenv.mkDerivation rec {
···4445 passthru = {
46 updateScript = nix-update-script { };
47- tests.version = testers.testVersion { package = mold; };
000000000000000000000000000000000000000048 };
4950 meta = with lib; {
51- description = "A faster drop-in replacement for existing Unix linkers";
52 longDescription = ''
53 mold is a faster drop-in replacement for existing Unix linkers. It is
54 several times faster than the LLVM lld linker. mold is designed to
···9, testers
10, mold
11, nix-update-script
12+, runCommandCC
13+, mold-wrapped
14+, hello
15+, buildPackages
16+, useMoldLinker
17}:
1819stdenv.mkDerivation rec {
···4950 passthru = {
51 updateScript = nix-update-script { };
52+ tests =
53+ let
54+ helloTest = name: helloMold:
55+ let
56+ command = "$READELF -p .comment ${lib.getExe helloMold}";
57+ emulator = stdenv.hostPlatform.emulator buildPackages;
58+ in
59+ runCommandCC "mold-${name}-test" { passthru = { inherit helloMold; }; }
60+ ''
61+ echo "Testing running the 'hello' binary which should be linked with 'mold'" >&2
62+ ${emulator} ${lib.getExe helloMold}
63+64+ echo "Checking for mold in the '.comment' section" >&2
65+ if output=$(${command} 2>&1); then
66+ if grep -Fw -- "mold" - <<< "$output"; then
67+ touch $out
68+ else
69+ echo "No mention of 'mold' detected in the '.comment' section" >&2
70+ echo "The command was:" >&2
71+ echo "${command}" >&2
72+ echo "The output was:" >&2
73+ echo "$output" >&2
74+ exit 1
75+ fi
76+ else
77+ echo -n "${command}" >&2
78+ echo " returned a non-zero exit code." >&2
79+ echo "$output" >&2
80+ exit 1
81+ fi
82+ ''
83+ ;
84+ in
85+ {
86+ version = testers.testVersion { package = mold; };
87+ wrapped = helloTest "wrapped" (hello.overrideAttrs (previousAttrs: {
88+ nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [ mold-wrapped ];
89+ NIX_CFLAGS_LINK = toString (previousAttrs.NIX_CFLAGS_LINK or "") + " -fuse-ld=mold";
90+ }));
91+ adapter = helloTest "adapter" (hello.override (old: { stdenv = useMoldLinker old.stdenv; }));
92+ };
93 };
9495 meta = with lib; {
96+ description = "A faster drop-in replacement for existing Unix linkers (unwrapped)";
97 longDescription = ''
98 mold is a faster drop-in replacement for existing Unix linkers. It is
99 several times faster than the LLVM lld linker. mold is designed to
···42 sha256 = "sha256-RArg60S91YKp1Mt97a5JNfBEOf2cmuX4pK3VAx2WfqM=";
43 };
4445- patches = lib.optionals stdenv.isDarwin [
0046 # https://github.com/PrismLauncher/PrismLauncher/pull/1452
47 # These patches allow us to disable the Sparkle updater and cmake bundling
48 # TODO: remove these when updating to 8.0
···42 sha256 = "sha256-RArg60S91YKp1Mt97a5JNfBEOf2cmuX4pK3VAx2WfqM=";
43 };
4445+ patches = [
46+ ./0001-launcher-translations-explicitly-convert-QVector-ite.patch
47+ ] ++ lib.optionals stdenv.isDarwin [
48 # https://github.com/PrismLauncher/PrismLauncher/pull/1452
49 # These patches allow us to disable the Sparkle updater and cmake bundling
50 # TODO: remove these when updating to 8.0
···11- Command line: `nixpkgs-check-by-name <NIXPKGS>`
12- Arguments:
13 - `<NIXPKGS>`: The path to the Nixpkgs to check
000000014- Exit code:
15 - `0`: If the [validation](#validity-checks) is successful
16 - `1`: If the [validation](#validity-checks) is not successful
···3536### Nix evaluation checks
37- `pkgs.${name}` is defined as `callPackage pkgs/by-name/${shard}/${name}/package.nix args` for some `args`.
038- `pkgs.lib.isDerivation pkgs.${name}` is `true`.
3940## Development
···11- Command line: `nixpkgs-check-by-name <NIXPKGS>`
12- Arguments:
13 - `<NIXPKGS>`: The path to the Nixpkgs to check
14+ - `--version <VERSION>`: The version of the checks to perform.
15+16+ Possible values:
17+ - `v0` (default)
18+ - `v1`
19+20+ See [validation](#validity-checks) for the differences.
21- Exit code:
22 - `0`: If the [validation](#validity-checks) is successful
23 - `1`: If the [validation](#validity-checks) is not successful
···4243### Nix evaluation checks
44- `pkgs.${name}` is defined as `callPackage pkgs/by-name/${shard}/${name}/package.nix args` for some `args`.
45+ - **Only after --version v1**: If `pkgs.${name}` is not auto-called from `pkgs/by-name`, `args` must not be empty
46- `pkgs.lib.isDerivation pkgs.${name}` is `true`.
4748## Development
+35-12
pkgs/test/nixpkgs-check-by-name/src/eval.nix
···18 callPackage = fn: args:
19 let
20 result = super.callPackage fn args;
000000000021 in
22 if builtins.isAttrs result then
23 # If this was the last overlay to be applied, we could just only return the `_callPackagePath`,
24 # but that's not the case because stdenv has another overlays on top of user-provided ones.
25 # So to not break the stdenv build we need to return the mostly proper result here
26- result // {
27- _callPackagePath = fn;
28- }
29 else
30 # It's very rare that callPackage doesn't return an attribute set, but it can occur.
31- {
32- _callPackagePath = fn;
00000033 };
00000000034 };
3536 pkgs = import nixpkgsPath {
···39 overlays = [ callPackageOverlay ];
40 };
4142- attrInfo = attr: {
000043 # These names are used by the deserializer on the Rust side
44- call_package_path =
45- if pkgs.${attr} ? _callPackagePath && builtins.isPath pkgs.${attr}._callPackagePath then
46- toString pkgs.${attr}._callPackagePath
47- else
48- null;
49- is_derivation = pkgs.lib.isDerivation pkgs.${attr};
50 };
5152 attrInfos = builtins.listToAttrs (map (name: {
···18 callPackage = fn: args:
19 let
20 result = super.callPackage fn args;
21+ variantInfo._attributeVariant = {
22+ # These names are used by the deserializer on the Rust side
23+ CallPackage.path =
24+ if builtins.isPath fn then
25+ toString fn
26+ else
27+ null;
28+ CallPackage.empty_arg =
29+ args == { };
30+ };
31 in
32 if builtins.isAttrs result then
33 # If this was the last overlay to be applied, we could just only return the `_callPackagePath`,
34 # but that's not the case because stdenv has another overlays on top of user-provided ones.
35 # So to not break the stdenv build we need to return the mostly proper result here
36+ result // variantInfo
0037 else
38 # It's very rare that callPackage doesn't return an attribute set, but it can occur.
39+ variantInfo;
40+41+ _internalCallByNamePackageFile = file:
42+ let
43+ result = super._internalCallByNamePackageFile file;
44+ variantInfo._attributeVariant = {
45+ # This name is used by the deserializer on the Rust side
46+ AutoCalled = null;
47 };
48+ in
49+ if builtins.isAttrs result then
50+ # If this was the last overlay to be applied, we could just only return the `_callPackagePath`,
51+ # but that's not the case because stdenv has another overlays on top of user-provided ones.
52+ # So to not break the stdenv build we need to return the mostly proper result here
53+ result // variantInfo
54+ else
55+ # It's very rare that callPackage doesn't return an attribute set, but it can occur.
56+ variantInfo;
57 };
5859 pkgs = import nixpkgsPath {
···62 overlays = [ callPackageOverlay ];
63 };
6465+ attrInfo = attr:
66+ let
67+ value = pkgs.${attr};
68+ in
69+ {
70 # These names are used by the deserializer on the Rust side
71+ variant = value._attributeVariant or { Other = null; };
72+ is_derivation = pkgs.lib.isDerivation value;
000073 };
7475 attrInfos = builtins.listToAttrs (map (name: {
+41-9
pkgs/test/nixpkgs-check-by-name/src/eval.rs
···1use crate::structure;
2use crate::utils::ErrorWriter;
03use std::path::Path;
45use anyhow::Context;
···13/// Attribute set of this structure is returned by eval.nix
14#[derive(Deserialize)]
15struct AttributeInfo {
16- call_package_path: Option<PathBuf>,
17 is_derivation: bool,
18}
190000000000000000020const EXPR: &str = include_str!("eval.nix");
2122/// Check that the Nixpkgs attribute values corresponding to the packages in pkgs/by-name are
23/// of the form `callPackage <package_file> { ... }`.
24/// See the `eval.nix` file for how this is achieved on the Nix side
25pub fn check_values<W: io::Write>(
026 error_writer: &mut ErrorWriter<W>,
27 nixpkgs: &structure::Nixpkgs,
28 eval_accessible_paths: Vec<&Path>,
···97 let absolute_package_file = nixpkgs.path.join(&relative_package_file);
9899 if let Some(attribute_info) = actual_files.get(package_name) {
100- let is_expected_file =
101- if let Some(call_package_path) = &attribute_info.call_package_path {
102- absolute_package_file == *call_package_path
103- } else {
104- false
105- };
0000000000000106107- if !is_expected_file {
108 error_writer.write(&format!(
109- "pkgs.{package_name}: This attribute is not defined as `pkgs.callPackage {} {{ ... }}`.",
110 relative_package_file.display()
111 ))?;
112 continue;
···1use crate::structure;
2use crate::utils::ErrorWriter;
3+use crate::Version;
4use std::path::Path;
56use anyhow::Context;
···14/// Attribute set of this structure is returned by eval.nix
15#[derive(Deserialize)]
16struct AttributeInfo {
17+ variant: AttributeVariant,
18 is_derivation: bool,
19}
2021+#[derive(Deserialize)]
22+enum AttributeVariant {
23+ /// The attribute is auto-called as pkgs.callPackage using pkgs/by-name,
24+ /// and it is not overridden by a definition in all-packages.nix
25+ AutoCalled,
26+ /// The attribute is defined as a pkgs.callPackage <path> <args>,
27+ /// and overridden by all-packages.nix
28+ CallPackage {
29+ /// The <path> argument or None if it's not a path
30+ path: Option<PathBuf>,
31+ /// true if <args> is { }
32+ empty_arg: bool,
33+ },
34+ /// The attribute is not defined as pkgs.callPackage
35+ Other,
36+}
37+38const EXPR: &str = include_str!("eval.nix");
3940/// Check that the Nixpkgs attribute values corresponding to the packages in pkgs/by-name are
41/// of the form `callPackage <package_file> { ... }`.
42/// See the `eval.nix` file for how this is achieved on the Nix side
43pub fn check_values<W: io::Write>(
44+ version: Version,
45 error_writer: &mut ErrorWriter<W>,
46 nixpkgs: &structure::Nixpkgs,
47 eval_accessible_paths: Vec<&Path>,
···116 let absolute_package_file = nixpkgs.path.join(&relative_package_file);
117118 if let Some(attribute_info) = actual_files.get(package_name) {
119+ let valid = match &attribute_info.variant {
120+ AttributeVariant::AutoCalled => true,
121+ AttributeVariant::CallPackage { path, empty_arg } => {
122+ let correct_file = if let Some(call_package_path) = path {
123+ absolute_package_file == *call_package_path
124+ } else {
125+ false
126+ };
127+ // Only check for the argument to be non-empty if the version is V1 or
128+ // higher
129+ let non_empty = if version >= Version::V1 {
130+ !empty_arg
131+ } else {
132+ true
133+ };
134+ correct_file && non_empty
135+ }
136+ AttributeVariant::Other => false,
137+ };
138139+ if !valid {
140 error_writer.write(&format!(
141+ "pkgs.{package_name}: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage {} {{ ... }}` with a non-empty second argument.",
142 relative_package_file.display()
143 ))?;
144 continue;
+21-5
pkgs/test/nixpkgs-check-by-name/src/main.rs
···4mod utils;
56use anyhow::Context;
7-use clap::Parser;
8use colored::Colorize;
9use std::io;
10use std::path::{Path, PathBuf};
···15/// Program to check the validity of pkgs/by-name
16#[derive(Parser, Debug)]
17#[command(about)]
18-struct Args {
19 /// Path to nixpkgs
20 nixpkgs: PathBuf,
0000000000000021}
2223fn main() -> ExitCode {
24 let args = Args::parse();
25- match check_nixpkgs(&args.nixpkgs, vec![], &mut io::stderr()) {
26 Ok(true) => {
27 eprintln!("{}", "Validated successfully".green());
28 ExitCode::SUCCESS
···53/// - `Ok(true)` if the structure is valid, nothing will have been written to `error_writer`.
54pub fn check_nixpkgs<W: io::Write>(
55 nixpkgs_path: &Path,
056 eval_accessible_paths: Vec<&Path>,
57 error_writer: &mut W,
58) -> anyhow::Result<bool> {
···7576 if error_writer.empty {
77 // Only if we could successfully parse the structure, we do the semantic checks
78- eval::check_values(&mut error_writer, &nixpkgs, eval_accessible_paths)?;
79 references::check_references(&mut error_writer, &nixpkgs)?;
80 }
81 }
···86mod tests {
87 use crate::check_nixpkgs;
88 use crate::structure;
089 use anyhow::Context;
90 use std::fs;
91 use std::path::Path;
···174 // We don't want coloring to mess up the tests
175 let writer = temp_env::with_var("NO_COLOR", Some("1"), || -> anyhow::Result<_> {
176 let mut writer = vec![];
177- check_nixpkgs(&path, vec![&extra_nix_path], &mut writer)
178 .context(format!("Failed test case {name}"))?;
179 Ok(writer)
180 })?;
···4mod utils;
56use anyhow::Context;
7+use clap::{Parser, ValueEnum};
8use colored::Colorize;
9use std::io;
10use std::path::{Path, PathBuf};
···15/// Program to check the validity of pkgs/by-name
16#[derive(Parser, Debug)]
17#[command(about)]
18+pub struct Args {
19 /// Path to nixpkgs
20 nixpkgs: PathBuf,
21+ /// The version of the checks
22+ /// Increasing this may cause failures for a Nixpkgs that succeeded before
23+ /// TODO: Remove default once Nixpkgs CI passes this argument
24+ #[arg(long, value_enum, default_value_t = Version::V0)]
25+ version: Version,
26+}
27+28+/// The version of the checks
29+#[derive(Debug, Clone, PartialEq, PartialOrd, ValueEnum)]
30+pub enum Version {
31+ /// Initial version
32+ V0,
33+ /// Empty argument check
34+ V1,
35}
3637fn main() -> ExitCode {
38 let args = Args::parse();
39+ match check_nixpkgs(&args.nixpkgs, args.version, vec![], &mut io::stderr()) {
40 Ok(true) => {
41 eprintln!("{}", "Validated successfully".green());
42 ExitCode::SUCCESS
···67/// - `Ok(true)` if the structure is valid, nothing will have been written to `error_writer`.
68pub fn check_nixpkgs<W: io::Write>(
69 nixpkgs_path: &Path,
70+ version: Version,
71 eval_accessible_paths: Vec<&Path>,
72 error_writer: &mut W,
73) -> anyhow::Result<bool> {
···9091 if error_writer.empty {
92 // Only if we could successfully parse the structure, we do the semantic checks
93+ eval::check_values(version, &mut error_writer, &nixpkgs, eval_accessible_paths)?;
94 references::check_references(&mut error_writer, &nixpkgs)?;
95 }
96 }
···101mod tests {
102 use crate::check_nixpkgs;
103 use crate::structure;
104+ use crate::Version;
105 use anyhow::Context;
106 use std::fs;
107 use std::path::Path;
···190 // We don't want coloring to mess up the tests
191 let writer = temp_env::with_var("NO_COLOR", Some("1"), || -> anyhow::Result<_> {
192 let mut writer = vec![];
193+ check_nixpkgs(&path, Version::V1, vec![&extra_nix_path], &mut writer)
194 .context(format!("Failed test case {name}"))?;
195 Ok(writer)
196 })?;
···7576 # Turns autoCalledPackageFiles into an overlay that `callPackage`'s all of them
77 autoCalledPackages = self: super:
78- builtins.mapAttrs (name: file:
79- self.callPackage file { }
80- ) autoCalledPackageFiles;
000008182 # A list optionally containing the `all-packages.nix` file from the test case as an overlay
83 optionalAllPackagesOverlay =
···7576 # Turns autoCalledPackageFiles into an overlay that `callPackage`'s all of them
77 autoCalledPackages = self: super:
78+ {
79+ # Needed to be able to detect empty arguments in all-packages.nix
80+ # See a more detailed description in pkgs/top-level/by-name-overlay.nix
81+ _internalCallByNamePackageFile = file: self.callPackage file { };
82+ }
83+ // builtins.mapAttrs
84+ (name: self._internalCallByNamePackageFile)
85+ autoCalledPackageFiles;
8687 # A list optionally containing the `all-packages.nix` file from the test case as an overlay
88 optionalAllPackagesOverlay =
···1-pkgs.nonDerivation: This attribute is not defined as `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }`.
···1+pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument.
···1+pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument.
···1-pkgs.nonDerivation: This attribute is not defined as `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }`.
···1+pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument.
···1-pkgs.nonDerivation: This attribute is not defined as `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }`.
···1+pkgs.nonDerivation: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/nonDerivation/package.nix { ... }` with a non-empty second argument.
···45stdenv.mkDerivation rec {
6 pname = "argyllcms";
7- version = "2.3.1";
89 src = fetchzip {
10 # Kind of flacky URL, it was reaturning 406 and inconsistent binaries for a
11 # while on me. It might be good to find a mirror
12 url = "https://www.argyllcms.com/Argyll_V${version}_src.zip";
13- sha256 = "sha256-XWsubjdD1tg0o7x/aoAalemAChehWkwh4fkP2WRvhAw=";
14 };
1516 nativeBuildInputs = [ jam unzip ];
···45stdenv.mkDerivation rec {
6 pname = "argyllcms";
7+ version = "3.0.0";
89 src = fetchzip {
10 # Kind of flacky URL, it was reaturning 406 and inconsistent binaries for a
11 # while on me. It might be good to find a mirror
12 url = "https://www.argyllcms.com/Argyll_V${version}_src.zip";
13+ sha256 = "sha256-nX7YwsbWqaHav22S91ZkfAXXxuFYANhAv5hTO696Dt0=";
14 };
1516 nativeBuildInputs = [ jam unzip ];
···26 description = "An overlay that shows schemas for all workspaces to make navigation in sway easier.";
27 homepage = "https://github.com/milgra/sov";
28 license = with licenses; [ mit ];
29- maintainers = with maintainers; [ travisdavis-ops ];
30 platforms = platforms.linux;
31 };
32}
···26 description = "An overlay that shows schemas for all workspaces to make navigation in sway easier.";
27 homepage = "https://github.com/milgra/sov";
28 license = with licenses; [ mit ];
29+ maintainers = with maintainers; [ ];
30 platforms = platforms.linux;
31 };
32}
+1
pkgs/top-level/aliases.nix
···56 ### A ###
5758 a4term = a4; # Added 2023-10-06
059 airfield = throw "airfield has been removed due to being unmaintained"; # Added 2023-05-19
60 alertmanager-bot = throw "alertmanager-bot is broken and has been archived by upstream" ; # Added 2023-07-28
61 alsaLib = alsa-lib; # Added 2021-06-09
···56 ### A ###
5758 a4term = a4; # Added 2023-10-06
59+ aether = throw "aether has been removed from nixpkgs; upstream unmaintained, security issues"; # Added 2023-10-03
60 airfield = throw "airfield has been removed due to being unmaintained"; # Added 2023-05-19
61 alertmanager-bot = throw "alertmanager-bot is broken and has been archived by upstream" ; # Added 2023-07-28
62 alsaLib = alsa-lib; # Added 2021-06-09
···45# Currently this would be hard to measure until we have more packages
46# and ideally https://github.com/NixOS/nix/pull/8895
47self: super:
48-mapAttrs (name: file:
49- self.callPackage file { }
50-) packageFiles
000000000
···45# Currently this would be hard to measure until we have more packages
46# and ideally https://github.com/NixOS/nix/pull/8895
47self: super:
48+{
49+ # This attribute is necessary to allow CI to ensure that all packages defined in `pkgs/by-name`
50+ # don't have an overriding definition in `all-packages.nix` with an empty (`{ }`) second `callPackage` argument.
51+ # It achieves that with an overlay that modifies both `callPackage` and this attribute to signal whether `callPackage` is used
52+ # and whether it's defined by this file here or `all-packages.nix`.
53+ # TODO: This can be removed once `pkgs/by-name` can handle custom `callPackage` arguments without `all-packages.nix` (or any other way of achieving the same result).
54+ # Because at that point the code in ./stage.nix can be changed to not allow definitions in `all-packages.nix` to override ones from `pkgs/by-name` anymore and throw an error if that happens instead.
55+ _internalCallByNamePackageFile = file: self.callPackage file { };
56+}
57+// mapAttrs
58+ (name: self._internalCallByNamePackageFile)
59+ packageFiles
+1
pkgs/top-level/python-aliases.nix
···186 imgaug = throw "imgaug has been removed as it is no longer maintained"; # added 2023-07-10
187 intreehook = throw "intreehooks has been removed because it is obsolete as a backend-path key was added to PEP 517"; # added 2023-04-11
188 ipaddress = throw "ipaddress has been removed because it is no longer required since python 2.7."; # added 2022-05-30
0189 influxgraph = throw "influxgraph has been removed because it is no longer maintained"; # added 2022-07-10
190 itanium_demangler = itanium-demangler; # added 2022-10-17
191 jaraco_classes = jaraco-classes; # added 2023-07-14
···186 imgaug = throw "imgaug has been removed as it is no longer maintained"; # added 2023-07-10
187 intreehook = throw "intreehooks has been removed because it is obsolete as a backend-path key was added to PEP 517"; # added 2023-04-11
188 ipaddress = throw "ipaddress has been removed because it is no longer required since python 2.7."; # added 2022-05-30
189+ ipython_genutils = ipython-genutils; # added 2023-10-12
190 influxgraph = throw "influxgraph has been removed because it is no longer maintained"; # added 2022-07-10
191 itanium_demangler = itanium-demangler; # added 2022-10-17
192 jaraco_classes = jaraco-classes; # added 2023-07-14