1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-24 11:19:35 +01:00
Commit graph

10866 commits

Author SHA1 Message Date
John Axel Eriksson
f4ab2cb7fb docker: fix image so that nix profile works
nix profile will otherwise throw this error:

error: path '/nix/var/nix/profiles/default/manifest.nix' is not in the Nix store

That's not entirely true since manifest.nix is within a directory in
the nix store but nix profile seems to require the manifest.nix itself
to be a store path.
2021-12-17 00:03:37 +01:00
Eelco Dolstra
71e7940937
Merge pull request #5784 from NixOS/backport-docker-stuff-to-2.4
Backport docker stuff to 2.4
2021-12-16 13:10:37 +01:00
John Ericson
066f990d0a
Make docker.nix match Nixpkgs's idioms
1. `target` is the wrong name, that is just for compilers per out
standard terminology. We just need to worry about "build" and "host".

2. We only need one `pkgs`. `pkgs.buildPackages` is how we get anything
we need at build time.

3. `crossSystem` is the name of a nixpkgs parameter that is actually an
attribute set, not a 2-part "cpu-os" string.

3. `pkgsCross` effectively evaluates Nixpkgs twice, which is
inefficient. It is just there for people poking around the CLI / REPL
(and I am skeptical even that is a good idea), and *not* what written
code should use, especially code that is merely parametric in the package set
it is given.

4. We don't need to memoize Nixpkgs here because we are only doing one
pkg set at a time (no `genAttrs`) so it's better to just delete all this
stuff. `flake.nix` instead would do something like that, with
`genAttrs` (though without `pkgsCross`), if and when we have hydra jobs
for cross builds.
2021-12-15 12:57:45 +01:00
Eelco Dolstra
06ce280a15
docker.nix: Use 'with'
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-12-15 12:57:39 +01:00
Rok Garbas
7039cae78a
Docker image with Nix inside 2021-12-15 12:57:30 +01:00
Eelco Dolstra
46a959510b
Merge pull request #5755 from obsidiansystems/2.4-improve-tests
[backport 2.4] Recent merged testsuite improvements
2021-12-15 11:47:33 +01:00
Eelco Dolstra
cf2198d7b0 Respect /etc/hosts
https://hydra.nixos.org/build/161439329
(cherry picked from commit e2e5f3a78f)
2021-12-13 21:15:43 +01:00
John Ericson
9c15e151de Fix testing the other daemon
The eventual PATH entry needs the `.../bin` or we will not use the right
daemon.

(cherry picked from commit 06fb6aecea)
2021-12-09 16:11:38 +00:00
regnat
d0527aac1b Make the post-build-hook use the daemon Nix package
Having the `post-build-hook` use `nix` from the client package can lead
to a deadlock in case there’s a db migration to do between both, as a
`nix` command running inside the hook will run as root (and as such will
bypass the daemon), so might trigger a db migration, which will get
stuck trying to get a global lock on the DB (as the daemon that ran the
hook already has a lock on it).

(cherry picked from commit 93eadd5803)
2021-12-09 16:10:53 +00:00
Eelco Dolstra
86829056fa
Merge pull request #5742 from jtojnar/manual-links-backport
[Backport] Update manual links
2021-12-07 22:05:31 +01:00
Eelco Dolstra
671cd216ff
Merge pull request #5721 from obsidiansystems/fix-5299-backport
Backport #5696 to 2.4
2021-12-07 21:50:44 +01:00
Jan Tojnar
2346eeaa80 Update manual links
Fixes: https://github.com/NixOS/nixos-homepage/issues/762

(cherry picked from commit ae21aab456)
2021-12-07 14:50:12 +01:00
Eelco Dolstra
27672031e9
Merge pull request #5734 from NixOS/backport-5259-nix-shell-with-ca-bash
[Backport] Make `nix-shell` work when nixpkgs is content-addressed
2021-12-06 16:21:53 +01:00
regnat
ee06da923b Make nix-shell work when nixpkgs is content-addressed
Fix #5259
2021-12-06 10:16:35 +01:00
John Ericson
2f92f231de Fix #5299
No matter what, we need to resize the buffer to not have any scratch
space after we do the `read`. In the end of file case, `got` will be 0
from it's initial value.

Before, we forgot to resize in the EOF case with the break. Yes, we know
we didn't recieve any data in that case, but we still have the scatch
space to undo.

