Merge staging-next into staging
This commit is contained in:
@@ -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/<store path>/bin/<name>` 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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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" ];
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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/<store path>/bin/<name> 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/<store path>/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 <https://www.shellcheck.net/wiki/> 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"
|
||||
'' + ''
|
||||
|
||||
@@ -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 = "";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
})
|
||||
|
||||
@@ -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" ];
|
||||
|
||||
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -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" ];
|
||||
|
||||
|
||||
@@ -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=";
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
@@ -30803,7 +30803,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 { };
|
||||
|
||||
|
||||
@@ -8367,6 +8367,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 {
|
||||
@@ -8379,6 +8381,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;
|
||||
};
|
||||
@@ -14022,6 +14026,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 { };
|
||||
@@ -14161,6 +14167,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 { };
|
||||
|
||||
Reference in New Issue
Block a user