diff --git a/doc/build-helpers/trivial-build-helpers.chapter.md b/doc/build-helpers/trivial-build-helpers.chapter.md index 4648c7985542..384e25035060 100644 --- a/doc/build-helpers/trivial-build-helpers.chapter.md +++ b/doc/build-helpers/trivial-build-helpers.chapter.md @@ -502,9 +502,14 @@ concatScript "my-file" [ file1 file2 ] ## `writeShellApplication` {#trivial-builder-writeShellApplication} -This can be used to easily produce a shell script that has some dependencies (`runtimeInputs`). It automatically sets the `PATH` of the script to contain all of the listed inputs, sets some sanity shellopts (`errexit`, `nounset`, `pipefail`), and checks the resulting script with [`shellcheck`](https://github.com/koalaman/shellcheck). +`writeShellApplication` is similar to `writeShellScriptBin` and `writeScriptBin` but supports runtime dependencies with `runtimeInputs`. +Writes an executable shell script to `/nix/store//bin/` and checks its syntax with [`shellcheck`](https://github.com/koalaman/shellcheck) and the `bash`'s `-n` option. +Some basic Bash options are set by default (`errexit`, `nounset`, and `pipefail`), but can be overridden with `bashOptions`. -For example, look at the following code: +Extra arguments may be passed to `stdenv.mkDerivation` by setting `derivationArgs`; note that variables set in this manner will be set when the shell script is _built,_ not when it's run. +Runtime environment variables can be set with the `runtimeEnv` argument. + +For example, the following shell application can refer to `curl` directly, rather than needing to write `${curl}/bin/curl`: ```nix writeShellApplication { @@ -518,10 +523,6 @@ writeShellApplication { } ``` -Unlike with normal `writeShellScriptBin`, there is no need to manually write out `${curl}/bin/curl`, setting the PATH -was handled by `writeShellApplication`. Moreover, the script is being checked with `shellcheck` for more strict -validation. - ## `symlinkJoin` {#trivial-builder-symlinkJoin} This can be used to put many derivations into the same directory structure. It works by creating a new derivation and adding symlinks to each of the paths listed. It expects two arguments, `name`, and `paths`. `name` is the name used in the Nix store path for the created derivation. `paths` is a list of paths that will be symlinked. These paths can be to Nix store derivations or any other subdirectory contained within. diff --git a/lib/fileset/internal.nix b/lib/fileset/internal.nix index 4059d2e24426..f4fcc83e1012 100644 --- a/lib/fileset/internal.nix +++ b/lib/fileset/internal.nix @@ -5,6 +5,7 @@ let isAttrs isPath isString + nixVersion pathExists readDir split @@ -17,6 +18,7 @@ let attrNames attrValues mapAttrs + optionalAttrs zipAttrsWith ; @@ -56,6 +58,7 @@ let substring stringLength hasSuffix + versionAtLeast ; inherit (lib.trivial) @@ -840,6 +843,10 @@ rec { # https://github.com/NixOS/nix/commit/55cefd41d63368d4286568e2956afd535cb44018 _fetchGitSubmodulesMinver = "2.4"; + # Support for `builtins.fetchGit` with `shallow = true` was introduced in 2.4 + # https://github.com/NixOS/nix/commit/d1165d8791f559352ff6aa7348e1293b2873db1c + _fetchGitShallowMinver = "2.4"; + # Mirrors the contents of a Nix store path relative to a local path as a file set. # Some notes: # - The store path is read at evaluation time. @@ -894,7 +901,17 @@ rec { # However a simpler alternative still would be [a builtins.gitLsFiles](https://github.com/NixOS/nix/issues/2944). fetchResult = fetchGit ({ url = path; - } // extraFetchGitAttrs); + } + # In older Nix versions, repositories were always assumed to be deep clones, which made `fetchGit` fail for shallow clones + # For newer versions this was fixed, but the `shallow` flag is required. + # The only behavioral difference is that for shallow clones, `fetchGit` doesn't return a `revCount`, + # which we don't need here, so it's fine to always pass it. + + # Unfortunately this means older Nix versions get a poor error message for shallow repositories, and there's no good way to improve that. + # Checking for `.git/shallow` doesn't seem worth it, especially since that's more of an implementation detail, + # and would also require more code to handle worktrees where `.git` is a file. + // optionalAttrs (versionAtLeast nixVersion _fetchGitShallowMinver) { shallow = true; } + // extraFetchGitAttrs); in # We can identify local working directories by checking for .git, # see https://git-scm.com/docs/gitrepository-layout#_description. diff --git a/lib/fileset/tests.sh b/lib/fileset/tests.sh index e809aef6935a..af8338eb7855 100755 --- a/lib/fileset/tests.sh +++ b/lib/fileset/tests.sh @@ -1439,6 +1439,19 @@ if [[ -n "$fetchGitSupportsSubmodules" ]]; then fi rm -rf -- * +# shallow = true is not supported on all Nix versions +# and older versions don't support shallow clones at all +if [[ "$(nix-instantiate --eval --expr "$prefixExpression (versionAtLeast builtins.nixVersion _fetchGitShallowMinver)")" == true ]]; then + createGitRepo full + # Extra commit such that there's a commit that won't be in the shallow clone + git -C full commit --allow-empty -q -m extra + git clone -q --depth 1 "file://${PWD}/full" shallow + cd shallow + checkGitTracked + cd .. + rm -rf -- * +fi + # Go through all stages of Git files # See https://www.git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 3d85cb2e684a..64db85e00369 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -66,6 +66,12 @@ github = "0b11stan"; githubId = 27831931; }; + _0nyr = { + email = "onyr.maintainer@gmail.com"; + github = "0nyr"; + githubId = 47721040; + name = "Florian Rascoussier"; + }; _0qq = { email = "0qqw0qqw@gmail.com"; github = "0qq"; @@ -4392,6 +4398,15 @@ githubId = 3179832; name = "D. Bohdan"; }; + dbrgn = { + email = "nix@dbrgn.ch"; + github = "dbrgn"; + githubId = 105168; + name = "Danilo B."; + keys = [{ + fingerprint = "20EE 002D 778A E197 EF7D 0D2C B993 FF98 A90C 9AB1"; + }]; + }; dbrock = { email = "daniel@brockman.se"; github = "dbrock"; diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index f236a4c005ad..a7399bd55e77 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -2989,15 +2989,9 @@ let systemd.services.systemd-networkd = { wantedBy = [ "initrd.target" ]; - # These before and conflicts lines can be removed when this PR makes it into a release: - # https://github.com/systemd/systemd/pull/27791 - before = ["initrd-switch-root.target"]; - conflicts = ["initrd-switch-root.target"]; }; systemd.sockets.systemd-networkd = { wantedBy = [ "initrd.target" ]; - before = ["initrd-switch-root.target"]; - conflicts = ["initrd-switch-root.target"]; }; systemd.services.systemd-network-generator.wantedBy = [ "sysinit.target" ]; diff --git a/pkgs/applications/audio/grandorgue/default.nix b/pkgs/applications/audio/grandorgue/default.nix index 9856b81c92b8..6ca3f39a9dc0 100644 --- a/pkgs/applications/audio/grandorgue/default.nix +++ b/pkgs/applications/audio/grandorgue/default.nix @@ -1,18 +1,34 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, fftwFloat, alsa-lib -, zlib, wavpack, wxGTK32, udev, jackaudioSupport ? false, libjack2 -, imagemagick, libicns, makeWrapper, Cocoa -, includeDemo ? true }: +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, fftwFloat +, alsa-lib +, zlib +, wavpack +, wxGTK32 +, udev +, jackaudioSupport ? false +, libjack2 +, imagemagick +, libicns +, yaml-cpp +, makeWrapper +, Cocoa +, includeDemo ? true +}: stdenv.mkDerivation rec { pname = "grandorgue"; - version = "3.11.0"; + version = "3.14.0"; src = fetchFromGitHub { owner = "GrandOrgue"; repo = pname; rev = version; fetchSubmodules = true; - sha256 = "sha256-l1KqER/vkNwgKLXIFUzHnYLw2ivGNP7hRiKhIOzn7pw="; + hash = "sha256-kPz11V2yNmBe80egNLYxh/m2B1nDca3C5sGbEnrkqnw="; }; postPatch = '' @@ -24,7 +40,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config imagemagick libicns makeWrapper ]; - buildInputs = [ fftwFloat zlib wavpack wxGTK32 ] + buildInputs = [ fftwFloat zlib wavpack wxGTK32 yaml-cpp ] ++ lib.optionals stdenv.isLinux [ alsa-lib udev ] ++ lib.optionals stdenv.isDarwin [ Cocoa ] ++ lib.optional jackaudioSupport libjack2; @@ -53,5 +69,6 @@ stdenv.mkDerivation rec { license = lib.licenses.gpl2Plus; platforms = lib.platforms.unix; maintainers = [ lib.maintainers.puzzlewolf ]; + mainProgram = "GrandOrgue"; }; } diff --git a/pkgs/applications/misc/remarkable/restream/default.nix b/pkgs/applications/misc/remarkable/restream/default.nix index 9af70769e3d9..c5958aff724c 100644 --- a/pkgs/applications/misc/remarkable/restream/default.nix +++ b/pkgs/applications/misc/remarkable/restream/default.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "restream"; - version = "1.2.0"; + version = "1.3.1"; src = fetchFromGitHub { owner = "rien"; repo = pname; - rev = version; - sha256 = "0vyj0kng8c9inv2rbw1qdr43ic15s5x8fvk9mbw0vpc6g723x99g"; + rev = "v${version}"; + hash = "sha256-AXHKOfdIM3LsHF6u3M/lMhhcuPZADoEal7de3zlx7L4="; }; dontConfigure = true; diff --git a/pkgs/applications/networking/ipfs-cluster/default.nix b/pkgs/applications/networking/ipfs-cluster/default.nix index cecb3ce3b03b..19a1b38eed42 100644 --- a/pkgs/applications/networking/ipfs-cluster/default.nix +++ b/pkgs/applications/networking/ipfs-cluster/default.nix @@ -2,15 +2,15 @@ buildGoModule rec { pname = "ipfs-cluster"; - version = "1.0.7"; + version = "1.0.8"; - vendorHash = "sha256-/Kjm/hM+lKsZ6fzStDyOitp7Vtt7Vb8ak7E/W0lbW20="; + vendorHash = "sha256-uwDXUy9mh/DvLuwj8Htm55wla5/JjvZH5ztJbqnox+U="; src = fetchFromGitHub { owner = "ipfs-cluster"; repo = "ipfs-cluster"; rev = "v${version}"; - hash = "sha256-eBbbD77nnjcumhrsixAlI09B1ZAxK5IOHoBeJGgj+TY="; + hash = "sha256-qZUoYJjw3Qac7Kmg5PfNWTDM8Ra3rqrbjScLbK6FRx4="; }; meta = with lib; { diff --git a/pkgs/applications/virtualization/runc/default.nix b/pkgs/applications/virtualization/runc/default.nix index 38ec1e6244da..71ff22032cb5 100644 --- a/pkgs/applications/virtualization/runc/default.nix +++ b/pkgs/applications/virtualization/runc/default.nix @@ -14,13 +14,13 @@ buildGoModule rec { pname = "runc"; - version = "1.1.11"; + version = "1.1.12"; src = fetchFromGitHub { owner = "opencontainers"; repo = "runc"; rev = "v${version}"; - hash = "sha256-3LZWidINg15Aqoswml/BY7ZmLvz0XsbtYV5Cx8h5lpM="; + hash = "sha256-N77CU5XiGYIdwQNPFyluXjseTeaYuNJ//OsEUS0g/v0="; }; vendorHash = null; diff --git a/pkgs/build-support/trivial-builders/default.nix b/pkgs/build-support/trivial-builders/default.nix index 9643c9ba048e..a38231bdcaa3 100644 --- a/pkgs/build-support/trivial-builders/default.nix +++ b/pkgs/build-support/trivial-builders/default.nix @@ -152,19 +152,21 @@ rec { , meta ? { } , allowSubstitutes ? false , preferLocalBuild ? true + , derivationArgs ? { } # Extra arguments to pass to `stdenv.mkDerivation` }: let matches = builtins.match "/bin/([^/]+)" destination; in runCommand name - { + ({ inherit text executable checkPhase allowSubstitutes preferLocalBuild; - passAsFile = [ "text" ]; + passAsFile = [ "text" ] + ++ derivationArgs.passAsFile or [ ]; meta = lib.optionalAttrs (executable && matches != null) { mainProgram = lib.head matches; - } // meta; - } + } // meta // derivationArgs.meta or {}; + } // removeAttrs derivationArgs [ "passAsFile" "meta" ]) '' target=$out${lib.escapeShellArg destination} mkdir -p "$(dirname "$target")" @@ -238,53 +240,94 @@ rec { meta.mainProgram = name; }; - /* - Similar to writeShellScriptBin and writeScriptBin. - Writes an executable Shell script to /nix/store//bin/ and - checks its syntax with shellcheck and the shell's -n option. - Individual checks can be foregone by putting them in the excludeShellChecks - list, e.g. [ "SC2016" ]. - Automatically includes sane set of shellopts (errexit, nounset, pipefail) - and handles creation of PATH based on runtimeInputs - - Note that the checkPhase uses stdenv.shell for the test run of the script, - while the generated shebang uses runtimeShell. If, for whatever reason, - those were to mismatch you might lose fidelity in the default checks. - - Example: - - Writes my-file to /nix/store//bin/my-file and makes executable. - - - writeShellApplication { - name = "my-file"; - runtimeInputs = [ curl w3m ]; - text = '' - curl -s 'https://nixos.org' | w3m -dump -T text/html - ''; - } - - */ + # See doc/build-helpers/trivial-build-helpers.chapter.md + # or https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-text-writing writeShellApplication = - { name - , text - , runtimeInputs ? [ ] - , meta ? { } - , checkPhase ? null - , excludeShellChecks ? [ ] + { + /* + The name of the script to write. + + Type: String + */ + name, + /* + The shell script's text, not including a shebang. + + Type: String + */ + text, + /* + Inputs to add to the shell script's `$PATH` at runtime. + + Type: [String|Derivation] + */ + runtimeInputs ? [ ], + /* + Extra environment variables to set at runtime. + + Type: AttrSet + */ + runtimeEnv ? null, + /* + `stdenv.mkDerivation`'s `meta` argument. + + Type: AttrSet + */ + meta ? { }, + /* + The `checkPhase` to run. Defaults to `shellcheck` on supported + platforms and `bash -n`. + + The script path will be given as `$target` in the `checkPhase`. + + Type: String + */ + checkPhase ? null, + /* + Checks to exclude when running `shellcheck`, e.g. `[ "SC2016" ]`. + + See for a list of checks. + + Type: [String] + */ + excludeShellChecks ? [ ], + /* + Bash options to activate with `set -o` at the start of the script. + + Defaults to `[ "errexit" "nounset" "pipefail" ]`. + + Type: [String] + */ + bashOptions ? [ "errexit" "nounset" "pipefail" ], + /* Extra arguments to pass to `stdenv.mkDerivation`. + + :::{.caution} + Certain derivation attributes are used internally, + overriding those could cause problems. + ::: + + Type: AttrSet + */ + derivationArgs ? { }, }: writeTextFile { - inherit name meta; + inherit name meta derivationArgs; executable = true; destination = "/bin/${name}"; allowSubstitutes = true; preferLocalBuild = false; text = '' #!${runtimeShell} - set -o errexit - set -o nounset - set -o pipefail - '' + lib.optionalString (runtimeInputs != [ ]) '' + ${lib.concatMapStringsSep "\n" (option: "set -o ${option}") bashOptions} + '' + lib.optionalString (runtimeEnv != null) + (lib.concatStrings + (lib.mapAttrsToList + (name: value: '' + ${lib.toShellVar name value} + export ${name} + '') + runtimeEnv)) + + lib.optionalString (runtimeInputs != [ ]) '' export PATH="${lib.makeBinPath runtimeInputs}:$PATH" '' + '' diff --git a/pkgs/build-support/trivial-builders/test/writeShellApplication.nix b/pkgs/build-support/trivial-builders/test/writeShellApplication.nix index 6ce6f0720fcf..c50f5a4d283f 100644 --- a/pkgs/build-support/trivial-builders/test/writeShellApplication.nix +++ b/pkgs/build-support/trivial-builders/test/writeShellApplication.nix @@ -1,29 +1,141 @@ -/* - Run with: - - cd nixpkgs - nix-build -A tests.trivial-builders.writeShellApplication -*/ - -{ lib, writeShellApplication, runCommand }: +# Run with: +# nix-build -A tests.trivial-builders.writeShellApplication +{ writeShellApplication +, writeTextFile +, runCommand +, lib +, linkFarm +, diffutils +, hello +}: let - pkg = writeShellApplication { - name = "test-script"; + checkShellApplication = args@{name, expected, ...}: + let + writeShellApplicationArgs = builtins.removeAttrs args ["expected"]; + script = writeShellApplication writeShellApplicationArgs; + executable = lib.getExe script; + expected' = writeTextFile { + name = "${name}-expected"; + text = expected; + }; + actual = "${name}-actual"; + in + runCommand name { } '' + echo "Running test executable ${name}" + ${executable} > ${actual} + echo "Got output from test executable:" + cat ${actual} + echo "Checking test output against expected output:" + ${diffutils}/bin/diff --color --unified ${expected'} ${actual} + touch $out + ''; +in +linkFarm "writeShellApplication-tests" { + test-meta = + let + script = writeShellApplication { + name = "test-meta"; + text = ""; + meta.description = "A test for the `writeShellApplication` `meta` argument."; + }; + in + assert script.meta.mainProgram == "test-meta"; + assert script.meta.description == "A test for the `writeShellApplication` `meta` argument."; + script; + + test-runtime-inputs = + checkShellApplication { + name = "test-runtime-inputs"; + text = '' + hello + ''; + runtimeInputs = [ hello ]; + expected = "Hello, world!\n"; + }; + + test-runtime-env = + checkShellApplication { + name = "test-runtime-env"; + runtimeEnv = { + MY_COOL_ENV_VAR = "my-cool-env-value"; + MY_OTHER_COOL_ENV_VAR = "my-other-cool-env-value"; + # Check that we can serialize a bunch of different types: + BOOL = true; + INT = 1; + LIST = [1 2 3]; + MAP = { + a = "a"; + b = "b"; + }; + }; + text = '' + echo "$MY_COOL_ENV_VAR" + echo "$MY_OTHER_COOL_ENV_VAR" + ''; + expected = '' + my-cool-env-value + my-other-cool-env-value + ''; + }; + + test-check-phase = + checkShellApplication { + name = "test-check-phase"; + text = ""; + checkPhase = '' + echo "echo -n hello" > $target + ''; + expected = "hello"; + }; + + test-argument-forwarding = + checkShellApplication { + name = "test-argument-forwarding"; + text = ""; + derivationArgs.MY_BUILD_TIME_VARIABLE = "puppy"; + derivationArgs.postCheck = '' + if [[ "$MY_BUILD_TIME_VARIABLE" != puppy ]]; then + echo "\$MY_BUILD_TIME_VARIABLE is not set to 'puppy'!" + exit 1 + fi + ''; + meta.description = "A test checking that `writeShellApplication` forwards extra arguments to `stdenv.mkDerivation`."; + expected = ""; + }; + + test-exclude-shell-checks = writeShellApplication { + name = "test-exclude-shell-checks"; excludeShellChecks = [ "SC2016" ]; text = '' - echo -e '#!/usr/bin/env bash\n' \ - 'echo "$SHELL"' > /tmp/something.sh # this line would normally - # ...cause shellcheck error + # Triggers SC2016: Expressions don't expand in single quotes, use double + # quotes for that. + echo '$SHELL' ''; }; -in - assert pkg.meta.mainProgram == "test-script"; - runCommand "test-writeShellApplication" { } '' - echo Testing if writeShellApplication builds without shellcheck error... + test-bash-options-pipefail = checkShellApplication { + name = "test-bash-options-pipefail"; + text = '' + touch my-test-file + echo puppy | grep doggy | sed 's/doggy/puppy/g' + # ^^^^^^^^^^ This will fail. + true + ''; + # Don't use `pipefail`: + bashOptions = ["errexit" "nounset"]; + expected = ""; + }; - target=${lib.getExe pkg} - - touch $out - '' + test-bash-options-nounset = checkShellApplication { + name = "test-bash-options-nounset"; + text = '' + echo -n "$someUndefinedVariable" + ''; + # Don't use `nounset`: + bashOptions = []; + # Don't warn about the undefined variable at build time: + excludeShellChecks = [ "SC2154" ]; + expected = ""; + }; +} diff --git a/pkgs/by-name/as/ast-grep/package.nix b/pkgs/by-name/as/ast-grep/package.nix index cbc30af9e69a..67afe28bc346 100644 --- a/pkgs/by-name/as/ast-grep/package.nix +++ b/pkgs/by-name/as/ast-grep/package.nix @@ -6,16 +6,16 @@ rustPlatform.buildRustPackage rec { pname = "ast-grep"; - version = "0.17.0"; + version = "0.18.1"; src = fetchFromGitHub { owner = "ast-grep"; repo = "ast-grep"; rev = version; - hash = "sha256-/lWvFYSE4gFbVPlJMROGcb86mVviGdh1tFAY74qTTX4="; + hash = "sha256-hr6VAqBsv3szVClR93y5ickkrNKjvl6BfzqKA3zc6vM="; }; - cargoHash = "sha256-r1vfh2JtBjWFgXrijlFxPyRr8LRAIogiA2TZHI5MJRM="; + cargoHash = "sha256-ttJMtaQfVnFj4/wUz4fn8X/EmUwW+usqhmWhy4Y0AB8="; # Work around https://github.com/NixOS/nixpkgs/issues/166205. env = lib.optionalAttrs stdenv.cc.isClang { diff --git a/pkgs/by-name/ga/galerio/package.nix b/pkgs/by-name/ga/galerio/package.nix new file mode 100644 index 000000000000..aa1075f81a75 --- /dev/null +++ b/pkgs/by-name/ga/galerio/package.nix @@ -0,0 +1,23 @@ +{ lib, fetchFromGitHub, rustPlatform }: + +rustPlatform.buildRustPackage rec { + pname = "galerio"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "dbrgn"; + repo = "galerio"; + rev = "v${version}"; + hash = "sha256-JR/YfMUs5IHBRr3uYqHXLNcr23YHyDvgH2y/1ip+2Y8="; + }; + + cargoHash = "sha256-nYaCN09LP/2MfNRY8oZKtjzFCBFCeRF1IZ2ZBmbHg7I="; + + meta = with lib; { + description = " A simple generator for self-contained HTML flexbox galleries"; + homepage = "https://github.com/dbrgn/galerio"; + maintainers = with maintainers; [ dbrgn ]; + license = with licenses; [ asl20 mit ]; + mainProgram = "galerio"; + }; +} diff --git a/pkgs/by-name/in/invidtui/package.nix b/pkgs/by-name/in/invidtui/package.nix index a0def40e132c..81402026b127 100644 --- a/pkgs/by-name/in/invidtui/package.nix +++ b/pkgs/by-name/in/invidtui/package.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "invidtui"; - version = "0.3.7"; + version = "0.3.8"; src = fetchFromGitHub { owner = "darkhz"; repo = "invidtui"; rev = "refs/tags/v${version}"; - hash = "sha256-bzstO6xaVdu7u1vBgwUjnJ9CEep0UHT73FbybBRd8y8="; + hash = "sha256-m2ygORf6GIJZXYYJKy6i12wDEkxQywtYdCutHeiyNYY="; }; - vendorHash = "sha256-F0Iyy8H6ZRYiAlMdYGQS2p2hFN9ICmfTiRP/F9kpW7c="; + vendorHash = "sha256-HQ6JHXiqawDwSV48/Czbao4opnuz1LqIBdcObrkCfNs="; doCheck = true; diff --git a/pkgs/by-name/ot/oterm/package.nix b/pkgs/by-name/ot/oterm/package.nix index 34f79d96d949..bb4e829b3397 100644 --- a/pkgs/by-name/ot/oterm/package.nix +++ b/pkgs/by-name/ot/oterm/package.nix @@ -5,13 +5,13 @@ python3Packages.buildPythonApplication rec { pname = "oterm"; - version = "0.1.21"; + version = "0.1.22"; pyproject = true; src = fetchFromGitHub { owner = "ggozad"; repo = "oterm"; rev = "refs/tags/${version}"; - hash = "sha256-S6v7VDIGPu6UDbDe0H3LWF6IN0Z6ENmiCDxz+GuCibI="; + hash = "sha256-hRbPlRuwM3NspTNd3mPhVxPJl8zA9qyFwDGNKH3Slag="; }; pythonRelaxDeps = [ diff --git a/pkgs/by-name/pd/pdfannots2json/package.nix b/pkgs/by-name/pd/pdfannots2json/package.nix new file mode 100644 index 000000000000..01c30fe1fb52 --- /dev/null +++ b/pkgs/by-name/pd/pdfannots2json/package.nix @@ -0,0 +1,25 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +let + pname = "pdfannots2json"; + version = "1.0.16"; +in + buildGoModule { + inherit pname version; + + src = fetchFromGitHub { + owner = "mgmeyers"; + repo = "pdfannots2json"; + rev = "refs/tags/${version}"; + sha256 = "sha256-qk4OSws/6SevN/Q0lsyxw+fZkm2uy1WwOYYL7CB7QUk="; + }; + + vendorHash = null; + + meta = with lib; { + homepage = "https://github.com/mgmeyers/pdfannots2json"; + license = licenses.agpl3; + description = "A tool to convert PDF annotations to JSON"; + maintainers = with maintainers; [ _0nyr ]; + }; + } diff --git a/pkgs/by-name/pu/pupdate/package.nix b/pkgs/by-name/pu/pupdate/package.nix index 0f1968270cab..01a1a99bac5d 100644 --- a/pkgs/by-name/pu/pupdate/package.nix +++ b/pkgs/by-name/pu/pupdate/package.nix @@ -12,13 +12,13 @@ buildDotnetModule rec { pname = "pupdate"; - version = "3.1.0"; + version = "3.2.0"; src = fetchFromGitHub { owner = "mattpannella"; repo = "${pname}"; rev = "${version}"; - hash = "sha256-wIYqEtbQZsj9gq5KaLhd+sEnrKHBHzA9jWR+9dGDQ0s="; + hash = "sha256-9u1CKxWohGj7Gm3BrC2tpoQAY1r3cpP8OIePo+g7ETo="; }; buildInputs = [ diff --git a/pkgs/by-name/re/renode-unstable/package.nix b/pkgs/by-name/re/renode-unstable/package.nix index b733a10bd7ba..4b63b039cd85 100644 --- a/pkgs/by-name/re/renode-unstable/package.nix +++ b/pkgs/by-name/re/renode-unstable/package.nix @@ -7,10 +7,10 @@ inherit buildUnstable; }).overrideAttrs (finalAttrs: _: { pname = "renode-unstable"; - version = "1.14.0+20240106git1b3952c2c"; + version = "1.14.0+20240119git1a0826937"; src = fetchurl { url = "https://builds.renode.io/renode-${finalAttrs.version}.linux-portable.tar.gz"; - hash = "sha256-tDo/01jYoq1Qg8h0BS4BQSPh3rsINpe72eMk9UBWgR0="; + hash = "sha256-bv5+6DVzBFt5XeKcLJFpUHB5T1RKCNi/CuXXpIn6e9k="; }; }) diff --git a/pkgs/by-name/ux/uxn/package.nix b/pkgs/by-name/ux/uxn/package.nix index 4933591ba3f9..2bc851ff764b 100644 --- a/pkgs/by-name/ux/uxn/package.nix +++ b/pkgs/by-name/ux/uxn/package.nix @@ -7,13 +7,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "uxn"; - version = "unstable-2024-01-15"; + version = "unstable-2024-01-21"; src = fetchFromSourcehut { owner = "~rabbits"; repo = "uxn"; - rev = "8212ca5edb55a28976515a73fcb454f18eb44a09"; - hash = "sha256-K/qTKSGt/sFHt0lfUbwa/Y2XlWst30q1aKvsm4sjrLc="; + rev = "3e1183285a94a0930c9b09fd4fa73ac3a5d24fda"; + hash = "sha256-hhxcj/jVBOm7E63Z9sS3SnFjexQEXVtw3QU5n/4hkVI="; }; outputs = [ "out" "projects" ]; diff --git a/pkgs/development/python-modules/nipreps-versions/default.nix b/pkgs/development/python-modules/nipreps-versions/default.nix new file mode 100644 index 000000000000..1c54ab9d905e --- /dev/null +++ b/pkgs/development/python-modules/nipreps-versions/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, flit-scm +, packaging +, setuptools-scm +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "nipreps-versions"; + version = "1.0.4"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "nipreps"; + repo = "version-schemes"; + rev = "refs/tags/${version}"; + hash = "sha256-B2wtLurzgk59kTooH51a2dewK7aEyA0dAm64Wp+tqhM="; + }; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + flit-scm + setuptools-scm + ]; + + propagatedBuildInputs = [ + packaging + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + pythonImportsCheck = [ "nipreps_versions" ]; + + meta = with lib; { + description = "Setuptools_scm plugin for nipreps version schemes"; + homepage = "https://github.com/nipreps/version-schemes"; + changelog = "https://github.com/nipreps/version-schemes/blob/${src.rev}/CHANGES.md"; + license = licenses.asl20; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/python-modules/niworkflows/default.nix b/pkgs/development/python-modules/niworkflows/default.nix new file mode 100644 index 000000000000..494a834c937a --- /dev/null +++ b/pkgs/development/python-modules/niworkflows/default.nix @@ -0,0 +1,101 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, hatch-vcs +, hatchling +, pytestCheckHook +, attrs +, importlib-resources +, jinja2 +, looseversion +, matplotlib +, nibabel +, nilearn +, nipype +, nitransforms +, numpy +, packaging +, pandas +, pybids +, pyyaml +, scikit-image +, scipy +, seaborn +, svgutils +, templateflow +, traits +, transforms3d +}: + +buildPythonPackage rec { + pname = "niworkflows"; + version = "1.10.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "nipreps"; + repo = "niworkflows"; + rev = "refs/tags/${version}"; + hash = "sha256-wQPk9imDvomg+NTWk+VeW1TE2QlvMyi1YYVVaznhktU="; + }; + + postPatch = '' + substituteInPlace pyproject.toml --replace '"traits < 6.4"' '"traits"' + ''; + + nativeBuildInputs = [ + hatch-vcs + hatchling + ]; + + propagatedBuildInputs = [ + attrs + importlib-resources + jinja2 + looseversion + matplotlib + nibabel + nilearn + nipype + nitransforms + numpy + packaging + pandas + pybids + pyyaml + scikit-image + scipy + seaborn + svgutils + templateflow + traits + transforms3d + ]; + + env.SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeCheckInputs = [ pytestCheckHook ]; + preCheck = ''export HOME=$(mktemp -d)''; + pytestFlagsArray = [ "niworkflows" ]; + # try to download data: + disabledTests = [ + "test_GenerateCifti" + "ROIsPlot" + "ROIsPlot2" + "test_SimpleShowMaskRPT" + "test_cifti_surfaces_plot" + "niworkflows.utils.misc.get_template_specs" + "niworkflows.interfaces.cifti._prepare_cifti" + ]; + disabledTestPaths = [ "niworkflows/tests/test_registration.py" ]; + + pythonImportsCheck = [ "niworkflows" ]; + + meta = with lib; { + description = "Common workflows for MRI (anatomical, functional, diffusion, etc.)"; + homepage = "https://github.com/nipreps/niworkflows"; + changelog = "https://github.com/nipreps/niworkflows/blob/${src.rev}/CHANGES.rst"; + license = licenses.asl20; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/python-modules/svgutils/default.nix b/pkgs/development/python-modules/svgutils/default.nix new file mode 100644 index 000000000000..ea2c7c547e43 --- /dev/null +++ b/pkgs/development/python-modules/svgutils/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, lxml +, matplotlib +, pytestCheckHook +, nose +}: + +buildPythonPackage rec { + pname = "svgutils"; + version = "0.3.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "btel"; + repo = "svg_utils"; + rev = "refs/tags/v${version}"; + hash = "sha256-ITvZx+3HMbTyaRmCb7tR0LKqCxGjqDdV9/2taziUD0c="; + }; + + nativeBuildInputs = [ setuptools ]; + + propagatedBuildInputs = [ + lxml + matplotlib + ]; + + nativeCheckInputs = [ pytestCheckHook nose ]; + + pythonImportsCheck = [ "svgutils" ]; + + meta = with lib; { + description = "Python tools to create and manipulate SVG files"; + homepage = "https://github.com/btel/svg_utils"; + license = licenses.mit; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/python-modules/templateflow/default.nix b/pkgs/development/python-modules/templateflow/default.nix new file mode 100644 index 000000000000..c879b7064d0f --- /dev/null +++ b/pkgs/development/python-modules/templateflow/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +, pytestCheckHook +, setuptools-scm +, nipreps-versions +, pybids +, requests +, tqdm +}: + +buildPythonPackage rec { + pname = "templateflow"; + version = "23.1.0"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "templateflow"; + repo = "python-client"; + rev = "refs/tags/${version}"; + hash = "sha256-8AdXC1IFGfYZ5cvCAyBz0tD3zia+KBILX0tL9IcO2NA="; + }; + + nativeBuildInputs = [ setuptools-scm ]; + propagatedBuildInputs = [ + nipreps-versions + pybids + requests + tqdm + ]; + + doCheck = false; # most tests try to download data + #pythonImportsCheck = [ "templateflow" ]; # touches $HOME/.cache, hence needs https://github.com/NixOS/nixpkgs/pull/120300 + + meta = with lib; { + homepage = "https://templateflow.org/python-client"; + description = "Python API to query TemplateFlow via pyBIDS"; + changelog = "https://github.com/templateflow/python-client/releases/tag/${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ bcdarwin ]; + }; +} diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix index 591eaeaa1ae2..d851aa217b5f 100644 --- a/pkgs/development/tools/misc/strace/default.nix +++ b/pkgs/development/tools/misc/strace/default.nix @@ -1,12 +1,12 @@ -{ lib, stdenv, fetchurl, perl, libunwind, buildPackages, gitUpdater }: +{ lib, stdenv, fetchurl, perl, libunwind, buildPackages, gitUpdater, elfutils }: stdenv.mkDerivation rec { pname = "strace"; - version = "6.6"; + version = "6.7"; src = fetchurl { url = "https://strace.io/files/${version}/${pname}-${version}.tar.xz"; - sha256 = "sha256-QhtBhsBrcFFj5k3IXycevc9nZgr4ZnKDFH1ehZ/IqWw="; + sha256 = "sha256-IJAgHho/8yhG9P5CHBFjsV9EC7OOMTVdCfgtOUmSKvc="; }; depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { # On RISC-V platforms, LLVM's libunwind implementation is unsupported by strace. # The build will silently fall back and -k will not work on RISC-V. - buildInputs = [ libunwind ]; # support -k + buildInputs = [ libunwind elfutils ]; # support -k and -kk configureFlags = [ "--enable-mpers=check" ]; diff --git a/pkgs/development/tools/turso-cli/default.nix b/pkgs/development/tools/turso-cli/default.nix index 4c9da1e13f14..09f96c2d183a 100644 --- a/pkgs/development/tools/turso-cli/default.nix +++ b/pkgs/development/tools/turso-cli/default.nix @@ -8,13 +8,13 @@ }: buildGoModule rec { pname = "turso-cli"; - version = "0.88.2"; + version = "0.88.3"; src = fetchFromGitHub { owner = "tursodatabase"; repo = "turso-cli"; rev = "v${version}"; - hash = "sha256-9lnqjkDGQRu487Me895h/dyWDIVImQkU9bEiafjTbb8="; + hash = "sha256-tPeoLGYJRMXFVI09fupspdQMSMjF2Trdo2GlkoWs7wA="; }; vendorHash = "sha256-rTeW2RQhcdwJTAMQELm4cdObJbm8gk/I2Qz3Wk3+zpI="; diff --git a/pkgs/servers/sabnzbd/default.nix b/pkgs/servers/sabnzbd/default.nix index 5601ae2f7d0f..a7035426fdf9 100644 --- a/pkgs/servers/sabnzbd/default.nix +++ b/pkgs/servers/sabnzbd/default.nix @@ -47,14 +47,14 @@ let ]); path = lib.makeBinPath [ coreutils par2cmdline-turbo unrar unzip p7zip util-linux ]; in stdenv.mkDerivation rec { - version = "4.2.1"; + version = "4.2.2"; pname = "sabnzbd"; src = fetchFromGitHub { owner = pname; repo = pname; rev = version; - sha256 = "sha256-M9DvwizNeCXkV07dkgiComdjoceUACCuccZb+y9RMdw="; + sha256 = "sha256-e5MjsBFUeQ1FMgMIuTDAmAUqf9BaM+ic2qpd1GVZEAw="; }; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/tools/admin/salt/default.nix b/pkgs/tools/admin/salt/default.nix index 2c2d9f840180..a08e4c5a812a 100644 --- a/pkgs/tools/admin/salt/default.nix +++ b/pkgs/tools/admin/salt/default.nix @@ -11,12 +11,12 @@ python3.pkgs.buildPythonApplication rec { pname = "salt"; - version = "3006.5"; + version = "3006.6"; format = "setuptools"; src = fetchPypi { inherit pname version; - hash = "sha256-b5aH8lQt3ICEsXy0fwpMr9SJQBI7o+1XMfaqgf5/lz4="; + hash = "sha256-X6tojYa3Dh6ExRtMqlZfNnGVBQaBPDcp1EQIzC9a+8M="; }; patches = [ diff --git a/pkgs/tools/misc/mise/default.nix b/pkgs/tools/misc/mise/default.nix index 12acc61f9e24..9c0fec19d647 100644 --- a/pkgs/tools/misc/mise/default.nix +++ b/pkgs/tools/misc/mise/default.nix @@ -17,16 +17,16 @@ rustPlatform.buildRustPackage rec { pname = "mise"; - version = "2024.1.30"; + version = "2024.1.35"; src = fetchFromGitHub { owner = "jdx"; repo = "mise"; rev = "v${version}"; - hash = "sha256-1MvnxH+6xN7uQAhf2OEO+OjBISUSiTrYtfdulSe8Cxg="; + hash = "sha256-U5L66cZXgvKLQKTYIAKWcYVs5IV4OKegKxYvLr83g8k="; }; - cargoHash = "sha256-Hm8cpj0tk5bQ4NBHPGf6Fwpwq6zGJEwfE6psDkenxCQ="; + cargoHash = "sha256-Hn6uDDA/RJ9d5s3bLsR90Gd8mahYwnBmkkJ3ToGwpyM="; nativeBuildInputs = [ installShellFiles pkg-config ]; buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6710e1f22c60..e2cdc3a51cec 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30806,7 +30806,7 @@ with pkgs; clapper = callPackage ../applications/video/clapper { }; - claws-mail = disable-warnings-if-gcc13 (callPackage ../applications/networking/mailreaders/claws-mail { }); + claws-mail = callPackage ../applications/networking/mailreaders/claws-mail { }; cligh = python3Packages.callPackage ../development/tools/github/cligh { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bbe47854459b..c46adcf249fd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8373,6 +8373,8 @@ self: super: with self; { ninja = callPackage ../development/python-modules/ninja { inherit (pkgs) ninja; }; + nipreps-versions = callPackage ../development/python-modules/nipreps-versions { }; + nipy = callPackage ../development/python-modules/nipy { }; nipype = callPackage ../development/python-modules/nipype { @@ -8385,6 +8387,8 @@ self: super: with self; { nitransforms = callPackage ../development/python-modules/nitransforms { }; + niworkflows = callPackage ../development/python-modules/niworkflows { }; + nix-kernel = callPackage ../development/python-modules/nix-kernel { inherit (pkgs) nix; }; @@ -14026,6 +14030,8 @@ self: super: with self; { svgelements = callPackage ../development/python-modules/svgelements { }; + svgutils = callPackage ../development/python-modules/svgutils { }; + svgwrite = callPackage ../development/python-modules/svgwrite { }; sv-ttk = callPackage ../development/python-modules/sv-ttk { }; @@ -14165,6 +14171,8 @@ self: super: with self; { tempita = callPackage ../development/python-modules/tempita { }; + templateflow = callPackage ../development/python-modules/templateflow { }; + tempora = callPackage ../development/python-modules/tempora { }; tenacity = callPackage ../development/python-modules/tenacity { };