Co-Authored-By: Will Fancher <Will.Fancher@Obsidian.Systems>
2021-11-30 17:18:33 -05:00
John Ericson
2f916acf2f Push wopAddToStore old style stream adapters into smaller scopes
This doesn't fix the bug, but makes the code less difficult to read.
Also improve the comments, now that it is clear what part is needed in
each code path.
2021-11-30 17:18:33 -05:00
John Ericson
946098a3e0 Nix daemon stream old wopAddToStore
No more buffering in string.
2021-11-30 17:18:33 -05:00
Eelco Dolstra
49de63fc2a
Merge pull request #5689 from tomberek/backport_man_page
[backport 2.4] reproducibility: deterministic man page output for cores
2021-11-30 10:13:04 +01:00
Tom Bereknyei
b9f18b9e3f reproducibility: determinstic man page output for cores 2021-11-29 22:57:45 -05:00
Eelco Dolstra
d02069772d
Merge pull request #5658 from baloo/baloo/dns-2.4
preloadNSS: rework the dns query workaround [nix2.4]
2021-11-26 12:48:02 +01:00
Arthur Gautier
1fdd536402 preloadNSS: rework the dns query workaround
backport of https://github.com/NixOS/nix/pull/5384 to nix 2.4
2021-11-25 13:04:09 -08:00
Eelco Dolstra
015215ff95
Merge pull request #5655 from NixOS/backport-scp-uris-fix
Backport #5580
2021-11-25 15:49:02 +01:00
Kalle Jepsen
9b258d2f98 Simplify fix by disallowing / in front of @ to match scp style 2021-11-25 14:52:32 +01:00
Kalle Jepsen
23ba64b277 Fix detection of scp-style URIs to support non-standard SSH ports for git 2021-11-25 14:52:32 +01:00
Eelco Dolstra
ef1193a273
Merge pull request #5606 from NixOS/backport-5585-to-2.4-maintenance
[Backport 2.4-maintenance] doc: De-emphasize nix-env without -A
2021-11-23 15:35:23 +01:00
Eelco Dolstra
47787a17b2
Merge pull request #5635 from NixOS/backport-5634-to-2.4-maintenance
[Backport 2.4-maintenance] Add missing Nix::Store import to fix nix-serve StoreDir.
2021-11-23 15:34:59 +01:00
Ben Radford
9008602f03 Add missing Nix::Store import to fix nix-serve StoreDir.
(cherry picked from commit 861404a87b)
2021-11-23 14:29:52 +00:00
Eelco Dolstra
16de2b464f
Merge pull request #5629 from matthewbauer/2.4-fix-oahd-path
Backport to 2.4: fix oahd path
2021-11-23 10:46:33 +01:00
Matthew Bauer
ceabe106c8 Set new rosetta 2 path in sandbox
see:

https://github.com/NixOS/nix/pull/5388

and

https://github.com/NixOS/nix/pull/5251
(cherry picked from commit 08b1ac3e38)
2021-11-22 14:44:32 -06:00
yvt
a9d122dcd8 Add another path where a Rosetta 2 configuration file is possibly located
(cherry picked from commit a9d9e55551)
2021-11-22 14:44:20 -06:00
Jan Tojnar
49f63b9d60 doc: De-emphasize nix-env without -A
The manual uses `nix-env -i` without `-A` prominently, teaching a bad practice to newcomers.

(cherry picked from commit ca4d8ce9e2)
2021-11-19 10:47:45 +00:00
Eelco Dolstra
8d12084707 Bump version 2021-11-05 13:22:23 +01:00
Eelco Dolstra
9fade47584
Merge pull request #5490 from doronbehar/SQLiteWAL-vfs-backport2.4
libstore: Use unix-dotfile vfs if useSQLiteWAL is false
2021-11-05 13:21:55 +01:00
Doron Behar
734f46fb46 libstore: Use unix-dotfile vfs if useSQLiteWAL is false
(cherry picked from commit 14fcf17277)
2021-11-05 13:20:34 +01:00
Doron Behar
c1b8271ed1 libstore: Use unix-dotfile vfs if useSQLiteWAL is false 2021-11-04 08:15:18 +02:00
Eelco Dolstra
dd5bdbd8d0
Merge pull request #5470 from andersk/2.4-echo-e
[2.4] installer: Do not use echo -e in #!/bin/sh script
2021-11-03 11:16:08 +01:00
Anders Kaseorg
4fc29974a4 installer: Do not use echo -e in #!/bin/sh script
ShellCheck correctly warns:

