Commit graph

4612 commits

Author SHA1 Message Date
Atemu 11df41199b nix-prefetch-git: don't fetch everything when given a hash
It's hugely inefficient as we can't use shallow cloning (--depth=1).

This has been tested and adapted for quite a few hosts fetchgit is used on in
Nixpkgs. For those where fetching the hash directly doesn't work (most notably
git.savannah.gnu.org), we simply fall back to the old method.
2021-07-12 20:50:52 +02:00
Alexander Ben Nasrallah c81250a1d3 emacs: fix overrideScope' examples 2021-07-12 16:48:10 +02:00
Simon Bruder ac5cd3a6a2
build-fhs-user-env-bubblewrap: add compatibility for pipewire alsa emulation
The NixOS pipewire module places its alsa compatiblity configuration in
/etc/alsa/conf.d/ instead of /etc/asound.conf. This commit enables
applications running in a bubblewrap fhs environment to use alsa on
systems running pipewire.
2021-07-10 12:50:52 +02:00
pandaman64 c39040195f build-rust-crate: disable incremental builds
According to rustc implementation[1], `-C incremental=no` enables
incremental builds with directory name `no`. This patch removes the
`-C incremental` argument to disable incremental builds.

[1]: ee86f96ba1/compiler/rustc_session/src/options.rs (L918-L919)
2021-07-09 22:55:38 +09:00
github-actions[bot] 958dc88d65
Merge master into staging-next 2021-07-08 12:01:23 +00:00
zowoq 05fe220746 dockerTools.tarsum: use current go 2021-07-08 16:31:33 +10:00
Alyssa Ross 9140d4b06f
emacs.pkgs.melpaBuild: package-build: 2018-10-05 -> 2021-04-13
I think this is due an update.  I've chosen to update to the latest
version that has been merged into Melpa.

Unfortunately we now need to hack around it trying to run VCS
commands.

