From c7fc4e04aaf142a728cd2b69eb18fc5ae03610c5 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 13 Oct 2023 15:17:39 +0200 Subject: [PATCH 01/39] {libsForQt5.qzxing,qt6Packages.qzxing}: init at 3.3.0 --- pkgs/development/libraries/qzxing/default.nix | 59 +++++++++++++++++++ pkgs/top-level/qt5-packages.nix | 2 + pkgs/top-level/qt6-packages.nix | 2 + 3 files changed, 63 insertions(+) create mode 100644 pkgs/development/libraries/qzxing/default.nix diff --git a/pkgs/development/libraries/qzxing/default.nix b/pkgs/development/libraries/qzxing/default.nix new file mode 100644 index 000000000000..4cb224e2c040 --- /dev/null +++ b/pkgs/development/libraries/qzxing/default.nix @@ -0,0 +1,59 @@ +{ stdenv +, lib +, fetchFromGitHub +, nix-update-script +, testers +, qmake +, qtmultimedia +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "qzxing"; + version = "3.3.0"; + + src = fetchFromGitHub { + owner = "ftylitak"; + repo = "qzxing"; + rev = "v${finalAttrs.version}"; + hash = "sha256-ASgsF5ocNWAiIy2jm6ygpDkggBcEpno6iVNWYkuWcVI="; + }; + + # QMake can't find qtmultimedia in buildInputs + strictDeps = false; + + nativeBuildInputs = [ + qmake + ]; + + buildInputs = [ + qtmultimedia + ]; + + dontWrapQtApps = true; + + preConfigure = '' + cd src + ''; + + qmakeFlags = [ + "CONFIG+=qzxing_qml" + "CONFIG+=qzxing_multimedia" + "QMAKE_PKGCONFIG_PREFIX=${placeholder "out"}" + ]; + + passthru = { + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + updateScript = nix-update-script { }; + }; + + meta = with lib; { + description = "Qt/QML wrapper library for the ZXing library"; + homepage = "https://github.com/ftylitak/qzxing"; + license = licenses.asl20; + maintainers = with maintainers; [ OPNA2608 ]; + platforms = platforms.unix; + pkgConfigModules = [ + "QZXing" + ]; + }; +}) diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index 73a52df278fa..fc2e2baf655c 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -229,6 +229,8 @@ in (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdParty // kdeGea qxlsx = callPackage ../development/libraries/qxlsx { }; + qzxing = callPackage ../development/libraries/qzxing { }; + soqt = callPackage ../development/libraries/soqt { }; telepathy = callPackage ../development/libraries/telepathy/qt { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index 8490d2a20186..eba2496fcc5f 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -40,6 +40,8 @@ in qxlsx = callPackage ../development/libraries/qxlsx { }; + qzxing = callPackage ../development/libraries/qzxing { }; + poppler = callPackage ../development/libraries/poppler { lcms = pkgs.lcms2; qt6Support = true; From 40e2a9f945108f42b80198bb67739c1a422abc9e Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Wed, 18 Oct 2023 13:13:31 +0200 Subject: [PATCH 02/39] qdigidoc: 4.2.12 -> 4.4.0 --- pkgs/tools/security/qdigidoc/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/qdigidoc/default.nix b/pkgs/tools/security/qdigidoc/default.nix index 8a8fa4496c38..097ef5023974 100644 --- a/pkgs/tools/security/qdigidoc/default.nix +++ b/pkgs/tools/security/qdigidoc/default.nix @@ -2,6 +2,7 @@ , mkDerivation , fetchurl , cmake +, flatbuffers , gettext , pkg-config , libdigidocpp @@ -16,12 +17,12 @@ mkDerivation rec { pname = "qdigidoc"; - version = "4.2.12"; + version = "4.4.0"; src = fetchurl { url = "https://github.com/open-eid/DigiDoc4-Client/releases/download/v${version}/qdigidoc4-${version}.tar.gz"; - hash = "sha256-6bso1qvhVhbBfrcTq4S+aHtHli7X2A926N4r45ztq4E="; + hash = "sha256-5zo0yoY0wufm9DWRIccxJ5g4DXn75nT4fd2h+5QP4oQ="; }; tsl = fetchurl { @@ -37,6 +38,7 @@ mkDerivation rec { ''; buildInputs = [ + flatbuffers libdigidocpp opensc openldap From fa4581f1efbc6315ab111f5c7ab3022c237f5a44 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Thu, 19 Oct 2023 20:14:54 +0200 Subject: [PATCH 03/39] ayatana-indicator-messages: init at 23.10.0 --- .../ay/ayatana-indicator-messages/package.nix | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 pkgs/by-name/ay/ayatana-indicator-messages/package.nix diff --git a/pkgs/by-name/ay/ayatana-indicator-messages/package.nix b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix new file mode 100644 index 000000000000..aa391bcc44d6 --- /dev/null +++ b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix @@ -0,0 +1,143 @@ +{ stdenv +, lib +, fetchFromGitHub +, gitUpdater +, testers +, accountsservice +, cmake +, dbus-test-runner +, withDocumentation ? true +, docbook_xsl +, docbook_xml_dtd_45 +, glib +, gobject-introspection +, gtest +, gtk-doc +, intltool +, lomiri +, pkg-config +, python3 +, systemd +, vala +, wrapGAppsHook +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "ayatana-indicator-messages"; + version = "23.10.0"; + + src = fetchFromGitHub { + owner = "AyatanaIndicators"; + repo = "ayatana-indicator-messages"; + rev = finalAttrs.version; + hash = "sha256-FBJeP5hOXJcOk04cRJpw+oN7L3w3meDX3ivLmFWkhVI="; + }; + + outputs = [ + "out" + "dev" + ] ++ lib.optionals withDocumentation [ + "devdoc" + ]; + + postPatch = '' + # Uses pkg_get_variable, cannot substitute prefix with that + substituteInPlace data/CMakeLists.txt \ + --replace "\''${SYSTEMD_USER_DIR}" "$out/lib/systemd/user" + + # Bad concatenation + substituteInPlace libmessaging-menu/messaging-menu.pc.in \ + --replace "\''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@" '@CMAKE_INSTALL_FULL_LIBDIR@' \ + --replace "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" '@CMAKE_INSTALL_FULL_INCLUDEDIR@' + '' + lib.optionalString (!withDocumentation) '' + sed -i CMakeLists.txt \ + '/add_subdirectory(doc)/d' + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + glib # For glib-compile-schemas + intltool + pkg-config + vala + wrapGAppsHook + ] ++ lib.optionals withDocumentation [ + docbook_xsl + docbook_xml_dtd_45 + gtk-doc + ]; + + buildInputs = [ + accountsservice + lomiri.cmake-extras + glib + gobject-introspection + systemd + ]; + + nativeCheckInputs = [ + (python3.withPackages (ps: with ps; [ + pygobject3 + python-dbusmock + ])) + ]; + + checkInputs = [ + dbus-test-runner + gtest + ]; + + cmakeFlags = [ + "-DENABLE_TESTS=${lib.boolToString finalAttrs.doCheck}" + "-DGSETTINGS_LOCALINSTALL=ON" + "-DGSETTINGS_COMPILE=ON" + ]; + + makeFlags = lib.optionals withDocumentation [ + # gtk-doc doesn't call ld with the correct arguments + # ld: ...: undefined reference to symbol 'strncpy@@GLIBC_2.2.5', 'qsort@@GLIBC_2.2.5' + "LD=${stdenv.cc.targetPrefix}cc" + ]; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + preCheck = '' + # test-client imports gir, whose solib entry points to final store location + install -Dm644 libmessaging-menu/libmessaging-menu.so.0.0.0 $out/lib/libmessaging-menu.so.0 + ''; + + postCheck = '' + # remove the above solib-installation, let it be done properly + rm -r $out + ''; + + preInstall = lib.optionalString withDocumentation '' + # installing regenerates docs, generated files are created without write permissions, errors out while trying to overwrite them + chmod +w doc/reference/html/* + ''; + + passthru = { + ayatana-indicators = [ + "ayatana-indicator-messages" + ]; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + updateScript = gitUpdater { }; + }; + + meta = with lib; { + description = "Ayatana Indicator Messages Applet"; + longDescription = '' + The -messages Ayatana System Indicator is the messages menu indicator for Unity7, MATE and Lomiri (optionally for + others, e.g. XFCE, LXDE). + ''; + homepage = "https://github.com/AyatanaIndicators/ayatana-indicator-messages"; + license = licenses.gpl3Only; + platforms = platforms.linux; + maintainers = with maintainers; [ OPNA2608 ]; + pkgConfigModules = [ + "messaging-menu" + ]; + }; +}) From aba2b6d387dcbe2f8e06de7140442a8459220b34 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Thu, 19 Oct 2023 20:26:53 +0200 Subject: [PATCH 04/39] nixos/ayatana-indicators: init module --- nixos/modules/module-list.nix | 1 + .../services/desktops/ayatana-indicators.nix | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 nixos/modules/services/desktops/ayatana-indicators.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 2c06f4931725..438da244ab7d 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -437,6 +437,7 @@ ./services/databases/surrealdb.nix ./services/databases/victoriametrics.nix ./services/desktops/accountsservice.nix + ./services/desktops/ayatana-indicators.nix ./services/desktops/bamf.nix ./services/desktops/blueman.nix ./services/desktops/cpupower-gui.nix diff --git a/nixos/modules/services/desktops/ayatana-indicators.nix b/nixos/modules/services/desktops/ayatana-indicators.nix new file mode 100644 index 000000000000..abc687bbd43d --- /dev/null +++ b/nixos/modules/services/desktops/ayatana-indicators.nix @@ -0,0 +1,58 @@ +{ config +, pkgs +, lib +, ... +}: + +let + cfg = config.services.ayatana-indicators; +in +{ + options.services.ayatana-indicators = { + enable = lib.mkEnableOption (lib.mdDoc '' + Ayatana Indicators, a continuation of Canonical's Application Indicators + ''); + + packages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = [ ]; + example = lib.literalExpression "with pkgs; [ ayatana-indicator-messages ]"; + description = lib.mdDoc '' + List of packages containing Ayatana Indicator services + that should be brought up by the SystemD "ayatana-indicators" user target. + + Packages specified here must have passthru.ayatana-indicators set correctly. + + If, how, and where these indicators are displayed will depend on your DE. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + environment = { + systemPackages = cfg.packages; + + pathsToLink = [ + "/share/ayatana" + ]; + }; + + # libayatana-common's ayatana-indicators.target with explicit Wants & Before to bring up requested indicator services + systemd.user.targets."ayatana-indicators" = + let + indicatorServices = lib.lists.flatten + (map + (pkg: + (map (ind: "${ind}.service") pkg.passthru.ayatana-indicators)) + cfg.packages); + in + { + description = "Target representing the lifecycle of the Ayatana Indicators. Each indicator should be bound to it in its individual service file"; + partOf = [ "graphical-session.target" ]; + wants = indicatorServices; + before = indicatorServices; + }; + }; + + meta.maintainers = with lib.maintainers; [ OPNA2608 ]; +} From 84605b10088d734ce7ec049acd69e7a78abe535a Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 20 Oct 2023 11:50:27 +0200 Subject: [PATCH 05/39] nixos/tests: Add ayatana-indicators test --- nixos/tests/all-tests.nix | 1 + nixos/tests/ayatana-indicators.nix | 71 +++++++++++++++++++ .../ay/ayatana-indicator-messages/package.nix | 6 +- 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/ayatana-indicators.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 22371c9fec37..e9c3af1fba2f 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -124,6 +124,7 @@ in { authelia = handleTest ./authelia.nix {}; avahi = handleTest ./avahi.nix {}; avahi-with-resolved = handleTest ./avahi.nix { networkd = true; }; + ayatana-indicators = handleTest ./ayatana-indicators.nix {}; babeld = handleTest ./babeld.nix {}; bazarr = handleTest ./bazarr.nix {}; bcachefs = handleTestOn ["x86_64-linux" "aarch64-linux"] ./bcachefs.nix {}; diff --git a/nixos/tests/ayatana-indicators.nix b/nixos/tests/ayatana-indicators.nix new file mode 100644 index 000000000000..bc7ff75f390f --- /dev/null +++ b/nixos/tests/ayatana-indicators.nix @@ -0,0 +1,71 @@ +import ./make-test-python.nix ({ pkgs, lib, ... }: let + user = "alice"; +in { + name = "ayatana-indicators"; + + meta = { + maintainers = with lib.maintainers; [ OPNA2608 ]; + }; + + nodes.machine = { config, ... }: { + imports = [ + ./common/auto.nix + ./common/user-account.nix + ]; + + test-support.displayManager.auto = { + enable = true; + inherit user; + }; + + services.xserver = { + enable = true; + desktopManager.mate.enable = true; + displayManager.defaultSession = lib.mkForce "mate"; + }; + + services.ayatana-indicators = { + enable = true; + packages = with pkgs; [ + ayatana-indicator-messages + ]; + }; + + # Services needed by some indicators + services.accounts-daemon.enable = true; # messages + }; + + # TODO session indicator starts up in a semi-broken state, but works fine after a restart. maybe being started before graphical session is truly up & ready? + testScript = { nodes, ... }: let + runCommandPerIndicatorService = command: lib.strings.concatMapStringsSep "\n" command nodes.machine.systemd.user.targets."ayatana-indicators".wants; + in '' + start_all() + machine.wait_for_x() + + # Desktop environment should reach graphical-session.target + machine.wait_for_unit("graphical-session.target", "${user}") + + # MATE relies on XDG autostart to bring up the indicators. + # Not sure *when* XDG autostart fires them up, and awaiting pgrep success seems to misbehave? + machine.sleep(10) + + # Now check if all indicators were brought up successfully, and kill them for later + '' + (runCommandPerIndicatorService (service: let serviceExec = builtins.replaceStrings [ "." ] [ "-" ] service; in '' + machine.succeed("pgrep -f ${serviceExec}") + machine.succeed("pkill -f ${serviceExec}") + '')) + '' + + # Ayatana target is the preferred way of starting up indicators on SystemD session, the graphical session is responsible for starting this if it supports them. + # Mate currently doesn't do this, so start it manually for checking (https://github.com/mate-desktop/mate-indicator-applet/issues/63) + machine.systemctl("start ayatana-indicators.target", "${user}") + machine.wait_for_unit("ayatana-indicators.target", "${user}") + + # Let all indicator services do their startups, potential post-launch crash & restart cycles so we can properly check for failures + # Not sure if there's a better way of awaiting this without false-positive potential + machine.sleep(10) + + # Now check if all indicator services were brought up successfully + '' + runCommandPerIndicatorService (service: '' + machine.wait_for_unit("${service}", "${user}") + ''); +}) diff --git a/pkgs/by-name/ay/ayatana-indicator-messages/package.nix b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix index aa391bcc44d6..936c39a7fdce 100644 --- a/pkgs/by-name/ay/ayatana-indicator-messages/package.nix +++ b/pkgs/by-name/ay/ayatana-indicator-messages/package.nix @@ -2,6 +2,7 @@ , lib , fetchFromGitHub , gitUpdater +, nixosTests , testers , accountsservice , cmake @@ -122,7 +123,10 @@ stdenv.mkDerivation (finalAttrs: { ayatana-indicators = [ "ayatana-indicator-messages" ]; - tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + tests = { + pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + vm = nixosTests.ayatana-indicators; + }; updateScript = gitUpdater { }; }; From 4aac5539d0ea8e4a7ef830ee748a1cc78b519bf6 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 14 Oct 2023 10:54:43 +0200 Subject: [PATCH 06/39] lomiri.biometryd: init at 0.3.0 --- pkgs/desktops/lomiri/default.nix | 3 + .../lomiri/services/biometryd/default.nix | 108 ++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 pkgs/desktops/lomiri/services/biometryd/default.nix diff --git a/pkgs/desktops/lomiri/default.nix b/pkgs/desktops/lomiri/default.nix index 4aa91bae9f9c..fc471855639e 100644 --- a/pkgs/desktops/lomiri/default.nix +++ b/pkgs/desktops/lomiri/default.nix @@ -14,6 +14,9 @@ let gmenuharness = callPackage ./development/gmenuharness { }; libusermetrics = callPackage ./development/libusermetrics { }; lomiri-api = callPackage ./development/lomiri-api { }; + + #### Services + biometryd = callPackage ./services/biometryd { }; }; in lib.makeScope libsForQt5.newScope packages diff --git a/pkgs/desktops/lomiri/services/biometryd/default.nix b/pkgs/desktops/lomiri/services/biometryd/default.nix new file mode 100644 index 000000000000..f04b1fa47fcc --- /dev/null +++ b/pkgs/desktops/lomiri/services/biometryd/default.nix @@ -0,0 +1,108 @@ +{ stdenv +, lib +, fetchFromGitLab +, gitUpdater +, testers +, boost +, cmake +, cmake-extras +, dbus +, dbus-cpp +, gtest +, libapparmor +, libelf +, pkg-config +, process-cpp +, properties-cpp +, qtbase +, qtdeclarative +, sqlite +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "biometryd"; + version = "0.3.0"; + + src = fetchFromGitLab { + owner = "ubports"; + repo = "development/core/biometryd"; + rev = finalAttrs.version; + hash = "sha256-b095rsQnd63Ziqe+rn3ROo4LGXZxZ3Sa6h3apzCuyCs="; + }; + + outputs = [ + "out" + "dev" + ]; + + postPatch = '' + substituteInPlace data/CMakeLists.txt \ + --replace '/etc' "\''${CMAKE_INSTALL_SYSCONFDIR}" \ + --replace '/lib' "\''${CMAKE_INSTALL_LIBDIR}" + + substituteInPlace data/biometryd.{conf,service} \ + --replace '/usr/bin' "$out/bin" + + substituteInPlace src/biometry/qml/Biometryd/CMakeLists.txt \ + --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" + '' + lib.optionalString (!finalAttrs.doCheck) '' + sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt + ''; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + pkg-config + qtdeclarative # qmlplugindump + ]; + + buildInputs = [ + boost + cmake-extras + dbus + dbus-cpp + libapparmor + libelf + process-cpp + properties-cpp + qtbase + qtdeclarative + sqlite + ]; + + checkInputs = [ + gtest + ]; + + dontWrapQtApps = true; + + cmakeFlags = [ + "-DENABLE_WERROR=OFF" + "-DWITH_HYBRIS=OFF" + ]; + + preBuild = '' + # Generating plugins.qmltypes (also used in checkPhase?) + export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix} + ''; + + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + meta = with lib; { + description = "Mediates/multiplexes access to biometric devices"; + longDescription = '' + biometryd mediates and multiplexes access to biometric devices present + on the system, enabling applications and system components to leverage + them for identification and verification of users. + ''; + homepage = "https://gitlab.com/ubports/development/core/biometryd"; + license = licenses.lgpl3Only; + maintainers = teams.lomiri.members; + mainProgram = "biometryd"; + platforms = platforms.linux; + pkgConfigModules = [ + "biometryd" + ]; + }; +}) From 52c5c3fc78877e1b66467b5ff1848d0b459a2cc8 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Mon, 23 Oct 2023 08:26:18 +0200 Subject: [PATCH 07/39] raysession: 0.13.1 -> 0.14.2 --- pkgs/applications/audio/raysession/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/audio/raysession/default.nix b/pkgs/applications/audio/raysession/default.nix index f12fd7a15c00..4db6072a4805 100644 --- a/pkgs/applications/audio/raysession/default.nix +++ b/pkgs/applications/audio/raysession/default.nix @@ -1,12 +1,12 @@ -{ lib, fetchurl, buildPythonApplication, libjack2, pydbus, pyliblo, pyqt5, which, bash, qt5 }: +{ lib, fetchurl, buildPythonApplication, libjack2, pyliblo, pyqt5, which, bash, qt5 }: buildPythonApplication rec { pname = "raysession"; - version = "0.13.1"; + version = "0.14.2"; src = fetchurl { url = "https://github.com/Houston4444/RaySession/releases/download/v${version}/RaySession-${version}-source.tar.gz"; - sha256 = "sha256-iiFRtX43u9BHe7a4ojza7kav+dMW9e05dPi7Gf9d1GM="; + sha256 = "sha256-qEN3zBK/goRLIZaU06XXm8H5yj4Qjj/NH+bkHkjhLaw="; }; postPatch = '' @@ -25,7 +25,7 @@ buildPythonApplication rec { qt5.wrapQtAppsHook ]; buildInputs = [ libjack2 bash ]; - propagatedBuildInputs = [ pydbus pyliblo pyqt5 ]; + propagatedBuildInputs = [ pyliblo pyqt5 ]; dontWrapQtApps = true; # The program is a python script. From 50abe8063c4028961b45799ee651ed21a7207847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:02:41 -0400 Subject: [PATCH 08/39] sov: add passthru.updateScript --- pkgs/tools/wayland/sov/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/tools/wayland/sov/default.nix b/pkgs/tools/wayland/sov/default.nix index c8ddc6524f28..fafaddccb000 100644 --- a/pkgs/tools/wayland/sov/default.nix +++ b/pkgs/tools/wayland/sov/default.nix @@ -11,6 +11,7 @@ , libxkbcommon , wayland , wayland-protocols +, gitUpdater }: stdenv.mkDerivation (finalAttrs: { @@ -54,6 +55,8 @@ stdenv.mkDerivation (finalAttrs: { wayland-protocols ]; + passthru.updateScript = gitUpdater { }; + meta = { description = "Workspace overview app for sway"; homepage = "https://github.com/milgra/sov"; From 043723bc0c0e1fa0e871b9a2c756bcd7540c928b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Fri, 3 Nov 2023 18:04:22 +0000 Subject: [PATCH 09/39] sov: 0.92b -> 0.93 --- pkgs/tools/wayland/sov/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/wayland/sov/default.nix b/pkgs/tools/wayland/sov/default.nix index fafaddccb000..d6d9f4053123 100644 --- a/pkgs/tools/wayland/sov/default.nix +++ b/pkgs/tools/wayland/sov/default.nix @@ -16,13 +16,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "sov"; - version = "0.92b"; + version = "0.93"; src = fetchFromGitHub { owner = "milgra"; repo = "sov"; rev = finalAttrs.version; - hash = "sha256-1L5D0pzcXbkz3VS7VB6ID8BJEbGeNxjo3xCr71CGcIo="; + hash = "sha256-Oc25ixrl0QX0jBBMV34BPAixyBikvevXJ1JNGZymPhg="; }; patches = [ From de49c2415c716bb598d5ff536082842c4c6745c0 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Tue, 14 Nov 2023 01:16:50 +0100 Subject: [PATCH 10/39] lomiri.biometryd: Fetch submitted changes from upstream --- .../lomiri/services/biometryd/default.nix | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/pkgs/desktops/lomiri/services/biometryd/default.nix b/pkgs/desktops/lomiri/services/biometryd/default.nix index f04b1fa47fcc..c8d0da9a65c2 100644 --- a/pkgs/desktops/lomiri/services/biometryd/default.nix +++ b/pkgs/desktops/lomiri/services/biometryd/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchFromGitLab +, fetchpatch , gitUpdater , testers , boost @@ -35,13 +36,41 @@ stdenv.mkDerivation (finalAttrs: { "dev" ]; - postPatch = '' - substituteInPlace data/CMakeLists.txt \ - --replace '/etc' "\''${CMAKE_INSTALL_SYSCONFDIR}" \ - --replace '/lib' "\''${CMAKE_INSTALL_LIBDIR}" + patches = [ + # https://gitlab.com/ubports/development/core/biometryd/-/merge_requests/31 + (fetchpatch { + url = "https://gitlab.com/OPNA2608/biometryd/-/commit/d01d979e4f98c6473761d1ace308aa182017804e.patch"; + hash = "sha256-JxL3BLuh33ptfneU1y2qNGFKpeMlZlTMwCK97Rk3aTA="; + }) + (fetchpatch { + url = "https://gitlab.com/OPNA2608/biometryd/-/commit/3cec6a3d42ea6aba8892da2c771b317f44daf9e2.patch"; + hash = "sha256-Ij/aio38WmZ+NsUSbM195Gwb83goWIcCnJvGwAOJi50="; + }) + (fetchpatch { + url = "https://gitlab.com/OPNA2608/biometryd/-/commit/e89bd9444bc1cfe84a9aa93faa23057c80f39564.patch"; + hash = "sha256-1vEG349X9+SvY/f3no/l5cMVGpdzC8h/8XOZwL/70Dc="; + }) - substituteInPlace data/biometryd.{conf,service} \ - --replace '/usr/bin' "$out/bin" + # https://gitlab.com/ubports/development/core/biometryd/-/merge_requests/32 + (fetchpatch { + url = "https://gitlab.com/OPNA2608/biometryd/-/commit/9e52fad0139c5a45f69e6a6256b2b5ff54f77740.patch"; + hash = "sha256-DZSdzKq6EYgAllKSDgkGk2g57zHN+gI5fOoj7U5AcKY="; + }) + ]; + + postPatch = '' + # Remove with !31 patches, fetchpatch can't apply renames + pushd data + for type in conf service; do + mv biometryd.$type biometryd.$type.in + substituteInPlace biometryd.$type.in \ + --replace '/usr/bin' "\''${CMAKE_INSTALL_FULL_BINDIR}" + done + popd + + # Uses pkg_get_variable, cannot substitute prefix with that + substituteInPlace CMakeLists.txt \ + --replace 'pkg_get_variable(SYSTEMD_SYSTEM_UNIT_DIR systemd systemdsystemunitdir)' 'set(SYSTEMD_SYSTEM_UNIT_DIR "${placeholder "out"}/lib/systemd/system")' substituteInPlace src/biometry/qml/Biometryd/CMakeLists.txt \ --replace "\''${CMAKE_INSTALL_LIBDIR}/qt5/qml" "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" From 97ddf8d9419e2f6d3e0eb86b199ed46aebf493d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Fri, 17 Nov 2023 18:31:34 -0500 Subject: [PATCH 11/39] sov: move to by-name --- .../wayland/sov/default.nix => by-name/so/sov/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/wayland/sov/default.nix => by-name/so/sov/package.nix} (100%) diff --git a/pkgs/tools/wayland/sov/default.nix b/pkgs/by-name/so/sov/package.nix similarity index 100% rename from pkgs/tools/wayland/sov/default.nix rename to pkgs/by-name/so/sov/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b8667f8be2cc..36c8dd54013e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4791,8 +4791,6 @@ with pkgs; slurp = callPackage ../tools/wayland/slurp { }; - sov = callPackage ../tools/wayland/sov { }; - swaykbdd = callPackage ../tools/wayland/swaykbdd { }; swaycwd = callPackage ../tools/wayland/swaycwd { }; From 196a660c6c882727954d979f9dcd9629eea56ed7 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 23 Nov 2023 09:37:14 +0000 Subject: [PATCH 12/39] libutp_3_4: unstable-2023-10-16 -> unstable-2023-11-14 --- pkgs/applications/networking/p2p/libutp/3.4.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/p2p/libutp/3.4.nix b/pkgs/applications/networking/p2p/libutp/3.4.nix index aa2853d3bd05..dfff1eeed239 100644 --- a/pkgs/applications/networking/p2p/libutp/3.4.nix +++ b/pkgs/applications/networking/p2p/libutp/3.4.nix @@ -2,14 +2,14 @@ stdenv.mkDerivation rec { pname = "libutp"; - version = "unstable-2023-10-16"; + version = "unstable-2023-11-14"; src = fetchFromGitHub { # Use transmission fork from post-3.4-transmission branch owner = "transmission"; repo = pname; - rev = "2589200eac82fc91b65979680e4b3c026dff0278"; - hash = "sha256-wsDqdbMWVm3ubTbg5XClEWutJz1irSIazVLFeCyAAL4="; + rev = "52645d6d0fb16009e11d2f84469d2e43b7b6b48a"; + hash = "sha256-pcPVkDEEtriN9zlEcVFKwKhhh51wpJGxYlcu7bH1RkI="; }; nativeBuildInputs = [ cmake ]; From acc2979ea32b43b96ec45f49ec67a01e57110476 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Sun, 26 Nov 2023 19:29:08 +0200 Subject: [PATCH 13/39] ravedude: add updateScript --- pkgs/development/tools/rust/ravedude/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/tools/rust/ravedude/default.nix b/pkgs/development/tools/rust/ravedude/default.nix index ea5812e5ad1e..1292c6c71f22 100644 --- a/pkgs/development/tools/rust/ravedude/default.nix +++ b/pkgs/development/tools/rust/ravedude/default.nix @@ -3,6 +3,7 @@ , fetchCrate , pkg-config , udev +, nix-update-script }: rustPlatform.buildRustPackage rec { @@ -20,6 +21,8 @@ rustPlatform.buildRustPackage rec { buildInputs = [ udev ]; + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "Tool to easily flash code onto an AVR microcontroller with avrdude"; homepage = "https://crates.io/crates/ravedude"; From 9eab5170f31c000d997d4163c4248d4664ca9401 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Sun, 26 Nov 2023 19:29:32 +0200 Subject: [PATCH 14/39] ravedude: add mainProgram --- pkgs/development/tools/rust/ravedude/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/tools/rust/ravedude/default.nix b/pkgs/development/tools/rust/ravedude/default.nix index 1292c6c71f22..225b71897c52 100644 --- a/pkgs/development/tools/rust/ravedude/default.nix +++ b/pkgs/development/tools/rust/ravedude/default.nix @@ -29,5 +29,6 @@ rustPlatform.buildRustPackage rec { license = with licenses; [ mit /* or */ asl20 ]; platforms = platforms.linux; maintainers = with maintainers; [ rvarago ]; + mainProgram = "ravedude"; }; } From 52ef1ef0cc538f8f77ea6f4649491061071d81c5 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Sun, 26 Nov 2023 19:33:26 +0200 Subject: [PATCH 15/39] ravedude: add simple version test --- pkgs/development/tools/rust/ravedude/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/rust/ravedude/default.nix b/pkgs/development/tools/rust/ravedude/default.nix index 225b71897c52..e8a406ba8096 100644 --- a/pkgs/development/tools/rust/ravedude/default.nix +++ b/pkgs/development/tools/rust/ravedude/default.nix @@ -4,6 +4,8 @@ , pkg-config , udev , nix-update-script +, testers +, ravedude }: rustPlatform.buildRustPackage rec { @@ -21,7 +23,13 @@ rustPlatform.buildRustPackage rec { buildInputs = [ udev ]; - passthru.updateScript = nix-update-script { }; + passthru = { + updateScript = nix-update-script { }; + tests.version = testers.testVersion { + package = ravedude; + version = "v${version}"; + }; + }; meta = with lib; { description = "Tool to easily flash code onto an AVR microcontroller with avrdude"; From 58d04b3a4b1108326353a29375b1be1dbe0d2a10 Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Sun, 26 Nov 2023 19:34:40 +0200 Subject: [PATCH 16/39] ravedude: 0.1.5 -> 0.1.6 --- pkgs/development/tools/rust/ravedude/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rust/ravedude/default.nix b/pkgs/development/tools/rust/ravedude/default.nix index e8a406ba8096..aeb44664cf6c 100644 --- a/pkgs/development/tools/rust/ravedude/default.nix +++ b/pkgs/development/tools/rust/ravedude/default.nix @@ -10,14 +10,14 @@ rustPlatform.buildRustPackage rec { pname = "ravedude"; - version = "0.1.5"; + version = "0.1.6"; src = fetchCrate { inherit pname version; - hash = "sha256-wcY9fvfIn1pWMAh5FI/QFl18CV2xjmRGSwwoRfGvujo="; + hash = "sha256-LhPRz3DUMDoe50Hq3yO+2BHpyh5fQ4sMNGLttjkdSZw="; }; - cargoHash = "sha256-AOIrB0FRagbA2+JEURF41d+th0AbR++U5WKCcZmh4Os="; + cargoHash = "sha256-Uo8wlTAHBkn/WeGPhPP+BU80wjSyNHsWQj8QvA7mHrk="; nativeBuildInputs = [ pkg-config ]; From f0c0ed1fa844fe77cb0a23bb68ec41b1717298b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sun, 26 Nov 2023 19:28:39 -0500 Subject: [PATCH 17/39] chrysalis: fix icon location --- pkgs/applications/misc/chrysalis/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/chrysalis/default.nix b/pkgs/applications/misc/chrysalis/default.nix index f5c6da15bd99..cc59b97a0f2b 100644 --- a/pkgs/applications/misc/chrysalis/default.nix +++ b/pkgs/applications/misc/chrysalis/default.nix @@ -35,7 +35,7 @@ in appimageTools.wrapType2 rec { $out/share/applications/Chrysalis.desktop \ --replace 'Exec=Chrysalis' 'Exec=${pname}' - cp -r ${appimageContents}/usr/share/icons $out/share + install -Dm444 ${appimageContents}/usr/share/icons/hicolor/256x256/chrysalis.png -t $out/share/pixmaps ''; meta = with lib; { From 053b6492db0229ffeb2dba7e1f7608be72699f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Sun, 26 Nov 2023 19:29:43 -0500 Subject: [PATCH 18/39] chrysalis: correct license identifier --- pkgs/applications/misc/chrysalis/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/chrysalis/default.nix b/pkgs/applications/misc/chrysalis/default.nix index cc59b97a0f2b..bb445422d030 100644 --- a/pkgs/applications/misc/chrysalis/default.nix +++ b/pkgs/applications/misc/chrysalis/default.nix @@ -41,7 +41,7 @@ in appimageTools.wrapType2 rec { meta = with lib; { description = "A graphical configurator for Kaleidoscope-powered keyboards"; homepage = "https://github.com/keyboardio/Chrysalis"; - license = licenses.gpl3; + license = licenses.gpl3Only; maintainers = with maintainers; [ aw ]; platforms = [ "x86_64-linux" ]; mainProgram = pname; From ef6c49fa50dc30c544afd952170efb295f33c6f5 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 30 Nov 2023 05:41:53 +0100 Subject: [PATCH 19/39] =?UTF-8?q?why3:=201.6.0=20=E2=86=92=201.7.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/applications/science/logic/why3/default.nix | 11 ++++++++--- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/logic/why3/default.nix b/pkgs/applications/science/logic/why3/default.nix index df8be359d123..f0567fdda3b6 100644 --- a/pkgs/applications/science/logic/why3/default.nix +++ b/pkgs/applications/science/logic/why3/default.nix @@ -1,13 +1,18 @@ { callPackage, fetchurl, lib, stdenv -, ocamlPackages, coqPackages, rubber, hevea, emacs }: +, ocamlPackages, coqPackages, rubber, hevea, emacs +, version ? "1.7.0" +}: stdenv.mkDerivation rec { pname = "why3"; - version = "1.6.0"; + inherit version; src = fetchurl { url = "https://why3.gitlabpages.inria.fr/releases/${pname}-${version}.tar.gz"; - hash = "sha256-hFvM6kHScaCtcHCc6Vezl9CR7BFbiKPoTEh7kj0ZJxw="; + hash = { + "1.7.0" = "sha256-rygrjzuJVukOvpuXTG/yeoEP98ZFkLQHObgc3My1PVY="; + "1.6.0" = "sha256-hFvM6kHScaCtcHCc6Vezl9CR7BFbiKPoTEh7kj0ZJxw="; + }."${version}"; }; strictDeps = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7325b6a4ff4a..eb3ab13a926e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19167,7 +19167,9 @@ with pkgs; fprettify = callPackage ../development/tools/fprettify { }; - framac = callPackage ../development/tools/analysis/frama-c { }; + framac = callPackage ../development/tools/analysis/frama-c { + why3 = pkgs.why3.override { version = "1.6.0"; }; + }; frame = callPackage ../development/libraries/frame { }; From 612d10f392a8be32ca13525e1ba4aaa5421c13b6 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 30 Nov 2023 05:20:22 +0000 Subject: [PATCH 20/39] berglas: 1.0.3 -> 2.0.1 --- pkgs/tools/admin/berglas/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/admin/berglas/default.nix b/pkgs/tools/admin/berglas/default.nix index 75a4bc591e7b..150b5535f1ce 100644 --- a/pkgs/tools/admin/berglas/default.nix +++ b/pkgs/tools/admin/berglas/default.nix @@ -27,16 +27,16 @@ in buildGoModule rec { pname = "berglas"; - version = "1.0.3"; + version = "2.0.1"; src = fetchFromGitHub { owner = "GoogleCloudPlatform"; repo = pname; rev = "v${version}"; - sha256 = "sha256-4hbRX0kKMWixcu5SWjrM5lVvhLMOaeBdG4GH5NVAh70="; + sha256 = "sha256-Jf6yPVydM7UnG1yiLEFe+7FMkWANIQebZ3QAwg6/OQs="; }; - vendorHash = "sha256-qcFS07gma7GVxhdrYca0E6rcczNcZmU8JcjjcpEaxp0="; + vendorHash = "sha256-3WDBl/GqCgRFMmh6TQvtHhACCRzf9sdIO8fel8CAMP0="; ldflags = [ "-s" From e928afbe8b5498279f9b88aeab676a78b2af28fb Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Tue, 21 Nov 2023 01:46:30 +0100 Subject: [PATCH 21/39] normcap: refactor, wrap with runtime inputs, enable checks, add maintainer pbsds --- .../applications/graphics/normcap/default.nix | 52 -------- pkgs/by-name/no/normcap/package.nix | 117 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 - 3 files changed, 117 insertions(+), 54 deletions(-) delete mode 100644 pkgs/applications/graphics/normcap/default.nix create mode 100644 pkgs/by-name/no/normcap/package.nix diff --git a/pkgs/applications/graphics/normcap/default.nix b/pkgs/applications/graphics/normcap/default.nix deleted file mode 100644 index 820ca9903394..000000000000 --- a/pkgs/applications/graphics/normcap/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -# From NUR https://github.com/nix-community/nur-combined/blob/6bddae47680482383b5769dd3aa7d82b88e6cbc8/repos/renesat/pkgs/normcap/default.nix - -{ - lib, - stdenv, - python3, - fetchFromGitHub, - tesseract4, - leptonica, - wl-clipboard -}: -python3.pkgs.buildPythonApplication rec { - pname = "normcap"; - version = "0.4.4"; - format = "pyproject"; - - src = fetchFromGitHub { - owner = "dynobo"; - repo = "normcap"; - rev = "v${version}"; - hash = "sha256-dShtmoqS9TC3PHuwq24OEOhYfBHGhDCma8Du8QCkFuI="; - }; - - buildInputs = [ - wl-clipboard - ]; - - nativeBuildInputs = with python3.pkgs; [ - poetry-core - ]; - - propagatedBuildInputs = with python3.pkgs; [ - tesseract4 - leptonica - pyside6 - - # Test - toml - pytest-qt - ]; - - postPatch = '' - substituteInPlace pyproject.toml --replace 'PySide6-Essentials = "6.5.1"' "" - ''; - - meta = with lib; { - description = "OCR powered screen-capture tool to capture information instead of images"; - homepage = "https://dynobo.github.io/normcap/"; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ cafkafk ]; - }; -} diff --git a/pkgs/by-name/no/normcap/package.nix b/pkgs/by-name/no/normcap/package.nix new file mode 100644 index 000000000000..8db68e9ae7e2 --- /dev/null +++ b/pkgs/by-name/no/normcap/package.nix @@ -0,0 +1,117 @@ +{ lib +, stdenv +, python3 +, fetchFromGitHub +, tesseract4 +, leptonica +, wl-clipboard +, libnotify +, xorg +}: + +let + + ps = python3.pkgs; + + wrapperDeps = [ + leptonica + tesseract4 + libnotify + ] ++ lib.optionals stdenv.isLinux [ + wl-clipboard + ]; + +in + +ps.buildPythonApplication rec { + pname = "normcap"; + version = "0.4.4"; + format = "pyproject"; + + disabled = ps.pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "dynobo"; + repo = "normcap"; + rev = "refs/tags/v${version}"; + hash = "sha256-dShtmoqS9TC3PHuwq24OEOhYfBHGhDCma8Du8QCkFuI="; + }; + + pythonRemoveDeps = [ + "PySide6-Essentials" + ]; + + nativeBuildInputs = [ + ps.pythonRelaxDepsHook + ps.poetry-core + ]; + + propagatedBuildInputs = [ + ps.pyside6 + ]; + + preFixup = '' + makeWrapperArgs+=( + "''${qtWrapperArgs[@]}" + --set QT_QPA_PLATFORM xcb + --prefix PATH : ${lib.makeBinPath wrapperDeps} + ) + ''; + + nativeCheckInputs = wrapperDeps ++ [ + ps.pytestCheckHook + ps.pytest-qt + ps.toml + ] ++ lib.optionals stdenv.isLinux [ + ps.pytest-xvfb + xorg.xorgserver + ]; + + preCheck = '' + export HOME=$(mktemp -d) + '' + lib.optionalString stdenv.isLinux '' + # setup a virtual x11 display + export DISPLAY=:$((2000 + $RANDOM % 1000)) + Xvfb $DISPLAY -screen 5 1024x768x8 & + xvfb_pid=$! + ''; + + postCheck = lib.optionalString stdenv.isLinux '' + # cleanup the virtual x11 display + kill $xvfb_pid + ''; + + disabledTests = [ + # requires a wayland session (no xclip support) + "test_wl_copy" + # times out, unknown why + "test_update_checker_triggers_checked_signal" + # touches network + "test_urls_reachable" + # requires xdg + "test_synchronized_capture" + ] ++ lib.optionals stdenv.isDarwin [ + # requires impure pbcopy + "test_get_copy_func_with_pbcopy" + "test_get_copy_func_without_pbcopy" + "test_perform_pbcopy" + ]; + + disabledTestPaths = [ + # touches network + "tests/tests_gui/test_downloader.py" + # fails to import, causes pytest to freeze + "tests/tests_gui/test_language_manager.py" + ] ++ lib.optionals stdenv.isDarwin [ + # requires a display + "tests/integration/test_normcap.py" + ]; + + meta = with lib; { + description = "OCR powered screen-capture tool to capture information instead of images"; + homepage = "https://dynobo.github.io/normcap/"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ cafkafk pbsds ]; + mainProgram = "normcap"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0a4e6728c301..b45b472a4ab6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34370,8 +34370,6 @@ with pkgs; nomacs = libsForQt5.callPackage ../applications/graphics/nomacs { }; - normcap = callPackage ../applications/graphics/normcap { }; - notepad-next = libsForQt5.callPackage ../applications/editors/notepad-next { }; notepadqq = libsForQt5.callPackage ../applications/editors/notepadqq { }; From 811d9a2e9f3d50dca9bd34bce52315dd926e5e10 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 1 Dec 2023 13:47:26 +0100 Subject: [PATCH 22/39] ctranslate2: 3.22.0 -> 3.23.0 https://github.com/OpenNMT/CTranslate2/blob/v3.23.0/CHANGELOG.md --- pkgs/development/libraries/ctranslate2/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ctranslate2/default.nix b/pkgs/development/libraries/ctranslate2/default.nix index cca1da7ec627..83eb9bf3a895 100644 --- a/pkgs/development/libraries/ctranslate2/default.nix +++ b/pkgs/development/libraries/ctranslate2/default.nix @@ -24,13 +24,13 @@ let in stdenv.mkDerivation rec { pname = "ctranslate2"; - version = "3.22.0"; + version = "3.23.0"; src = fetchFromGitHub { owner = "OpenNMT"; repo = "CTranslate2"; rev = "v${version}"; - hash = "sha256-Fw0pMTc0Zmr4RfH2rdPgpOODZW9CL5UbDbIeH6A4zZQ="; + hash = "sha256-jqeLNKOGdGtAVx7ExGGDxxgi5zDmQgmJ6bxIuguaM3k="; fetchSubmodules = true; }; From 9f68c762aee0aab12b22e698f101bef1e0d98000 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 1 Dec 2023 14:57:23 +0100 Subject: [PATCH 23/39] palemoon-bin: 32.5.0 -> 32.5.1 --- pkgs/applications/networking/browsers/palemoon/bin.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/browsers/palemoon/bin.nix b/pkgs/applications/networking/browsers/palemoon/bin.nix index 2ea777728f95..9bf721bca971 100644 --- a/pkgs/applications/networking/browsers/palemoon/bin.nix +++ b/pkgs/applications/networking/browsers/palemoon/bin.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "palemoon-bin"; - version = "32.5.0"; + version = "32.5.1"; src = fetchzip { urls = [ @@ -26,9 +26,9 @@ stdenv.mkDerivation (finalAttrs: { "https://rm-us.palemoon.org/release/palemoon-${finalAttrs.version}.linux-x86_64-gtk${if withGTK3 then "3" else "2"}.tar.xz" ]; hash = if withGTK3 then - "sha256-1MJ5K9Zc/BHeQwwlq3XyUV8XTFEpPytNyTnsDpE1tBI=" + "sha256-hWqL/WoRRigw8cNeJImOQLM8hewyS3PYNGr2WYP+cMk=" else - "sha256-xXunZTqoc2A+ilosRUUluxDwewD3xwITF5nb5Lbyv7Y="; + "sha256-dlBnXP3WUgQ0spkLRowfzMcPArhGfpowsvwgCA+kvUA="; }; preferLocalBuild = true; From ad773d71ed87b3b4d29d100de042edb351646cd2 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 1 Dec 2023 11:48:43 +0100 Subject: [PATCH 24/39] vprof: init at 0.38 --- .../python-modules/vprof/default.nix | 42 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 46 insertions(+) create mode 100644 pkgs/development/python-modules/vprof/default.nix diff --git a/pkgs/development/python-modules/vprof/default.nix b/pkgs/development/python-modules/vprof/default.nix new file mode 100644 index 000000000000..1f41f7b9a203 --- /dev/null +++ b/pkgs/development/python-modules/vprof/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchPypi +, setuptools +, wheel +, psutil +}: + +buildPythonPackage rec { + pname = "vprof"; + version = "0.38"; + pyproject = true; + + # We use the Pypi source rather than the GitHub ones because the former include the javascript + # dependency for the UI. + src = fetchPypi { + inherit pname version; + hash = "sha256-fxAAkS7rekUMfJTTzJZzmvRa0P8B1avMCwmhddQP+ts="; + }; + + nativeBuildInputs = [ + setuptools + wheel + ]; + + propagatedBuildInputs = [ + psutil + ]; + + pythonImportsCheck = [ "vprof" ]; + + # The tests are not included in the Pypi sources + doCheck = false; + + meta = with lib; { + description = "Visual profiler for Python"; + homepage = "https://github.com/nvdv/vprof"; + license = licenses.bsd2; + maintainers = with maintainers; [ GaetanLepage ]; + mainProgram = "vprof"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4cbbf7018480..873ed7446b39 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2116,6 +2116,8 @@ with pkgs; vopono = callPackage ../tools/networking/vopono { }; + vprof = with python3Packages; toPythonApplication vprof; + vrc-get = callPackage ../tools/misc/vrc-get { inherit (darwin.apple_sdk.frameworks) Security; }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 07f44dcf96fd..6783437103ca 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15583,6 +15583,8 @@ self: super: with self; { vpk = callPackage ../development/python-modules/vpk { }; + vprof = callPackage ../development/python-modules/vprof { }; + vqgan-jax = callPackage ../development/python-modules/vqgan-jax { }; vsts = callPackage ../development/python-modules/vsts { }; From b81808f053e5825fd88c931ca8ba2f553a1eaa42 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Fri, 1 Dec 2023 10:28:47 -0500 Subject: [PATCH 25/39] hydra_unstable: 2023-11-17 -> 2023-12-01 Diff: https://github.com/NixOS/hydra/compare/8f48e4ddecbf403be35f8243b97d73cb39dd61bb...4d1c8505120961f10897b8fe9a070d4e193c9a13 --- pkgs/development/tools/misc/hydra/unstable.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/misc/hydra/unstable.nix b/pkgs/development/tools/misc/hydra/unstable.nix index 733966f47062..373f80a2f052 100644 --- a/pkgs/development/tools/misc/hydra/unstable.nix +++ b/pkgs/development/tools/misc/hydra/unstable.nix @@ -123,13 +123,13 @@ let in stdenv.mkDerivation rec { pname = "hydra"; - version = "2023-11-17"; + version = "2023-12-01"; src = fetchFromGitHub { owner = "NixOS"; repo = "hydra"; - rev = "8f48e4ddecbf403be35f8243b97d73cb39dd61bb"; - hash = "sha256-5q/7yz6jJedD8YU3SuYyXtN3qEAlOBRKGZxOcYt/0X8="; + rev = "4d1c8505120961f10897b8fe9a070d4e193c9a13"; + hash = "sha256-vXTuE83GL15mgZHegbllVAsVdDFcWWSayPfZxTJN5ys="; }; buildInputs = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c2cea37b8256..3c92dcec777a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22051,7 +22051,7 @@ with pkgs; hwloc = callPackage ../development/libraries/hwloc { }; - hydra_unstable = callPackage ../development/tools/misc/hydra/unstable.nix { nix = nixVersions.nix_2_17; }; + hydra_unstable = callPackage ../development/tools/misc/hydra/unstable.nix { nix = nixVersions.nix_2_18; }; hydra-cli = callPackage ../development/tools/misc/hydra-cli { }; From 3994688356e7ea9f6eec912a8e550b67d26f8300 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Fri, 1 Dec 2023 18:26:05 +0100 Subject: [PATCH 26/39] phpunit: 10.5.0 -> 10.5.1 --- .../phpunit/default.nix => by-name/ph/phpunit/package.nix} | 4 ++-- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) rename pkgs/{development/tools/misc/phpunit/default.nix => by-name/ph/phpunit/package.nix} (88%) diff --git a/pkgs/development/tools/misc/phpunit/default.nix b/pkgs/by-name/ph/phpunit/package.nix similarity index 88% rename from pkgs/development/tools/misc/phpunit/default.nix rename to pkgs/by-name/ph/phpunit/package.nix index 9690e87fc532..e9c87ebbdb32 100644 --- a/pkgs/development/tools/misc/phpunit/default.nix +++ b/pkgs/by-name/ph/phpunit/package.nix @@ -2,13 +2,13 @@ php.buildComposerProject (finalAttrs: { pname = "phpunit"; - version = "10.5.0"; + version = "10.5.1"; src = fetchFromGitHub { owner = "sebastianbergmann"; repo = "phpunit"; rev = finalAttrs.version; - hash = "sha256-CpgYMUJE7c2eRBYkK/vMRdGgzY7Y7K/wMmyUH+Bssjs="; + hash = "sha256-uYSVzKLefcBMqfrHaF6pg4gohAeb6LVg8QGaTS8jwfE="; }; vendorHash = "sha256-uUdgz3ZZ+3nU07pUC1sdkNgU1b1beo3sS/yySUzdZwU="; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5404a77beab0..5de8cbdd68e1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18290,8 +18290,6 @@ with pkgs; karma-runner = callPackage ../development/tools/karma-runner { }; - phpunit = callPackage ../development/tools/misc/phpunit { }; - teller = callPackage ../development/tools/teller { }; yakut = python3Packages.callPackage ../development/tools/misc/yakut { }; From ae7f90f1b6263a8263387f1a090812162b2eac3c Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Fri, 1 Dec 2023 18:37:08 +0100 Subject: [PATCH 27/39] frankenphp: 1.0.0-rc.3 -> 1.0.0-rc.4 --- pkgs/by-name/fr/frankenphp/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/fr/frankenphp/package.nix b/pkgs/by-name/fr/frankenphp/package.nix index ffe66b30279a..3bc94389d67f 100644 --- a/pkgs/by-name/fr/frankenphp/package.nix +++ b/pkgs/by-name/fr/frankenphp/package.nix @@ -19,13 +19,13 @@ let pieBuild = stdenv.hostPlatform.isMusl; in buildGoModule rec { pname = "frankenphp"; - version = "1.0.0-rc.3"; + version = "1.0.0-rc.4"; src = fetchFromGitHub { owner = "dunglas"; repo = "frankenphp"; rev = "v${version}"; - hash = "sha256-Al0gCxTb6s41ugX9J8N8lshop9kP3RPGCzlq5etk1RY="; + hash = "sha256-4jNCKHt4eYI1BNaonIdS1Eq2OnJwgrU6qWZoiSpeIYk="; }; sourceRoot = "source/caddy"; From 2274d331583bedccdbe56c4f11090cb8973d72ff Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Dec 2023 20:00:36 +0000 Subject: [PATCH 28/39] flix: 0.41.0 -> 0.42.0 --- pkgs/development/compilers/flix/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/flix/default.nix b/pkgs/development/compilers/flix/default.nix index 9ce582623fe1..544c1f6ed920 100644 --- a/pkgs/development/compilers/flix/default.nix +++ b/pkgs/development/compilers/flix/default.nix @@ -2,11 +2,11 @@ stdenvNoCC.mkDerivation rec { pname = "flix"; - version = "0.41.0"; + version = "0.42.0"; src = fetchurl { url = "https://github.com/flix/flix/releases/download/v${version}/flix.jar"; - sha256 = "sha256-bDeqwk+grkCxmGE9H8Ks7Q8KvLxNCzaLe44DlR6E7YE="; + sha256 = "sha256-fkYyJxBlJWUkXGgcszerNKFNEFRIOm6tUyiTZj0q11k="; }; dontUnpack = true; From a5eac6f91ac778a47d078e9707f75333d82f9865 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 1 Dec 2023 21:12:25 +0100 Subject: [PATCH 29/39] python311Packages.amazon-ion: 0.10.0 -> 0.11.2 Diff: amazon-ion/ion-python@refs/tags/v0.10.0...v0.11.2 Changelog: https://github.com/amazon-ion/ion-python/releases/tag/v0.11.2 --- .../python-modules/amazon-ion/default.nix | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/amazon-ion/default.nix b/pkgs/development/python-modules/amazon-ion/default.nix index 0a2479dd38f4..e69de9cfea33 100644 --- a/pkgs/development/python-modules/amazon-ion/default.nix +++ b/pkgs/development/python-modules/amazon-ion/default.nix @@ -1,26 +1,29 @@ { lib , buildPythonPackage +, docopt , fetchFromGitHub , jsonconversion -, six , pytestCheckHook , pythonOlder +, setuptools +, six +, tabulate }: buildPythonPackage rec { pname = "amazon-ion"; - version = "0.10.0"; - format = "setuptools"; + version = "0.11.2"; + pyproject = true; disabled = pythonOlder "3.7"; - # test vectors require git submodule src = fetchFromGitHub { - owner = "amzn"; + owner = "amazon-ion"; repo = "ion-python"; rev = "refs/tags/v${version}"; + # Test vectors require git submodule fetchSubmodules = true; - hash = "sha256-pCm3jd/dVqO/uIvT5N/w5yoUWU6ni62Pl2A862e+qSk="; + hash = "sha256-0/+bX02qTbOydWDxex4OWL7woP7dW1yJZBmDZAivE7U="; }; postPatch = '' @@ -28,13 +31,19 @@ buildPythonPackage rec { --replace "'pytest-runner'," "" ''; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ jsonconversion six ]; nativeCheckInputs = [ + docopt pytestCheckHook + tabulate ]; disabledTests = [ @@ -42,13 +51,19 @@ buildPythonPackage rec { "test_roundtrips" ]; + disabledTestPaths = [ + # Exclude benchmarks + "tests/test_benchmark_cli.py" + ]; + pythonImportsCheck = [ "amazon.ion" ]; meta = with lib; { description = "Python implementation of Amazon Ion"; - homepage = "https://github.com/amzn/ion-python"; + homepage = "https://github.com/amazon-ion/ion-python"; + changelog = "https://github.com/amazon-ion/ion-python/releases/tag/v${version}"; sourceProvenance = with sourceTypes; [ fromSource binaryNativeCode From b5ded105970c1ff3adccd45c19443202f62d4720 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 1 Dec 2023 21:28:22 +0100 Subject: [PATCH 30/39] palemoon-bin: Fix WebGL support Needs libglvnd to find libGL.so.1 --- pkgs/applications/networking/browsers/palemoon/bin.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/networking/browsers/palemoon/bin.nix b/pkgs/applications/networking/browsers/palemoon/bin.nix index 9bf721bca971..aa2337f86d70 100644 --- a/pkgs/applications/networking/browsers/palemoon/bin.nix +++ b/pkgs/applications/networking/browsers/palemoon/bin.nix @@ -9,6 +9,7 @@ , gtk2-x11 , withGTK3 ? true , gtk3 +, libglvnd , libXt , libpulseaudio , makeDesktopItem @@ -147,6 +148,7 @@ stdenv.mkDerivation (finalAttrs: { gappsWrapperArgs+=( --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ ffmpeg + libglvnd libpulseaudio ]}" ) From d4693215900301172d513b6d556155b20c1eae23 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 1 Dec 2023 21:46:05 +0100 Subject: [PATCH 31/39] itd: update upstream URL --- pkgs/applications/misc/itd/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/itd/default.nix b/pkgs/applications/misc/itd/default.nix index 945e8978d82a..ce95eb69bc4f 100644 --- a/pkgs/applications/misc/itd/default.nix +++ b/pkgs/applications/misc/itd/default.nix @@ -8,10 +8,10 @@ buildGoModule rec { pname = "itd"; version = "1.1.0"; - # https://gitea.arsenm.dev/Arsen6331/itd/tags + # https://gitea.elara.ws/Elara6331/itd/tags src = fetchFromGitea { - domain = "gitea.arsenm.dev"; - owner = "Arsen6331"; + domain = "gitea.elara.ws"; + owner = "Elara6331"; repo = "itd"; rev = "v${version}"; hash = "sha256-95/9Qy0HhrX+ORuv6g1T4/Eq1hf539lYG5fTkLeY6B0="; @@ -34,7 +34,7 @@ buildGoModule rec { meta = with lib; { description = "itd is a daemon to interact with the PineTime running InfiniTime"; - homepage = "https://gitea.arsenm.dev/Arsen6331/itd"; + homepage = "https://gitea.elara.ws/Elara6331/itd"; license = licenses.gpl3Plus; platforms = platforms.linux; maintainers = with maintainers; [ mindavi raphaelr ]; From c70d0c8ce362a0671a2bbbcd97c719589b6dcb14 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 14 Nov 2023 16:12:33 -0500 Subject: [PATCH 32/39] gitea: 1.20.5 -> 1.21.1 --- nixos/doc/manual/release-notes/rl-2405.section.md | 4 ++++ pkgs/applications/version-management/gitea/default.nix | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 749ebc5cb13b..ba4d26518db8 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -38,4 +38,8 @@ In addition to numerous new and upgraded packages, this release has the followin existing process, but will need to start that process from gdb (so it is a child). Or you can set `boot.kernel.sysctl."kernel.yama.ptrace_scope"` to 0. +- Gitea 1.21 upgrade has several breaking changes, including: + - Custom themes and other assets that were previously stored in `custom/public/*` now belong in `custom/public/assets/*` + - New instances of Gitea using MySQL now ignore the `[database].CHARSET` config option and always use the `utf8mb4` charset, existing instances should migrate via the `gitea doctor convert` CLI command. + - The `hardware.pulseaudio` module now sets permission of pulse user home directory to 755 when running in "systemWide" mode. It fixes [issue 114399](https://github.com/NixOS/nixpkgs/issues/114399). diff --git a/pkgs/applications/version-management/gitea/default.nix b/pkgs/applications/version-management/gitea/default.nix index f21e58603368..5cbc4a1bd493 100644 --- a/pkgs/applications/version-management/gitea/default.nix +++ b/pkgs/applications/version-management/gitea/default.nix @@ -20,12 +20,12 @@ buildGoModule rec { pname = "gitea"; - version = "1.20.5"; + version = "1.21.1"; # not fetching directly from the git repo, because that lacks several vendor files for the web UI src = fetchurl { url = "https://dl.gitea.com/gitea/${version}/gitea-src-${version}.tar.gz"; - hash = "sha256-cH/AHsFXOdvfSfj9AZUd3l/RlYE06o1ByZu0vvGQuXw="; + hash = "sha256-5WEHUMQsQNgrglS+xJ4IWHUl0a6RLLPyx0l+ECJ4R9g="; }; vendorHash = null; From 9a16042cc362ee729922651c444b94110c16760d Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sat, 2 Dec 2023 02:04:40 +0100 Subject: [PATCH 33/39] fetchtorrent: add `meta` support --- pkgs/build-support/fetchtorrent/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/fetchtorrent/default.nix b/pkgs/build-support/fetchtorrent/default.nix index beb2415df707..126748678bf2 100644 --- a/pkgs/build-support/fetchtorrent/default.nix +++ b/pkgs/build-support/fetchtorrent/default.nix @@ -14,6 +14,7 @@ in , recursiveHash ? true , postFetch ? "" , postUnpack ? "" +, meta ? {} }: let afterSuccess = writeShellScript "fetch-bittorrent-done.sh" '' @@ -30,6 +31,7 @@ let jsonConfig = (formats.json {}).generate "jsonConfig" config; in runCommand name { + inherit meta; nativeBuildInputs = [ cacert ] ++ (if (backend == "transmission" ) then [ transmission_noSystemd ] else if (backend == "rqbit") then [ rqbit ] else throw "rqbit or transmission are the only available backends for fetchtorrent"); outputHashAlgo = if hash != "" then null else "sha256"; outputHash = hash; From 4fa591f807070a87734e83d6136491243f342df8 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sat, 2 Dec 2023 02:04:50 +0100 Subject: [PATCH 34/39] tests.fetchtorrent: add watched-cd license This marks the tests unfree, shuold be fixed in a follow up. --- pkgs/build-support/fetchtorrent/tests.nix | 26 +++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchtorrent/tests.nix b/pkgs/build-support/fetchtorrent/tests.nix index b36c82c6326f..e8cc3f33878b 100644 --- a/pkgs/build-support/fetchtorrent/tests.nix +++ b/pkgs/build-support/fetchtorrent/tests.nix @@ -1,25 +1,47 @@ -{ testers, fetchtorrent, ... }: +{ testers, fetchtorrent, lib, ... }: + +let + wired-cd.meta.license = [ + # track 1, 4 and 11 + { + spdxID = "CC NC-SAMPLING+ 1.0 Deed"; + fullName = "NonCommercial Sampling Plus 1.0 Generic"; + url = "https://creativecommons.org/licenses/nc-sampling+/1.0/"; + free = false; # for noncommercial purposes only + } + # the rest + { + spdxID = "CC SAMPLING+ 1.0 Deed"; + fullName = "Sampling Plus 1.0 Generic"; + url = "https://creativecommons.org/licenses/sampling+/1.0/"; + free = true; # no use in advertisement + } + ]; +in { http-link = testers.invalidateFetcherByDrvHash fetchtorrent { url = "https://webtorrent.io/torrents/wired-cd.torrent"; hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; backend = "transmission"; + inherit (wired-cd) meta; }; magnet-link = testers.invalidateFetcherByDrvHash fetchtorrent { url = "magnet:?xt=urn:btih:a88fda5954e89178c372716a6a78b8180ed4dad3&dn=The+WIRED+CD+-+Rip.+Sample.+Mash.+Share&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fwired-cd.torrent"; hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; backend = "transmission"; + inherit (wired-cd) meta; }; http-link-rqbit = testers.invalidateFetcherByDrvHash fetchtorrent { url = "https://webtorrent.io/torrents/wired-cd.torrent"; hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; backend = "rqbit"; + inherit (wired-cd) meta; }; magnet-link-rqbit = testers.invalidateFetcherByDrvHash fetchtorrent { url = "magnet:?xt=urn:btih:a88fda5954e89178c372716a6a78b8180ed4dad3&dn=The+WIRED+CD+-+Rip.+Sample.+Mash.+Share&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fwired-cd.torrent"; hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; backend = "rqbit"; + inherit (wired-cd) meta; }; } - From 7084473d63a718467f4e09a491551c399f3874b5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 1 Dec 2023 23:50:41 +0000 Subject: [PATCH 35/39] recoll: 1.36.0 -> 1.36.2 --- pkgs/applications/search/recoll/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix index 51815c26ae07..57604381fae1 100644 --- a/pkgs/applications/search/recoll/default.nix +++ b/pkgs/applications/search/recoll/default.nix @@ -70,11 +70,11 @@ in mkDerivation rec { pname = "recoll"; - version = "1.36.0"; + version = "1.36.2"; src = fetchurl { url = "https://www.lesbonscomptes.com/${pname}/${pname}-${version}.tar.gz"; - hash = "sha256-vf0o0wBcG3878YD4mTUhni2aTUU9AJkG4an1oaRc4yw="; + hash = "sha256-GyQqI3ciRO0TRaAeM4rGu+j/eB4bJlQ7VBTTxUGMNt4="; }; configureFlags = [ From 3c9e42e35172ea77d19e95e7a2e14215cc71c001 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 2 Dec 2023 04:20:00 +0000 Subject: [PATCH 36/39] recoll: fix changelog --- pkgs/applications/search/recoll/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix index 57604381fae1..0560793132d1 100644 --- a/pkgs/applications/search/recoll/default.nix +++ b/pkgs/applications/search/recoll/default.nix @@ -169,7 +169,7 @@ mkDerivation rec { members, email attachments. ''; homepage = "https://www.lesbonscomptes.com/recoll/"; - changelog = "https://www.lesbonscomptes.com/recoll/pages/release-${version}.html"; + changelog = "https://www.lesbonscomptes.com/recoll/pages/release-${versions.majorMinor version}.html"; license = licenses.gpl2Plus; platforms = platforms.unix; maintainers = with maintainers; [ jcumming ehmry ]; From fefcf28f8260da8be4f344e2a26f14881798a3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 1 Dec 2023 14:40:44 -0800 Subject: [PATCH 37/39] libadwaita: 1.4.0 -> 1.4.1 Diff: https://gitlab.gnome.org/GNOME/libadwaita/-/compare/1.4.0...1.4.1 Changelog: https://gitlab.gnome.org/GNOME/libadwaita/-/blob/1.4.1/NEWS --- pkgs/development/libraries/libadwaita/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libadwaita/default.nix b/pkgs/development/libraries/libadwaita/default.nix index 3b4aed7a8215..3a3d32e61da9 100644 --- a/pkgs/development/libraries/libadwaita/default.nix +++ b/pkgs/development/libraries/libadwaita/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { pname = "libadwaita"; - version = "1.4.0"; + version = "1.4.1"; outputs = [ "out" "dev" "devdoc" ]; outputBin = "devdoc"; # demo app @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { owner = "GNOME"; repo = "libadwaita"; rev = version; - hash = "sha256-LXrlTca50ALo+Nm55fwXNb4k3haLqHNnzLPc08VhA5s="; + hash = "sha256-ztbvVRkNbkeAomRIxToUEQrYB5XnG1WPcfSB/iXHKoA="; }; depsBuildBuild = [ From 27493b4d49b6d92f4baa049424cbb2fa48b4c948 Mon Sep 17 00:00:00 2001 From: Camille Mondon Date: Sat, 18 Nov 2023 19:37:56 +0000 Subject: [PATCH 38/39] nixos/clevis: init Co-Authored-By: Julien Malka --- .../manual/release-notes/rl-2405.section.md | 2 + nixos/modules/module-list.nix | 1 + nixos/modules/system/boot/clevis.md | 51 +++++++++ nixos/modules/system/boot/clevis.nix | 107 ++++++++++++++++++ nixos/modules/system/boot/luksroot.nix | 48 +++++++- nixos/modules/tasks/filesystems/bcachefs.nix | 10 +- nixos/modules/tasks/filesystems/zfs.nix | 13 ++- pkgs/tools/security/clevis/default.nix | 15 +++ pkgs/tools/security/clevis/tang-timeout.patch | 13 +++ 9 files changed, 255 insertions(+), 5 deletions(-) create mode 100644 nixos/modules/system/boot/clevis.md create mode 100644 nixos/modules/system/boot/clevis.nix create mode 100644 pkgs/tools/security/clevis/tang-timeout.patch diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index ba4d26518db8..729b52e09a16 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -18,6 +18,8 @@ In addition to numerous new and upgraded packages, this release has the followin - [Anki Sync Server](https://docs.ankiweb.net/sync-server.html), the official sync server built into recent versions of Anki. Available as [services.anki-sync-server](#opt-services.anki-sync-server.enable). +- [Clevis](https://github.com/latchset/clevis), a pluggable framework for automated decryption, used to unlock encrypted devices in initrd. Available as [boot.initrd.clevis.enable](#opt-boot.initrd.clevis.enable). + ## Backward Incompatibilities {#sec-release-24.05-incompatibilities} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7f708f6e57c7..bf4e51be8578 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1423,6 +1423,7 @@ ./system/activation/bootspec.nix ./system/activation/top-level.nix ./system/boot/binfmt.nix + ./system/boot/clevis.nix ./system/boot/emergency-mode.nix ./system/boot/grow-partition.nix ./system/boot/initrd-network.nix diff --git a/nixos/modules/system/boot/clevis.md b/nixos/modules/system/boot/clevis.md new file mode 100644 index 000000000000..91eb728a919e --- /dev/null +++ b/nixos/modules/system/boot/clevis.md @@ -0,0 +1,51 @@ +# Clevis {#module-boot-clevis} + +[Clevis](https://github.com/latchset/clevis) +is a framework for automated decryption of resources. +Clevis allows for secure unattended disk decryption during boot, using decryption policies that must be satisfied for the data to decrypt. + + +## Create a JWE file containing your secret {#module-boot-clevis-create-secret} + +The first step is to embed your secret in a [JWE](https://en.wikipedia.org/wiki/JSON_Web_Encryption) file. +JWE files have to be created through the clevis command line. 3 types of policies are supported: + +1) TPM policies + +Secrets are pinned against the presence of a TPM2 device, for example: +``` +echo hi | clevis encrypt tpm2 '{}' > hi.jwe +``` +2) Tang policies + +Secrets are pinned against the presence of a Tang server, for example: +``` +echo hi | clevis encrypt tang '{"url": "http://tang.local"}' > hi.jwe +``` + +3) Shamir Secret Sharing + +Using Shamir's Secret Sharing ([sss](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing)), secrets are pinned using a combination of the two preceding policies. For example: +``` +echo hi | clevis encrypt sss \ +'{"t": 2, "pins": {"tpm2": {"pcr_ids": "0"}, "tang": {"url": "http://tang.local"}}}' \ +> hi.jwe +``` + +For more complete documentation on how to generate a secret with clevis, see the [clevis documentation](https://github.com/latchset/clevis). + + +## Activate unattended decryption of a resource at boot {#module-boot-clevis-activate} + +In order to activate unattended decryption of a resource at boot, enable the `clevis` module: + +``` +boot.initrd.clevis.enable = true; +``` + +Then, specify the device you want to decrypt using a given clevis secret. Clevis will automatically try to decrypt the device at boot and will fallback to interactive unlocking if the decryption policy is not fulfilled. +``` +boot.initrd.clevis.devices."/dev/nvme0n1p1".secretFile = ./nvme0n1p1.jwe; +``` + +Only `bcachefs`, `zfs` and `luks` encrypted devices are supported at this time. diff --git a/nixos/modules/system/boot/clevis.nix b/nixos/modules/system/boot/clevis.nix new file mode 100644 index 000000000000..0c72590f9385 --- /dev/null +++ b/nixos/modules/system/boot/clevis.nix @@ -0,0 +1,107 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.boot.initrd.clevis; + systemd = config.boot.initrd.systemd; + supportedFs = [ "zfs" "bcachefs" ]; +in +{ + meta.maintainers = with maintainers; [ julienmalka camillemndn ]; + meta.doc = ./clevis.md; + + options = { + boot.initrd.clevis.enable = mkEnableOption (lib.mdDoc "Clevis in initrd"); + + + boot.initrd.clevis.package = mkOption { + type = types.package; + default = pkgs.clevis; + defaultText = "pkgs.clevis"; + description = lib.mdDoc "Clevis package"; + }; + + boot.initrd.clevis.devices = mkOption { + description = "Encrypted devices that need to be unlocked at boot using Clevis"; + default = { }; + type = types.attrsOf (types.submodule ({ + options.secretFile = mkOption { + description = lib.mdDoc "Clevis JWE file used to decrypt the device at boot, in concert with the chosen pin (one of TPM2, Tang server, or SSS)."; + type = types.path; + }; + })); + }; + + boot.initrd.clevis.useTang = mkOption { + description = "Whether the Clevis JWE file used to decrypt the devices uses a Tang server as a pin."; + default = false; + type = types.bool; + }; + + }; + + config = mkIf cfg.enable { + + # Implementation of clevis unlocking for the supported filesystems are located directly in the respective modules. + + + assertions = (attrValues (mapAttrs + (device: _: { + assertion = (any (fs: fs.device == device && (elem fs.fsType supportedFs)) config.system.build.fileSystems) || (hasAttr device config.boot.initrd.luks.devices); + message = '' + No filesystem or LUKS device with the name ${device} is declared in your configuration.''; + }) + cfg.devices)); + + + warnings = + if cfg.useTang && !config.boot.initrd.network.enable && !config.boot.initrd.systemd.network.enable + then [ "In order to use a Tang pinned secret you must configure networking in initrd" ] + else [ ]; + + boot.initrd = { + extraUtilsCommands = mkIf (!systemd.enable) '' + copy_bin_and_libs ${pkgs.jose}/bin/jose + copy_bin_and_libs ${pkgs.curl}/bin/curl + copy_bin_and_libs ${pkgs.bash}/bin/bash + + copy_bin_and_libs ${pkgs.tpm2-tools}/bin/.tpm2-wrapped + mv $out/bin/{.tpm2-wrapped,tpm2} + cp {${pkgs.tpm2-tss},$out}/lib/libtss2-tcti-device.so.0 + + copy_bin_and_libs ${cfg.package}/bin/.clevis-wrapped + mv $out/bin/{.clevis-wrapped,clevis} + + for BIN in ${cfg.package}/bin/clevis-decrypt*; do + copy_bin_and_libs $BIN + done + + for BIN in $out/bin/clevis{,-decrypt{,-null,-tang,-tpm2}}; do + sed -i $BIN -e 's,${pkgs.bash},,' -e 's,${pkgs.coreutils},,' + done + + sed -i $out/bin/clevis-decrypt-tpm2 -e 's,tpm2_,tpm2 ,' + ''; + + secrets = lib.mapAttrs' (name: value: nameValuePair "/etc/clevis/${name}.jwe" value.secretFile) cfg.devices; + + systemd = { + extraBin = mkIf systemd.enable { + clevis = "${cfg.package}/bin/clevis"; + curl = "${pkgs.curl}/bin/curl"; + }; + + storePaths = mkIf systemd.enable [ + cfg.package + "${pkgs.jose}/bin/jose" + "${pkgs.curl}/bin/curl" + "${pkgs.tpm2-tools}/bin/tpm2_createprimary" + "${pkgs.tpm2-tools}/bin/tpm2_flushcontext" + "${pkgs.tpm2-tools}/bin/tpm2_load" + "${pkgs.tpm2-tools}/bin/tpm2_unseal" + ]; + }; + }; + }; +} diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix index ca560d63f3bd..8bd9e71cb3a9 100644 --- a/nixos/modules/system/boot/luksroot.nix +++ b/nixos/modules/system/boot/luksroot.nix @@ -1,9 +1,11 @@ -{ config, options, lib, pkgs, ... }: +{ config, options, lib, utils, pkgs, ... }: with lib; let luks = config.boot.initrd.luks; + clevis = config.boot.initrd.clevis; + systemd = config.boot.initrd.systemd; kernelPackages = config.boot.kernelPackages; defaultPrio = (mkOptionDefault {}).priority; @@ -594,7 +596,7 @@ in ''; type = with types; attrsOf (submodule ( - { name, ... }: { options = { + { config, name, ... }: { options = { name = mkOption { visible = false; @@ -894,6 +896,19 @@ in ''; }; }; + + config = mkIf (clevis.enable && (hasAttr name clevis.devices)) { + preOpenCommands = mkIf (!systemd.enable) '' + mkdir -p /clevis-${name} + mount -t ramfs none /clevis-${name} + clevis decrypt < /etc/clevis/${name}.jwe > /clevis-${name}/decrypted + ''; + keyFile = "/clevis-${name}/decrypted"; + fallbackToPassword = !systemd.enable; + postOpenCommands = mkIf (!systemd.enable) '' + umount /clevis-${name} + ''; + }; })); }; @@ -1081,6 +1096,35 @@ in boot.initrd.preLVMCommands = mkIf (!config.boot.initrd.systemd.enable) (commonFunctions + preCommands + concatStrings (mapAttrsToList openCommand preLVM) + postCommands); boot.initrd.postDeviceCommands = mkIf (!config.boot.initrd.systemd.enable) (commonFunctions + preCommands + concatStrings (mapAttrsToList openCommand postLVM) + postCommands); + boot.initrd.systemd.services = let devicesWithClevis = filterAttrs (device: _: (hasAttr device clevis.devices)) luks.devices; in + mkIf (clevis.enable && systemd.enable) ( + (mapAttrs' + (name: _: nameValuePair "cryptsetup-clevis-${name}" { + wantedBy = [ "systemd-cryptsetup@${utils.escapeSystemdPath name}.service" ]; + before = [ + "systemd-cryptsetup@${utils.escapeSystemdPath name}.service" + "initrd-switch-root.target" + "shutdown.target" + ]; + wants = [ "systemd-udev-settle.service" ] ++ optional clevis.useTang "network-online.target"; + after = [ "systemd-modules-load.service" "systemd-udev-settle.service" ] ++ optional clevis.useTang "network-online.target"; + script = '' + mkdir -p /clevis-${name} + mount -t ramfs none /clevis-${name} + umask 277 + clevis decrypt < /etc/clevis/${name}.jwe > /clevis-${name}/decrypted + ''; + conflicts = [ "initrd-switch-root.target" "shutdown.target" ]; + unitConfig.DefaultDependencies = "no"; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + ExecStop = "${config.boot.initrd.systemd.package.util-linux}/bin/umount /clevis-${name}"; + }; + }) + devicesWithClevis) + ); + environment.systemPackages = [ pkgs.cryptsetup ]; }; } diff --git a/nixos/modules/tasks/filesystems/bcachefs.nix b/nixos/modules/tasks/filesystems/bcachefs.nix index f28fd5cde9c1..639ff87841b6 100644 --- a/nixos/modules/tasks/filesystems/bcachefs.nix +++ b/nixos/modules/tasks/filesystems/bcachefs.nix @@ -57,7 +57,15 @@ let # bcachefs does not support mounting devices with colons in the path, ergo we don't (see #49671) firstDevice = fs: lib.head (lib.splitString ":" fs.device); - openCommand = name: fs: '' + openCommand = name: fs: if config.boot.initrd.clevis.enable && (lib.hasAttr (firstDevice fs) config.boot.initrd.clevis.devices) then '' + if clevis decrypt < /etc/clevis/${firstDevice fs}.jwe | bcachefs unlock ${firstDevice fs} + then + printf "unlocked ${name} using clevis\n" + else + printf "falling back to interactive unlocking...\n" + tryUnlock ${name} ${firstDevice fs} + fi + '' else '' tryUnlock ${name} ${firstDevice fs} ''; diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 72bc79f31b68..fd92a0014002 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -17,6 +17,9 @@ let cfgZED = config.services.zfs.zed; selectModulePackage = package: config.boot.kernelPackages.${package.kernelModuleAttribute}; + clevisDatasets = map (e: e.device) (filter (e: (hasAttr e.device config.boot.initrd.clevis.devices) && e.fsType == "zfs" && (fsNeededForBoot e)) config.system.build.fileSystems); + + inInitrd = any (fs: fs == "zfs") config.boot.initrd.supportedFilesystems; inSystem = any (fs: fs == "zfs") config.boot.supportedFilesystems; @@ -120,12 +123,12 @@ let # but don't *require* it, because mounts shouldn't be killed if it's stopped. # In the future, hopefully someone will complete this: # https://github.com/zfsonlinux/zfs/pull/4943 - wants = [ "systemd-udev-settle.service" ]; + wants = [ "systemd-udev-settle.service" ] ++ optional (config.boot.initrd.clevis.useTang) "network-online.target"; after = [ "systemd-udev-settle.service" "systemd-modules-load.service" "systemd-ask-password-console.service" - ]; + ] ++ optional (config.boot.initrd.clevis.useTang) "network-online.target"; requiredBy = getPoolMounts prefix pool ++ [ "zfs-import.target" ]; before = getPoolMounts prefix pool ++ [ "zfs-import.target" ]; unitConfig = { @@ -154,6 +157,9 @@ let poolImported "${pool}" || poolImport "${pool}" # Try one last time, e.g. to import a degraded pool. fi if poolImported "${pool}"; then + ${concatMapStringsSep "\n" (elem: "clevis decrypt < /etc/clevis/${elem}.jwe | zfs load-key ${elem} || true ") (filter (p: (elemAt (splitString "/" p) 0) == pool) clevisDatasets)} + + ${optionalString keyLocations.hasKeys '' ${keyLocations.command} | while IFS=$'\t' read ds kl ks; do { @@ -623,6 +629,9 @@ in fi poolImported "${pool}" || poolImport "${pool}" # Try one last time, e.g. to import a degraded pool. fi + + ${concatMapStringsSep "\n" (elem: "clevis decrypt < /etc/clevis/${elem}.jwe | zfs load-key ${elem}") (filter (p: (elemAt (splitString "/" p) 0) == pool) clevisDatasets)} + ${if isBool cfgZfs.requestEncryptionCredentials then optionalString cfgZfs.requestEncryptionCredentials '' zfs load-key -a diff --git a/pkgs/tools/security/clevis/default.nix b/pkgs/tools/security/clevis/default.nix index 0498f0599052..fa1be45a5b99 100644 --- a/pkgs/tools/security/clevis/default.nix +++ b/pkgs/tools/security/clevis/default.nix @@ -16,6 +16,7 @@ , ninja , pkg-config , tpm2-tools +, nixosTests }: stdenv.mkDerivation rec { @@ -29,6 +30,12 @@ stdenv.mkDerivation rec { hash = "sha256-3J3ti/jRiv+p3eVvJD7u0ko28rPd8Gte0mCJaVaqyOs="; }; + patches = [ + # Replaces the clevis-decrypt 300s timeout to a 10s timeout + # https://github.com/latchset/clevis/issues/289 + ./tang-timeout.patch + ]; + postPatch = '' for f in $(find src/ -type f); do grep -q "/bin/cat" "$f" && substituteInPlace "$f" \ @@ -65,6 +72,14 @@ stdenv.mkDerivation rec { "man" ]; + passthru.tests = { + inherit (nixosTests.installer) clevisBcachefs clevisBcachefsFallback clevisLuks clevisLuksFallback clevisZfs clevisZfsFallback; + clevisLuksSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisLuks; + clevisLuksFallbackSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisLuksFallback; + clevisZfsSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisZfs; + clevisZfsFallbackSystemdStage1 = nixosTests.installer-systemd-stage-1.clevisZfsFallback; + }; + meta = with lib; { description = "Automated Encryption Framework"; homepage = "https://github.com/latchset/clevis"; diff --git a/pkgs/tools/security/clevis/tang-timeout.patch b/pkgs/tools/security/clevis/tang-timeout.patch new file mode 100644 index 000000000000..454541d5e77c --- /dev/null +++ b/pkgs/tools/security/clevis/tang-timeout.patch @@ -0,0 +1,13 @@ +diff --git a/src/pins/tang/clevis-decrypt-tang b/src/pins/tang/clevis-decrypt-tang +index 72393b4..40b660f 100755 +--- a/src/pins/tang/clevis-decrypt-tang ++++ b/src/pins/tang/clevis-decrypt-tang +@@ -101,7 +101,7 @@ xfr="$(jose jwk exc -i '{"alg":"ECMR"}' -l- -r- <<< "$clt$eph")" + + rec_url="$url/rec/$kid" + ct="Content-Type: application/jwk+json" +-if ! rep="$(curl -sfg -X POST -H "$ct" --data-binary @- "$rec_url" <<< "$xfr")"; then ++if ! rep="$(curl --connect-timeout 10 -sfg -X POST -H "$ct" --data-binary @- "$rec_url" <<< "$xfr")"; then + echo "Error communicating with server $url" >&2 + exit 1 + fi From 3aa4ed098504c16c7a6fc801dc9612253b4f72c6 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Sat, 18 Nov 2023 19:38:08 +0000 Subject: [PATCH 39/39] nixos/tests/installer: init clevis tests Co-Authored-By: Camille Mondon --- nixos/tests/installer-systemd-stage-1.nix | 4 + nixos/tests/installer.nix | 248 ++++++++++++++++++++-- 2 files changed, 237 insertions(+), 15 deletions(-) diff --git a/nixos/tests/installer-systemd-stage-1.nix b/nixos/tests/installer-systemd-stage-1.nix index 1b4c92b584b9..d0c01a779ef1 100644 --- a/nixos/tests/installer-systemd-stage-1.nix +++ b/nixos/tests/installer-systemd-stage-1.nix @@ -32,6 +32,10 @@ stratisRoot swraid zfsroot + clevisLuks + clevisLuksFallback + clevisZfs + clevisZfsFallback ; } diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index e9ec28749850..f7fc168eba8c 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -12,6 +12,7 @@ let # The configuration to install. makeConfig = { bootLoader, grubDevice, grubIdentifier, grubUseEfi , extraConfig, forceGrubReinstallCount ? 0, flake ? false + , clevisTest }: pkgs.writeText "configuration.nix" '' { config, lib, pkgs, modulesPath, ... }: @@ -52,6 +53,15 @@ let boot.initrd.secrets."/etc/secret" = ./secret; + ${optionalString clevisTest '' + boot.kernelParams = [ "console=tty0" "ip=192.168.1.1:::255.255.255.0::eth1:none" ]; + boot.initrd = { + availableKernelModules = [ "tpm_tis" ]; + clevis = { enable = true; useTang = true; }; + network.enable = true; + }; + ''} + users.users.alice = { isNormalUser = true; home = "/home/alice"; @@ -71,7 +81,7 @@ let # partitions and filesystems. testScriptFun = { bootLoader, createPartitions, grubDevice, grubUseEfi, grubIdentifier , postInstallCommands, preBootCommands, postBootCommands, extraConfig - , testSpecialisationConfig, testFlakeSwitch + , testSpecialisationConfig, testFlakeSwitch, clevisTest, clevisFallbackTest }: let iface = "virtio"; isEfi = bootLoader == "systemd-boot" || (bootLoader == "grub" && grubUseEfi); @@ -79,12 +89,16 @@ let in if !isEfi && !pkgs.stdenv.hostPlatform.isx86 then '' machine.succeed("true") '' else '' + import subprocess + tpm_folder = os.environ['NIX_BUILD_TOP'] def assemble_qemu_flags(): flags = "-cpu max" ${if (system == "x86_64-linux" || system == "i686-linux") then ''flags += " -m 1024"'' else ''flags += " -m 768 -enable-kvm -machine virt,gic-version=host"'' } + ${optionalString clevisTest ''flags += f" -chardev socket,id=chrtpm,path={tpm_folder}/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0"''} + ${optionalString clevisTest ''flags += " -device virtio-net-pci,netdev=vlan1,mac=52:54:00:12:11:02 -netdev vde,id=vlan1,sock=\"$QEMU_VDE_SOCKET_1\""''} return flags @@ -110,8 +124,45 @@ let def create_machine_named(name): return create_machine({**default_flags, "name": name}) + class Tpm: + def __init__(self): + self.start() + + def start(self): + self.proc = subprocess.Popen(["${pkgs.swtpm}/bin/swtpm", + "socket", + "--tpmstate", f"dir={tpm_folder}/swtpm", + "--ctrl", f"type=unixio,path={tpm_folder}/swtpm-sock", + "--tpm2" + ]) + + # Check whether starting swtpm failed + try: + exit_code = self.proc.wait(timeout=0.2) + if exit_code is not None and exit_code != 0: + raise Exception("failed to start swtpm") + except subprocess.TimeoutExpired: + pass + + """Check whether the swtpm process exited due to an error""" + def check(self): + exit_code = self.proc.poll() + if exit_code is not None and exit_code != 0: + raise Exception("swtpm process died") + + + os.mkdir(f"{tpm_folder}/swtpm") + tpm = Tpm() + tpm.check() + + start_all() + ${optionalString clevisTest '' + tang.wait_for_unit("sockets.target") + tang.wait_for_unit("network-online.target") + machine.wait_for_unit("network-online.target") + ''} + machine.wait_for_unit("multi-user.target") - machine.start() with subtest("Assert readiness of login prompt"): machine.succeed("echo hello") @@ -127,13 +178,23 @@ let machine.copy_from_host( "${ makeConfig { inherit bootLoader grubDevice grubIdentifier - grubUseEfi extraConfig; + grubUseEfi extraConfig clevisTest; } }", "/mnt/etc/nixos/configuration.nix", ) machine.copy_from_host("${pkgs.writeText "secret" "secret"}", "/mnt/etc/nixos/secret") + ${optionalString clevisTest '' + with subtest("Create the Clevis secret with Tang"): + machine.wait_for_unit("network-online.target") + machine.succeed('echo -n password | clevis encrypt sss \'{"t": 2, "pins": {"tpm2": {}, "tang": {"url": "http://192.168.1.2"}}}\' -y > /mnt/etc/nixos/clevis-secret.jwe')''} + + ${optionalString clevisFallbackTest '' + with subtest("Shutdown Tang to check fallback to interactive prompt"): + tang.shutdown() + ''} + with subtest("Perform the installation"): machine.succeed("nixos-install < /dev/null >&2") @@ -200,7 +261,7 @@ let machine.copy_from_host_via_shell( "${ makeConfig { inherit bootLoader grubDevice grubIdentifier - grubUseEfi extraConfig; + grubUseEfi extraConfig clevisTest; forceGrubReinstallCount = 1; } }", @@ -229,7 +290,7 @@ let machine.copy_from_host_via_shell( "${ makeConfig { inherit bootLoader grubDevice grubIdentifier - grubUseEfi extraConfig; + grubUseEfi extraConfig clevisTest; forceGrubReinstallCount = 2; } }", @@ -303,7 +364,7 @@ let """) machine.copy_from_host_via_shell( "${makeConfig { - inherit bootLoader grubDevice grubIdentifier grubUseEfi extraConfig; + inherit bootLoader grubDevice grubIdentifier grubUseEfi extraConfig clevisTest; forceGrubReinstallCount = 1; flake = true; }}", @@ -379,6 +440,8 @@ let , enableOCR ? false, meta ? {} , testSpecialisationConfig ? false , testFlakeSwitch ? false + , clevisTest ? false + , clevisFallbackTest ? false }: makeTest { inherit enableOCR; @@ -416,13 +479,13 @@ let virtualisation.rootDevice = "/dev/vdb"; virtualisation.bootLoaderDevice = "/dev/vda"; virtualisation.qemu.diskInterface = "virtio"; - - # We don't want to have any networking in the guest whatsoever. - # Also, if any vlans are enabled, the guest will reboot - # (with a different configuration for legacy reasons), - # and spend 5 minutes waiting for the vlan interface to show up - # (which will never happen). - virtualisation.vlans = []; + virtualisation.qemu.options = mkIf (clevisTest) [ + "-chardev socket,id=chrtpm,path=$NIX_BUILD_TOP/swtpm-sock" + "-tpmdev emulator,id=tpm0,chardev=chrtpm" + "-device tpm-tis,tpmdev=tpm0" + ]; + # We don't want to have any networking in the guest apart from the clevis tests. + virtualisation.vlans = mkIf (!clevisTest) []; boot.loader.systemd-boot.enable = mkIf (bootLoader == "systemd-boot") true; @@ -471,7 +534,7 @@ let in [ (pkgs.grub2.override { inherit zfsSupport; }) (pkgs.grub2_efi.override { inherit zfsSupport; }) - ]); + ]) ++ optionals clevisTest [ pkgs.klibc ]; nix.settings = { substituters = mkForce []; @@ -480,12 +543,21 @@ let }; }; + } // optionalAttrs clevisTest { + tang = { + services.tang = { + enable = true; + listenStream = [ "80" ]; + ipAddressAllow = [ "192.168.1.0/24" ]; + }; + networking.firewall.allowedTCPPorts = [ 80 ]; + }; }; testScript = testScriptFun { inherit bootLoader createPartitions postInstallCommands preBootCommands postBootCommands grubDevice grubIdentifier grubUseEfi extraConfig - testSpecialisationConfig testFlakeSwitch; + testSpecialisationConfig testFlakeSwitch clevisTest clevisFallbackTest; }; }; @@ -586,6 +658,145 @@ let zfs = super.zfs.overrideAttrs(_: {meta.platforms = [];});} )]; }; + + mkClevisBcachefsTest = { fallback ? false }: makeInstallerTest "clevis-bcachefs${optionalString fallback "-fallback"}" { + clevisTest = true; + clevisFallbackTest = fallback; + enableOCR = fallback; + extraInstallerConfig = { + imports = [ no-zfs-module ]; + boot.supportedFilesystems = [ "bcachefs" ]; + environment.systemPackages = with pkgs; [ keyutils clevis ]; + }; + createPartitions = '' + machine.succeed( + "flock /dev/vda parted --script /dev/vda -- mklabel msdos" + + " mkpart primary ext2 1M 100MB" + + " mkpart primary linux-swap 100M 1024M" + + " mkpart primary 1024M -1s", + "udevadm settle", + "mkswap /dev/vda2 -L swap", + "swapon -L swap", + "keyctl link @u @s", + "echo -n password | mkfs.bcachefs -L root --encrypted /dev/vda3", + "echo -n password | bcachefs unlock /dev/vda3", + "echo -n password | mount -t bcachefs /dev/vda3 /mnt", + "mkfs.ext3 -L boot /dev/vda1", + "mkdir -p /mnt/boot", + "mount LABEL=boot /mnt/boot", + "udevadm settle") + ''; + extraConfig = '' + boot.initrd.clevis.devices."/dev/vda3".secretFile = "/etc/nixos/clevis-secret.jwe"; + + # We override what nixos-generate-config has generated because we do + # not know the UUID in advance. + fileSystems."/" = lib.mkForce { device = "/dev/vda3"; fsType = "bcachefs"; }; + ''; + preBootCommands = '' + tpm = Tpm() + tpm.check() + '' + optionalString fallback '' + machine.start() + machine.wait_for_text("enter passphrase for") + machine.send_chars("password\n") + ''; + }; + + mkClevisLuksTest = { fallback ? false }: makeInstallerTest "clevis-luks${optionalString fallback "-fallback"}" { + clevisTest = true; + clevisFallbackTest = fallback; + enableOCR = fallback; + extraInstallerConfig = { + environment.systemPackages = with pkgs; [ clevis ]; + }; + createPartitions = '' + machine.succeed( + "flock /dev/vda parted --script /dev/vda -- mklabel msdos" + + " mkpart primary ext2 1M 100MB" + + " mkpart primary linux-swap 100M 1024M" + + " mkpart primary 1024M -1s", + "udevadm settle", + "mkswap /dev/vda2 -L swap", + "swapon -L swap", + "modprobe dm_mod dm_crypt", + "echo -n password | cryptsetup luksFormat -q /dev/vda3 -", + "echo -n password | cryptsetup luksOpen --key-file - /dev/vda3 crypt-root", + "mkfs.ext3 -L nixos /dev/mapper/crypt-root", + "mount LABEL=nixos /mnt", + "mkfs.ext3 -L boot /dev/vda1", + "mkdir -p /mnt/boot", + "mount LABEL=boot /mnt/boot", + "udevadm settle") + ''; + extraConfig = '' + boot.initrd.clevis.devices."crypt-root".secretFile = "/etc/nixos/clevis-secret.jwe"; + ''; + preBootCommands = '' + tpm = Tpm() + tpm.check() + '' + optionalString fallback '' + machine.start() + ${if systemdStage1 then '' + machine.wait_for_text("Please enter") + '' else '' + machine.wait_for_text("Passphrase for") + ''} + machine.send_chars("password\n") + ''; + }; + + mkClevisZfsTest = { fallback ? false }: makeInstallerTest "clevis-zfs${optionalString fallback "-fallback"}" { + clevisTest = true; + clevisFallbackTest = fallback; + enableOCR = fallback; + extraInstallerConfig = { + boot.supportedFilesystems = [ "zfs" ]; + environment.systemPackages = with pkgs; [ clevis ]; + }; + createPartitions = '' + machine.succeed( + "flock /dev/vda parted --script /dev/vda -- mklabel msdos" + + " mkpart primary ext2 1M 100MB" + + " mkpart primary linux-swap 100M 1024M" + + " mkpart primary 1024M -1s", + "udevadm settle", + "mkswap /dev/vda2 -L swap", + "swapon -L swap", + "zpool create -O mountpoint=legacy rpool /dev/vda3", + "echo -n password | zfs create" + + " -o encryption=aes-256-gcm -o keyformat=passphrase rpool/root", + "mount -t zfs rpool/root /mnt", + "mkfs.ext3 -L boot /dev/vda1", + "mkdir -p /mnt/boot", + "mount LABEL=boot /mnt/boot", + "udevadm settle") + ''; + extraConfig = '' + boot.initrd.clevis.devices."rpool/root".secretFile = "/etc/nixos/clevis-secret.jwe"; + boot.zfs.requestEncryptionCredentials = true; + + + # Using by-uuid overrides the default of by-id, and is unique + # to the qemu disks, as they don't produce by-id paths for + # some reason. + boot.zfs.devNodes = "/dev/disk/by-uuid/"; + networking.hostId = "00000000"; + ''; + preBootCommands = '' + tpm = Tpm() + tpm.check() + '' + optionalString fallback '' + machine.start() + ${if systemdStage1 then '' + machine.wait_for_text("Enter key for rpool/root") + '' else '' + machine.wait_for_text("Key load error") + ''} + machine.send_chars("password\n") + ''; + }; + in { # !!! `parted mkpart' seems to silently create overlapping partitions. @@ -1175,6 +1386,13 @@ in { ) ''; }; +} // { + clevisBcachefs = mkClevisBcachefsTest { }; + clevisBcachefsFallback = mkClevisBcachefsTest { fallback = true; }; + clevisLuks = mkClevisLuksTest { }; + clevisLuksFallback = mkClevisLuksTest { fallback = true; }; + clevisZfs = mkClevisZfsTest { }; + clevisZfsFallback = mkClevisZfsTest { fallback = true; }; } // optionalAttrs systemdStage1 { stratisRoot = makeInstallerTest "stratisRoot" { createPartitions = ''