In scripts/install-nix-from-closure.sh line 218:
                echo -e "\nif [ -e $p ]; then . $p; fi # added by Nix installer" >> "$fn"
                     ^-- SC3037: In POSIX sh, echo flags are undefined.

In scripts/install-nix-from-closure.sh line 229:
                echo -e "\nif [ -e $p ]; then . $p; fi # added by Nix installer" >> "$fn"
                     ^-- SC3037: In POSIX sh, echo flags are undefined.

Indeed, this actually breaks on Ubuntu where /bin/sh is dash.

Fixes #5458.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
(cherry picked from commit 447350fe0e)
2021-11-02 17:25:31 -07:00
Domen Kožar
1f0edcedc0 install-nix-actionv@v14.1
(cherry picked from commit b8532c9ff1)
2021-11-02 17:25:31 -07:00
regnat
45a2ef5a6d Disable the eval-store test when using the daemon
Using the daemon will break most of the assumptions of this test, so
it’s as simple to just disable it

(cherry picked from commit 0b55c8767d)
2021-11-02 17:25:08 -07:00
Eelco Dolstra
93d0a99f8b
Fix 2.4 migration examples
(cherry picked from commit 6a93e186f4)
2021-11-02 11:54:03 +01:00
Eelco Dolstra
9d5c985aed Set 2.4 release date
(cherry picked from commit bc4b7521f4)
2021-11-01 20:22:46 +01:00
Alexey Novikov
b84c4c0770 Fix error detection in 'base64Decode()'
Fixed a bug in initialization of 'base64DecodeChars' variable.
Currently decoder do not fail on invalid Base64 strings.
Added test-case to verify the fix.

Also have made 'base64DecodeChars' to be computed at compile time.
And added a test case to encode/decode string with non-printable charactes.

(cherry picked from commit 64a3b045c1)
2021-11-01 15:26:42 +01:00
Eelco Dolstra
64484c4da3 Remove redundant 'warning:'
(cherry picked from commit 5a160171d0)
2021-11-01 15:25:37 +01:00
Eelco Dolstra
506339f5a9 Set version to 2.4 2021-11-01 15:23:33 +01:00
Eelco Dolstra
ff695dd150 nix repl: Don't write to std::cout directly
Writing to std::cout doesn't play nice with ProgressBar.

(cherry picked from commit f6cdae5181)
2021-10-27 17:40:28 +02:00
Eelco Dolstra
0cf2815007 nix repl: Don't build in a child process
Fixes #5356. This is a bit risky due to interrupts, but we have to
deal with those anyway (#5353).

(cherry picked from commit 9ebe02a81e)
2021-10-27 17:40:23 +02:00
Maximilian Bosch
8867e65128 nix repl: properly deal with interruptions
When I stop a download with Ctrl-C in a `nix repl` of a flake, the REPL
refuses to do any other downloads:

    nix-repl> builtins.getFlake "nix-serve"
    [0.0 MiB DL] downloading 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca41 error: download of 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca416e5a9415d4972b0f0' was interrupted
    [0.0 MiB DL]
    nix-repl> builtins.getFlake "nix-serve"
    error: interrupted by the user
    [0.0 MiB DL]

To fix this issue, two changes were necessary:

* Reset the global `_isInterrupted` variable: only because a single
  operation was aborted, it should still be possible to continue the
  session.
* Recreate a `fileTransfer`-instance if the current one was shut down by
  an abort.

(cherry picked from commit 0872659002)
2021-10-27 17:39:35 +02:00
kvtb
20624d9a3b fix build with gcc11
(cherry picked from commit eae29b0385)
2021-10-27 17:36:34 +02:00
regnat
577470728c Fix the isDaemonNewer check
- Don’t hardcode the “newer” version
- Remove an ill-placed `return`

(cherry picked from commit 3a2fc9ce1d)
2021-10-27 17:36:26 +02:00
regnat
cf266f34ac Fix the min bound for the structured-attrs test
The min bound written corresponds to the date of the commit that
introduced the change, but it only got merged on master some weeks
later. Since the version is essentially the commit date, that means that
there’s a whole range of commits on master (including the current
`nixUnstable`) that have a higher version but don’t contain the required
change.

(cherry picked from commit b598e5c47c)
2021-10-27 17:36:13 +02:00