My Emacs configuration with thirty-something leaf packages seems fine
after the rebuild.
2021-07-06 16:07:13 +00:00
Raphael Megzari 8752c32737 Update pkgs/build-support/setup-hooks/move-docs.sh: remove quote in conditional
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-07-06 09:27:18 +09:00
happysalada 44819162e8 multiple-outputs.sh: remove grep from combined conditional 2021-07-06 09:27:18 +09:00
happysalada 6d52db43d4 setup-hook.sh: use eval for dynamic variable export 2021-07-06 09:27:18 +09:00
happysalada ef76a5e009 autoreconf.sh: define preConfigurePhases before assigning 2021-07-06 09:27:18 +09:00
happysalada 8ebfafbce8 shellcheck: shell=bash 2021-07-06 09:27:18 +09:00
happysalada db37d37d84 reproducible-builds.sh: fatal: += not allowed in assignment
take in account undefined case
assign and export in separate step
https://github.com/koalaman/shellcheck/wiki/SC2155
2021-07-06 09:27:18 +09:00
Raphael Megzari db78412f25 prefer [[ over [ for multiple conditionals
Co-authored-by: Jonas Chevalier <zimbatm@zimbatm.com>
2021-07-06 09:27:18 +09:00
happysalada 2bf424d6cc autopatchelf.sh: add link about grep -q 2021-07-06 09:27:18 +09:00
happysalada a7d7e40c00 move-docs.sh: quote where semanticaly valid 2021-07-06 09:27:18 +09:00
happysalada 4e3d905b0d move-docs.sh: shellcheck 2166
https://github.com/koalaman/shellcheck/wiki/SC2166
2021-07-06 09:27:18 +09:00
Sandro 1619046572
Merge pull request #126894 from Stunkymonkey/pname&version 2021-07-05 18:52:04 +02:00
github-actions[bot] 6cead635ad
Merge master into staging-next 2021-07-03 12:01:23 +00:00
Luke Granger-Brown 48c23a086b dockerTools.pullImage: force disable skopeo's progress bar
skopeo will disable the progress bar if it detects that stdout isn't a
TTY - in order to make it think that stdout _isn't_ a TTY and therefore
avoid it printing a lot of "…" on separate lines, we pipe the output
through cat.

This changes the output from:

…
…
…
…
…
…

to the eminently more useful and less spammy:

Getting image source signatures
Copying blob sha256:[snip]
Copying blob sha256:[snip]
Copying blob sha256:[snip]
Copying config sha256:[snip]
Writing manifest to image destination
Storing signatures
2021-07-03 01:40:38 +00:00
Anders Kaseorg b5160bba86 appimageTools.wrapAppImage: Fix passing arguments to wrapped executable
appimage-exec.sh parses its arguments with getopts, so we need to
delimit arguments intended for the wrapped executable with ‘--’, in
case some of them begin with ‘-’.

Without this fix, a wrapped application like Zulip Desktop can’t be
opened the normal way using the .desktop file, which includes
‘Exec=zulip --no-sandbox %U’ (as per the electron-builder default):

$ gtk-launch zulip.desktop
/usr/bin/appimage-exec.sh: illegal option -- -
Usage: appimage-run [appimage-run options] <AppImage> [AppImage options]
[…]

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2021-07-01 17:16:10 -07:00
Peter Jones 46d4bb5d01
elpaBuild: Delay src evaluation so it can be overridden
This change allows ELPA packages to have their src attribute updated
by overrideAttrs.  Without this change the installPhase references the
original src attribute and overriding is not possible.
2021-06-30 07:54:11 -07:00
Felix Buehler 6f04cd0e69 application/development: /s/name/pname&version/ 2021-06-30 09:55:22 +02:00
github-actions[bot] dcfd9788a1
Merge master into staging-next 2021-06-29 00:10:52 +00:00
Yureka 7f07b70d08 Revert "writers: Allow string paths"
This reverts commit 33ffb05d39.
2021-06-28 22:40:40 +02:00
github-actions[bot] 1016b5a6ba
Merge staging-next into staging 2021-06-27 00:10:43 +00:00
Elis Hirwing 94d07b7492
php: Run nixpkgs-fmt on all php related files 2021-06-26 20:07:56 +02:00
github-actions[bot] 947012b992
Merge staging-next into staging 2021-06-26 00:09:11 +00:00
Robert Schütz d6234c2165 Merge branch 'master' into staging-next 2021-06-26 00:33:58 +02:00
Silvan Mosberger 33ffb05d39 writers: Allow string paths
Before this change, it was not possible to use string paths,
because then the `types.str.check` would succeed. So the only paths that
could be used were ones from the local filesystem via e.g.
`./some/path`.

We can easily fix this by using `types.path.check` instead to determine
whether we are dealing with a path.

This notably also allows using Nix-fetched sources as the content, e.g.
`fetchFromGitHub { ... } + "/some/file"`
2021-06-25 14:39:59 +02:00
Matthew Bauer 8bc10fbc56 Add gcc for emacs wrapper so native-comp works
On macos, we don’t have a gcc executable by default, which is required
for some reason when compiling site-start.
2021-06-23 23:02:11 -05:00
deliciouslytyped a71e906e3a trivial-builders: refactor writeTextFile to be overridable
This fixes #126344, specifically with the goal of enabling overriding the
checkPhase argument. See `design notes` at the end for details.

This allows among other things, enabling bash extension for the `checkPhase`.
Previously using such bash extensions was prohibited by the `writeShellScript`
code because there was no way to enable the extension in the checker.

As an example:

```nix
(writeShellScript "foo" ''
  shopt -s extglob
  echo @(foo|bar)
'').overrideAttrs (old: {
  checkPhase = ''
    # use subshell to preserve outer environment
    (
      export BASHOPTS
      shopt -s extglob
      ${old.checkPhase}
    )
  '';
})
```

This commit also adds tests for this feature to `pkgs/tests/default.nix`,
under `trivial-overriding`. The test code is located at
`pkgs/build-support/trivial-builders/test-overriding.nix`.

Design notes:
-------------

Per discussion with @sternenseemann, the original approach of just wrapping
`writeTextFile` in `makeOverridable` had the issue that combined with `callPackage`
in the following form, would shadow the `.override` attribute of the `writeTextFile`:

```nix
with import <nixpkgs>;
callPackage ({writeShellScript}: writeShellScript "foo" "echo foo")
```

A better approach can be seen in this commit, where `checkPhase` is moved
from an argument of `writeTextFile`, which is substituted into `buildCommand`,
into an `mkDerivation` argument, which is substituted from the environment
and `eval`-ed. (see the source)

This way we can simple use `.overideAttrs` as usual, and this also makes
`checkPhase` a bit more conformant to `mkDerivation` naming, with respect to
phases generally being overridable attrs.

Co-authored-by: sterni <sternenseemann@systemli.org>
Co-authored-by: Naïm Favier <n@monade.li>
2021-06-18 01:39:59 +02:00
Jan Tojnar e3dfa79441
Merge branch 'staging-next' into staging
Regenerated pkgs/servers/x11/xorg/default.nix to resolve the conflict.
2021-06-16 19:59:05 +02:00
github-actions[bot] b08ae54dd9
Merge master into staging-next 2021-06-16 12:04:47 +00:00
Alyssa Ross 508aede4bd skawarePackages.buildPackage: add me as maintainer 2021-06-16 07:59:51 +00:00
github-actions[bot] 9a860729b2
Merge staging-next into staging 2021-06-14 00:08:51 +00:00
github-actions[bot] 13f31f60bf
Merge master into staging-next 2021-06-14 00:08:48 +00:00
Robert Hensing ab11d2114e
Merge pull request #126680 from roberth/empty
emptyFile, emptyDirectory: init
2021-06-13 20:45:21 +02:00
Robert Hensing c38c5dba10 tests.trivial: Add emptyFile, emptyDirectory to samples 2021-06-12 17:29:27 +02:00
Robert Hensing 047fe2fe23 emptyFile, emptyDirectory: init 2021-06-12 17:28:00 +02:00
github-actions[bot] 8e50248719
Merge staging-next into staging 2021-06-11 12:04:41 +00:00
github-actions[bot] 212846c302
Merge master into staging-next 2021-06-11 12:04:38 +00:00
superherointj 15807923f9 build-support.ocaml.dune: handle minimalOCamlVersion typo 2021-06-11 11:08:12 +02:00
Alyssa Ross 926765c5e3
Merge remote-tracking branch 'nixpkgs/staging-next' into staging
Conflicts:
	pkgs/servers/http/apache-httpd/2.4.nix
2021-06-11 02:05:00 +00:00
github-actions[bot] dcfc502458
Merge master into staging-next 2021-06-11 00:09:47 +00:00
Théo Zimmermann 489959099f mkCoqDerivation: fix useDune2 2021-06-10 21:52:03 +02:00
Jan Tojnar ba733d435b
Merge branch 'staging-next' into staging 2021-06-10 14:07:45 +02:00
github-actions[bot] 51dce04dde
Merge master into staging-next 2021-06-10 12:05:05 +00:00
Robert Hensing 76f53eef48
Merge pull request #125223 from hercules-ci/fix-dockerTools-example-fetch-sha
nixosTests.docker-tools: Fix nixFromDockerHub example sha
2021-06-10 10:10:18 +02:00
github-actions[bot] da8d931c82
Merge master into staging-next 2021-06-10 06:07:24 +00:00
AndersonTorres e9e5f5f84d Change all alsaLib references to alsa-lib 2021-06-10 01:12:49 -03:00
github-actions[bot] e40e33d9d8
Merge staging-next into staging 2021-06-08 18:16:30 +00:00
github-actions[bot] e8f8906d68
Merge master into staging-next 2021-06-08 18:16:27 +00:00
sternenseemann 3bc8e5cd23 tests.writers: use dashes instead of underscores in drv names
This is more in line with standard derivation name policy in nixpkgs.
2021-06-08 14:06:41 +02:00
sternenseemann f46a1e353a tests.writers: give all test derivations unique names
This makes it easier to debug test failures since the derivation name
will give an indication which writer it belongs to.
2021-06-08 14:06:41 +02:00
github-actions[bot] 59ab4de3e0
Merge staging-next into staging 2021-06-08 00:19:01 +00:00
github-actions[bot] 45dbaf4c3d
Merge master into staging-next 2021-06-08 00:18:58 +00:00
Luke Granger-Brown 840f6883fc
Merge pull request #126034 from lukegb/bazel-build-configured
Switch buildBazelPackage fetchConfigured on by default
2021-06-07 23:59:33 +01:00
github-actions[bot] 5b7fbb07b8
Merge staging-next into staging 2021-06-07 18:48:37 +00:00
github-actions[bot] 1593cddce5
Merge master into staging-next 2021-06-07 18:48:34 +00:00
Alyssa Ross 1dcba17714
wrapBintoolsWith: fix final stage NetBSD
Fixes "bintools" on NetBSD -- without this only the version in stdenv
would work, not the one from the final stage.

Andi tried to warn me about this[1].  Andi, I'm sorry for doubting you.

[1]: https://github.com/NixOS/nixpkgs/pull/124499#discussion_r641949801
2021-06-07 11:49:31 +00:00
Luke Granger-Brown cfd38a4006 buildBazelPackage: set fetchConfigured default to true 2021-06-07 02:04:01 +00:00
Luke Granger-Brown bc260c31f1 buildBazelPackage: don't fail if the marker file doesn't exist
This was the intent of my previous change, but it didn't quite work
because the pipeline still exits false even if the file doesn't exist.
Oops.
2021-06-06 21:18:56 +00:00
github-actions[bot] 0397e518b7
Merge staging-next into staging 2021-06-05 18:30:31 +00:00
github-actions[bot] d9d6f71e43
Merge master into staging-next 2021-06-05 18:30:28 +00:00
Jörg Thalheim 8b5175012b
Merge pull request #125804 from Mic92/build-fhs-userenv
buildFhsUserenv: don't leak mounts to other processes
2021-06-05 18:03:11 +02:00
Jörg Thalheim 43908f4c1d
buildFhsUserenv: don't leak mounts to other processes
If run as root we were leaking mounts to the parent namespace,
which lead to an error when removing the temporary mountroot.
To fix this we remount the whole tree as private as soon as we created
the new mountenamespace.
2021-06-05 16:47:44 +02:00
Antoine Fontaine c4b3aa6260 build-support/make-desktopitem: add some missing fields 2021-06-04 17:48:46 +02:00
github-actions[bot] cf75c491be
Merge staging-next into staging 2021-06-02 20:25:08 +00:00
github-actions[bot] 825cffa5ae
Merge master into staging-next 2021-06-02 20:25:05 +00:00
Robert Hensing 1834bc8711
Merge pull request #125216 from hercules-ci/follow-up-115491
dockerTools: Fix passthru image tag
2021-06-02 16:58:49 +02:00
github-actions[bot] ffe6577d05
Merge staging-next into staging 2021-06-01 20:30:47 +00:00
github-actions[bot] 42b70ad7f1
Merge master into staging-next 2021-06-01 20:30:45 +00:00
Sandro bc64755cfa
Merge pull request #124603 from mjsir911/msirabella/peclCheck
php.buildPecl: Add checkPhase
2021-06-01 16:34:42 +02:00
Robert Hensing d155b8c438 nixosTests.docker-tools: Fix nixFromDockerHub example sha
For https://github.com/NixOS/nixpkgs/pull/125211 I tried to test
the fetcher with

    nix-build -A dockerTools.examples.nixFromDockerHub --option substitute false

But it failed. I haven't figured out the cause, but the outputs
match, so it's probably the hashing method (flat/recursive) that
changed at some point. (The names did match.)
2021-06-01 15:13:03 +02:00
Robert Hensing 7f6a395070
Merge pull request #125211 from edwtjo/docker-fetch-wotls
build-support/docker: pass tlsVerify to support http registries
2021-06-01 15:07:48 +02:00
Robert Hensing ff55c41fac dockerTools: Fix passthru image tag
It should match the actual image tag.
This fixes the problem introduced in 00996b5e03
https://github.com/NixOS/nixpkgs/pull/115491#pullrequestreview-672789901
2021-06-01 14:42:21 +02:00
Edward Tjörnhammar ab4649e9d1
build-support/docker: pass tlsVerify to support http registries 2021-06-01 14:34:24 +02:00
github-actions[bot] abef57f931
Merge staging-next into staging 2021-05-31 19:44:15 +00:00
github-actions[bot] 7f14676873
Merge master into staging-next 2021-05-31 19:44:13 +00:00
Maciej Krüger ef555f6a0b
Merge pull request #123426 from mattchrist/brscan5 2021-05-31 17:52:16 +02:00
Alyssa Ross 35a0e15ff6 bintools: fix dynamic linker for NetBSD cross
This will fail with an assertion error on native NetBSD, but it
wouldn't have worked anyway.  We can fix that later.
2021-05-31 14:59:14 +00:00
John Ericson 603f80066e bintools-wrapper: Add sharedLibraryLoader parameter
This is used instead of `libc_lib` in case the shared library loader /
"interpreter" is not provided by the libc derivation.
2021-05-31 14:59:14 +00:00
github-actions[bot] 6a8c64f062
Merge staging-next into staging 2021-05-31 12:54:46 +00:00
github-actions[bot] 5bf27cf89e
Merge master into staging-next 2021-05-31 12:54:42 +00:00
Sandro 03fa8708ec
Merge pull request #124544 from Mic92/vmtools 2021-05-31 11:54:16 +02:00
github-actions[bot] 5c859b2875
Merge staging-next into staging 2021-05-28 12:48:43 +00:00
github-actions[bot] f2a2e8f5e9
Merge master into staging-next 2021-05-28 12:48:40 +00:00
lsix 7731f618b7
Merge pull request #124299 from dotlambda/qmapshack-1.16.0
GIS: random bumps
2021-05-28 13:46:44 +01:00
Daniël de Kok 1da0b1dbc9
Merge pull request #122158 from danieldk/import-cargo-lock
rustPlatform.buildRustPackage: support direct use of Cargo.lock
2021-05-28 12:07:25 +02:00
github-actions[bot] 2a3a7f2e86
Merge staging-next into staging 2021-05-28 07:06:01 +00:00
github-actions[bot] da374ab551
Merge master into staging-next 2021-05-28 07:05:58 +00:00
Daniël de Kok d3769e43c3 rustPlatform.importCargoLock: add test cases for importCargoLock 2021-05-28 08:01:28 +02:00
Daniël de Kok b3969f3ad7 rustPlatform.buildRustPackage: support direct use of Cargo.lock
This change introduces the cargoLock argument to buildRustPackage,
which can be used in place of cargo{Sha256,Hash} or cargoVendorDir. It
uses the importCargoLock function to build the vendor
directory. Differences compared to cargo{Sha256,Hash}:

- Requires a Cargo.lock file.
- Does not require a Cargo hash.
- Retrieves all dependencies as fixed-output derivations.

This makes buildRustPackage much easier to use as part of a Rust
project, since it does not require updating cargo{Sha256,Hash} for
every change to the lock file.
2021-05-28 08:01:28 +02:00
Daniël de Kok 2f46d77e28 rustPlatform.importCargoLock: init
This function can be used to create an output path that is a cargo
vendor directory. In contrast to e.g. fetchCargoTarball all the
dependent crates are fetched using fixed-output derivations. The
hashes for the fixed-output derivations are gathered from the
Cargo.lock file.

Usage is very simple, e.g.:

importCargoLock {
  lockFile = ./Cargo.lock;
}

would use the lockfile from the current directory.

The implementation of this function is based on Eelco Dolstra's
import-cargo:

https://github.com/edolstra/import-cargo/blob/master/flake.nix

Compared to upstream:

- We use fetchgit in place of builtins.fetchGit.
- Sync to current cargo vendoring.
2021-05-28 08:01:25 +02:00
Marco Sirabella 3a66432f26
php.buildPecl: Add checkPhase
Also update phpPackages' to use NO_INTERACTION
2021-05-27 12:19:14 -04:00
Robert Schütz f96cff58df fetchFromGitea: init 2021-05-27 09:35:56 +02:00
Jörg Thalheim eb0034927d
vmTools: update current maintained debian versions
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-05-27 07:33:11 +02:00
Jörg Thalheim e71c4f4628
vmTools: update current lts versions of ubuntu 2021-05-26 23:12:26 +02:00
Robert Hensing 5259d66b74 dockerTools: Allow omitting all store paths
Adds includeStorePaths, allowing the omission of the store paths.
You generally want to leave it on, but tooling may disable this
to insert the store paths more efficiently via other means, such
as bind mounting the host store.
2021-05-26 15:11:42 +02:00