From 13b953c8644e7457bf2b429ca14d7367f6eebf85 Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 28 Nov 2024 16:27:36 +0000 Subject: [PATCH 1/7] lib.packagesFromDirectoryRecursive: More precise type signature Pulled above the inputs section to avoid duplicating information. --- lib/filesystem.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/filesystem.nix b/lib/filesystem.nix index 5a78bcca4ebd..2f43792017f9 100644 --- a/lib/filesystem.nix +++ b/lib/filesystem.nix @@ -306,6 +306,16 @@ in As a result, directories with no `.nix` files (including empty directories) will be transformed into empty attribute sets. + # Type + + ``` + packagesFromDirectoryRecursive :: { + callPackage :: Path -> {} -> a, + directory :: Path, + ... + } -> AttrSet + ``` + # Inputs Structured function argument @@ -317,20 +327,10 @@ in : `pkgs.callPackage` - Type: `Path -> AttrSet -> a` - `directory` : The directory to read package files from - Type: `Path` - - - # Type - - ``` - packagesFromDirectoryRecursive :: AttrSet -> AttrSet - ``` # Examples :::{.example} From 75fd236586f263f53ed18378343e243f25640a80 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 2 Dec 2024 19:32:37 +0000 Subject: [PATCH 2/7] sane-airscan: 0.99.29 -> 0.99.30 --- pkgs/by-name/sa/sane-airscan/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/sa/sane-airscan/package.nix b/pkgs/by-name/sa/sane-airscan/package.nix index 83530518aa7d..b4ac219a17e4 100644 --- a/pkgs/by-name/sa/sane-airscan/package.nix +++ b/pkgs/by-name/sa/sane-airscan/package.nix @@ -2,7 +2,7 @@ , libxml2, gnutls, sane-backends }: stdenv.mkDerivation rec { pname = "sane-airscan"; - version = "0.99.29"; + version = "0.99.30"; nativeBuildInputs = [ meson ninja pkg-config ]; buildInputs = [ avahi gnutls libjpeg libpng libxml2 libtiff sane-backends ]; @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { owner = "alexpevzner"; repo = pname; rev = version; - sha256 = "sha256-9ErTC9NztyO9o6y2FjQPl2lu1gICasZYm2tnaCVCLt8="; + sha256 = "sha256-JNgKZZuNRB02c+nOjtFj8L5wDY8ErZcv00nYweYULaM="; }; meta = with lib; { From 781b44b39d1738e544ca0acfe391beda22408c22 Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 28 Nov 2024 16:36:29 +0000 Subject: [PATCH 3/7] lib.packagesFromDirectoryRecursive: document inputs better Cut out redundant boilerplate, explain what the `callPackage` parameter is. Co-authored-by: Valentin Gagarin --- lib/filesystem.nix | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/filesystem.nix b/lib/filesystem.nix index 2f43792017f9..17ca23606f8b 100644 --- a/lib/filesystem.nix +++ b/lib/filesystem.nix @@ -318,18 +318,12 @@ in # Inputs - Structured function argument + `callPackage` + : The function used to convert a Nix file's path into a leaf of the attribute set. + It is typically the `callPackage` function, taken from either `pkgs` or a new scope corresponding to the `directory`. - : Attribute set containing the following attributes. - Additional attributes are ignored. - - `callPackage` - - : `pkgs.callPackage` - - `directory` - - : The directory to read package files from + `directory` + : The directory to read package files from. # Examples From 25bdcd51e86eaee6d5e2a0d908cdd0caa82b2ccd Mon Sep 17 00:00:00 2001 From: nicoo Date: Thu, 28 Nov 2024 16:55:04 +0000 Subject: [PATCH 4/7] lib.packagesFromDirectoryRecursive: Split and explain examples, warn about scope limitation --- lib/filesystem.nix | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/lib/filesystem.nix b/lib/filesystem.nix index 17ca23606f8b..b8ce722dac55 100644 --- a/lib/filesystem.nix +++ b/lib/filesystem.nix @@ -328,7 +328,7 @@ in # Examples :::{.example} - ## `lib.filesystem.packagesFromDirectoryRecursive` usage example + ## Basic use of `lib.packagesFromDirectoryRecursive` ```nix packagesFromDirectoryRecursive { @@ -336,17 +336,48 @@ in directory = ./my-packages; } => { ... } + ``` + In this case, `callPackage` will only search `pkgs` for a file's input parameters. + In other words, a file cannot refer to another file in the directory in its input parameters. + ::: + + ::::{.example} + ## Create a scope for the nix files found in a directory + ```nix lib.makeScope pkgs.newScope ( self: packagesFromDirectoryRecursive { - callPackage = self.callPackage; + inherit (self) callPackage; directory = ./my-packages; } ) => { ... } ``` + For example, take the following directory structure: + ``` + my-packages + ├── a.nix → { b }: assert b ? b1; ... + └── b + ├── b1.nix → { a }: ... + └── b2.nix + ``` + + Here, `b1.nix` can specify `{ a }` as a parameter, which `callPackage` will resolve as expected. + Likewise, `a.nix` receive an attrset corresponding to the contents of the `b` directory. + + :::{.note} + `a.nix` cannot directly take as inputs packages defined in a child directory, such as `b1`. ::: + + :::{.warning} + As of now, `lib.packagesFromDirectoryRecursive` cannot create nested scopes for sub-directories. + + In particular, files under `b/` can only require (as inputs) other files under `my-packages`, + but not to those in the same directory, nor those in a parent directory; e.g, `b2.nix` cannot directly + require `b1`. + ::: + :::: */ packagesFromDirectoryRecursive = { From 8439c49361f43801512a8a5e37dac4b23abdfa8d Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 4 Dec 2024 17:11:21 +0100 Subject: [PATCH 5/7] sage: 10.5.rc0 -> 10.5 --- pkgs/by-name/sa/sage/sage-src.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sa/sage/sage-src.nix b/pkgs/by-name/sa/sage/sage-src.nix index 7b06e7f850c7..1ccc6b8eb587 100644 --- a/pkgs/by-name/sa/sage/sage-src.nix +++ b/pkgs/by-name/sa/sage/sage-src.nix @@ -11,14 +11,14 @@ # all get the same sources with the same patches applied. stdenv.mkDerivation rec { - version = "10.5.rc0"; + version = "10.5"; pname = "sage-src"; src = fetchFromGitHub { owner = "sagemath"; repo = "sage"; rev = version; - hash = "sha256-qjgEgyPOpT/g7D8YNhkqO1EHGNftZnuR5ucLNZBa9Sg="; + hash = "sha256-OiGMc3KyHWnjVWXJ/KiqEQS1skM9nPLYcoMK9kw4718="; }; # contains essential files (e.g., setup.cfg) generated by the bootstrap script. @@ -26,8 +26,8 @@ stdenv.mkDerivation rec { configure-src = fetchurl { # the hash below is the tagged commit's _parent_. it can also be found by looking for # the "configure" asset at https://github.com/sagemath/sage/releases/tag/${version} - url = "mirror://sageupstream/configure/configure-d9c38a7c581e6ed54fbe420122b8bba488b16074.tar.gz"; - hash = "sha256-y1EpsuYK9wloptjeiTew+TZaIUZ2K/NKCbSteojFa4s="; + url = "mirror://sageupstream/configure/configure-f6ad0ecf1f4a269f5954d5487336b13f70624594.tar.gz"; + hash = "sha256-VANtZDUhjOHap9XVEuG/1003E+1XRdXEnuH15hIqJd4="; }; # Patches needed because of particularities of nix or the way this is packaged. @@ -57,6 +57,13 @@ stdenv.mkDerivation rec { # compile libs/gap/element.pyx with -O1 # a more conservative version of https://github.com/sagemath/sage/pull/37951 ./patches/gap-element-crash.patch + + # https://github.com/sagemath/sage/pull/38940, positively reviewed, to land in 10.6.beta0 + (fetchpatch { + name = "simplicial-sets-flaky-test.patch"; + url = "https://github.com/sagemath/sage/commit/1830861c5130d30b891e8c643308e1ceb91ce2b5.diff"; + hash = "sha256-6MbZ+eJPFBEtnJsJX0MgO2AykPXSeuya0W0adiIH+KE="; + }) ]; # Patches needed because of package updates. We could just pin the versions of From 8fb6a2e74df334879b97864ade46c91c02e42a35 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 4 Dec 2024 17:08:46 +0000 Subject: [PATCH 6/7] python312Packages.pulsectl: 24.8.0 -> 24.11.0 --- pkgs/development/python-modules/pulsectl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pulsectl/default.nix b/pkgs/development/python-modules/pulsectl/default.nix index 756826b4500a..51132de4d5f6 100644 --- a/pkgs/development/python-modules/pulsectl/default.nix +++ b/pkgs/development/python-modules/pulsectl/default.nix @@ -12,12 +12,12 @@ buildPythonPackage rec { pname = "pulsectl"; - version = "24.8.0"; + version = "24.11.0"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-sFFQbQ1z08xDV879PeF7uFnX7PAE6ZSw98+oeFG8cVY="; + hash = "sha256-C6MnRdPxmNVlevGffuPrAHr1qGowbsPNRa9C52eCDQ0="; }; patches = [ From 2b6766253ec69951ca59833addaaea99c3b5869c Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Thu, 5 Dec 2024 01:16:55 +0800 Subject: [PATCH 7/7] mpvScripts.modernz: init at 0.2.1 (#360681) --- .../video/mpv/scripts/modernz.nix | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 pkgs/applications/video/mpv/scripts/modernz.nix diff --git a/pkgs/applications/video/mpv/scripts/modernz.nix b/pkgs/applications/video/mpv/scripts/modernz.nix new file mode 100644 index 000000000000..d8488dd5f7c6 --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/modernz.nix @@ -0,0 +1,40 @@ +{ + lib, + buildLua, + fetchFromGitHub, + makeFontsConf, + nix-update-script, +}: +buildLua (finalAttrs: { + pname = "modernx"; + version = "0.2.1"; + + scriptPath = "modernz.lua"; + src = fetchFromGitHub { + owner = "Samillion"; + repo = "ModernZ"; + rev = "v${finalAttrs.version}"; + hash = "sha256-Zk7AC8p14ejsIXwDXladOlQ6jm4NUiU4PxPi5ssBVx8="; + }; + + postInstall = '' + install -Dt $out/share/fonts *.ttf + ''; + + passthru.extraWrapperArgs = [ + "--set" + "FONTCONFIG_FILE" + (toString (makeFontsConf { + fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ]; + })) + ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Sleek and modern OSC for mpv designed to enhance functionality by adding more features, all while preserving the core standards of mpv's OSC"; + homepage = "https://github.com/Samillion/ModernZ"; + license = lib.licenses.lgpl21Plus; + maintainers = with lib.maintainers; [ Guanran928 ]; + }; +})