1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 15:13:55 +02:00
Commit graph

7087 commits

Author SHA1 Message Date
Daiderd Jordan
f6ff68479e never use /var/folders for TMPDIR on darwin
This doesn't just cause problems for nix-store --serve but also results
in certain build failures. Builds that use unix domain sockets in their
tests often fail because the /var/folders prefix already consumes more
than half of the maximum length of socket paths.

    struct sockaddr_un {
       sa_family_t sun_family;               /* AF_UNIX */
       char        sun_path[108];            /* Pathname */
    };

(cherry picked from commit 4d9db420ff)
2020-09-02 15:41:43 +02:00
Eelco Dolstra
40d031d57c
Merge pull request #3926 from nh2/2.3-issue-3906-gc-build-errors-backport
repl.cc: Check for HAVE_BOEHMGC
2020-08-13 10:59:35 +02:00
Eelco Dolstra
d5c7efae38 repl.cc: Check for HAVE_BOEHMGC
Fixes #3906.

(cherry picked from commit 59067f0f58)
2020-08-13 04:34:36 +02:00
Eelco Dolstra
8b04d28a5b
createUnixDomainSocket(): Fix off-by-one error in copying the socket path
Reported by Kane York.

(cherry picked from commit 2292814049)
2020-07-24 20:50:05 +02:00
Eelco Dolstra
c728d375de
Bump version 2020-07-08 21:03:03 +02:00
Eelco Dolstra
975efd530c
Merge pull request #3790 from basvandijk/2.3-gc-fix
Cherry-pick "Use fragment size for autoGC capacity calculation" on 2.3
2020-07-08 20:50:48 +02:00
Samir Talwar
d5ecb8d3cd
Instruct the user to follow redirects when installing Nix.
Nix installation now requires following redirects using `curl -L`. This
is currently represented on the [Nix download page][] but not in the
manual. This change updates the manual to reflect this.

Using `curl` without the `-L` flag results in an empty body, making
installation a no-op.

[Nix download page]: https://nixos.org/download.html

(cherry picked from commit 9069759767)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-07-08 14:21:13 +02:00
Jörg Thalheim
4281bc6227
docs/installer: add correct curl flags
also see https://nixos.org/download.html

(cherry picked from commit 3685f4eec6)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-07-08 14:20:54 +02:00
Jude Taylor
15876ec4a0 nix auto-gc: use fragment size
(cherry picked from commit e2fc575c61)
2020-07-07 15:40:24 +02:00
Eelco Dolstra
8397c94081
Bump version 2020-06-30 17:53:34 +02:00
Eelco Dolstra
3933cf56af
NAR parser: Fix missing name field check
Discovered by @Kloenk.

(cherry picked from commit 2b834d48aa)
2020-06-30 17:53:17 +02:00
Eelco Dolstra
96310a4d7d
nix repl: Scan NixRepl for GC roots
Fixes #3175.

(cherry picked from commit b244e65cdb)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-06-18 10:31:40 +02:00
John Ericson
d2008f2fff
unbreak build without pch
(cherry picked from commit d64ab5131c)
2020-06-02 23:09:19 +02:00
Eelco Dolstra
734488a00f
Merge pull request #3646 from NixOS/2.3-wsl
Disable use-sqlite-wal under WSL
2020-06-01 19:49:20 +02:00
Brian McKenna
35f5da530a
Disable use-sqlite-wal under WSL
Before:

    $ nix-channel --update
    unpacking channels...
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)
    warning: SQLite database '/nix/var/nix/db/db.sqlite' is busy (SQLITE_PROTOCOL)

After:

    $ inst/bin/nix-channel --update
    unpacking channels...
    created 1 symlinks in user environment

I've seen complaints that "sandbox" caused problems under WSL but I'm
having no problems. I think recent changes could have fixed the issue.

(cherry picked from commit d25923263e)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-06-01 17:15:33 +02:00
Eelco Dolstra
a729883bf1
Bump version 2020-05-28 12:29:21 +02:00
Daiderd Jordan
a836abc5bd
installer: don't require xz on darwin
On macOS the system tar has builtin support for lzma while xz isn't
available as a separate binary.  There's no builtin package manager
there available either so having to install lzma (without nix) would be
rather painful.

(cherry picked from commit 4e6d7cb55a)
2020-05-28 12:29:03 +02:00
Eelco Dolstra
2fad345ae1
Bump version 2020-05-27 12:28:10 +02:00
Eelco Dolstra
9f4281d9ba
Remove the 'release' job
Unless the 'tested' job in the Nixpkgs/NixOS jobsets, this job isn't
actually used for anything (e.g. we don't update a channel based on
whether 'release' succeeds).

(cherry picked from commit 5392884eb1)
2020-05-27 12:27:24 +02:00
Eelco Dolstra
44d0897ac8 Merge pull request #3628 from domenkozar/2.3-installer-fixes
2.3 installer fixes
2020-05-27 11:02:23 +02:00
Domen Kožar
e15dc6783a
installer: fix unused variable
(cherry picked from commit 3d3c219d91)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 16:23:25 +02:00
Domen Kožar
f117c54318
Fix installer script bugs
- --no-channel-add didn't have effect on multi-user installation
- some new flags didn't work at all
- document all installer flags

(cherry picked from commit 1a5ac894e9)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 15:51:40 +02:00
Daiderd Jordan
07e29830c5
sandbox: fix /bin/sh on catalina
Sadly 10.15 changed /bin/sh to a shim which executes bash, this means it
can't be used anymore without also opening up the sandbox to allow bash.

    Failed to exec /bin/bash as variant for /bin/sh (1: Operation not permitted).

(cherry picked from commit 2e9bc1245c)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:19 +02:00
Daiderd Jordan
27e7153771
sandbox: allow pty devices
Nix now runs builds with a pseudo-terminal to enable colored build
output.

(cherry picked from commit f6c122aaeb)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:15 +02:00
Daiderd Jordan
f953a51d43
libstore: relax default sandbox-paths on darwin
(cherry picked from commit 7f2df903d9)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:11 +02:00
Daiderd Jordan
ec9bfa7afd
libstore: disable resolve-system-dependencies hook
This is used to determine the dependency tree of impure libraries so nix
knows what paths to open in the sandbox.  With the less restrictive
defaults it isn't needed anymore.

(cherry picked from commit afb78ebd34)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 12:55:04 +02:00
Domen Kožar
6c96858cad
Allow passing extra nix.conf to installer
(cherry picked from commit 573ff8dfca)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:04 +02:00
Domen Kožar
0c478b103b
install-multi-user: allow overriding user count
(cherry picked from commit 90b0c630a0)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:04 +02:00
Domen Kožar
b90d289785
scripts/create-darwin-volume.sh: remove unused variable
(cherry picked from commit 2a7ea2eb6c)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:04 +02:00
Daiderd Jordan
6117afc4b8
installer: don't clobber synthetic.conf
(cherry picked from commit d3df1889a1)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Travis A. Everett
248c9f7c78
focus on golden-path covering most scenarios
This should handle installation scenarios we can handle with
anything resembling confidence. Goal is approximating the existing
setup--not enforcing a best-practice...

Approaches (+ installer-handled, - manual) and configs each covers:

+ no change needed; /nix OK on boot volume:
  All pre-Catalina (regardless of T2 or FileVault use)

+ create new unencrypted volume:
  Catalina, pre-T2, no FileVault

+ create new encrypted-at-rest volume:
  Catalina, pre-T2, FileVault
  Catalina, T2, no FileVault

- require user to pre-create encrypted volume
  Catalina, T2, FileVault

(cherry picked from commit 2b0a81d92d)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
e61e8c2588
installer: refuse apfs volume creation when FileVault is enabled
(cherry picked from commit 477d7c2d07)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
f9c6c0a764
install: make synthetic.conf and fstab checks stricter
(cherry picked from commit bc24c09968)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
4cafd9c825
manual: clarify volume creation section
(cherry picked from commit 3386575296)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
da5a1fad71
install: improve output and error handling
(cherry picked from commit 04f597c3f4)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
558d422452
manual: add apfs volume section
(cherry picked from commit ee89b7797d)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
ebfa913825
install: hide the store volume on darwin
(cherry picked from commit caface1980)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
5a16236307
install: show macOS 10.15 message with --daemon
(cherry picked from commit 083bb3bbfc)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:03 +02:00
Daiderd Jordan
b05437f306
install: also configure ~/.zshenv
The default login shell for users on macOS 10.15 changed from bash to
zsh.  So while generally nonstandard we need to configure it to make nix
function out of the box on macOS.

(cherry picked from commit 10202628b9)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Daiderd Jordan
1c56f18a81
install: configure and bootstrap synthetic.conf on darwin
Starting macOS 10.15 /nix can't be creasted directly anymore due to the
readonly filesystem, but synthetic.conf was introduced to enable
creating mountpoints or symlinks for special usecases like package
managers.

(cherry picked from commit 0726ad5825)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Pavol Rusnak
a98841ff1b
Expose installer configuration environment variables via command line flags
(cherry picked from commit 9e12b2f5b8)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Pavol Rusnak
64db25b1f9
Introduce NIX_INSTALLER_NO_CHANNEL_ADD which skips nix-channel --add
(cherry picked from commit 46be11b762)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Greg Price
c4ce89f151
installer: Set files read-only when copying into store
After installing Nix, I found that all the files and directories
initially copied into the store were writable, with mode 644 or 755:

  drwxr-xr-x 9 root root 4096 Dec 31  1969 /nix/store/ddmmzn4ggz1f66lwxjy64n89864yj9w9-nix-2.3.3

The reason is that that's how they were in the unpacked tarball, and
the install-multi-user script used `rsync -p` without doing anything
else to affect the permissions.

The plain `install` script for a single-user install takes care to
do a `chmod -R a-w` on each store path copied.  We could do the same
here with one more command; or we can pass `--chmod` to rsync, to
have it write the files with the desired modes in the first place.

Tested the new `rsync` command on both a Linux machine with a
reasonably-modern rsync (3.1.3) and a Mac with its default, ancient,
rsync 2.6.9, and it works as expected on both.  Thankfully the latter
is just new enough to have `--chmod`, which dates to rsync 2.6.7.

(cherry picked from commit 26851dd2c2)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Philipp Middendorf
18b1e65158
installer: also test for xz to unpack
(cherry picked from commit 9450dece24)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Robert Hensing
a49950d817
README, error msg: http -> https
(cherry picked from commit 9080d5d924)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Eelco Dolstra
b278892471
nixos.org/releases -> releases.nixos.org
(cherry picked from commit e063c71a79)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Rovanion Luckey
c4702f938c
installer: Handle edge case where the nix-daemon is already running on the system
On a systemd-based Linux distribution: If the user has previously had multi-user Nix installed on the system, removed it and then reinstalled multi-user Nix again the old nix-daemon.service will still be running when `scripts/install-systemd-multi-user.sh` tries to start it which results in nothing being done and the old daemon continuing its run.

When a normal user then tries to use Nix through the daemon the nix binary will fail to connect to the nix-daemon as it does not belong to the currently installed Nix system. See below for steps to reproduce the issue that motivated this change.

$ sh <(curl https://nixos.org/nix/install) --daemon

$ sudo rm -rf /etc/nix /nix /root/.nix-profile /root/.nix-defexpr /root/.nix-channels /home/nix-installer/.nix-profile /home/nix-installer/.nix-defexpr /home/nix-installer/.nix-channels ~/.nix-channels ~/.nix-defexpr/ ~/.nix-profile /etc/profile.d/nix.sh.backup-before-nix /etc/profile.d/nix.sh; sed -i '/added by Nix installer$/d' ~/.bash_profile

$ unset NIX_REMOTE

$ sh <(curl https://nixos.org/nix/install) --daemon

└$ export NIX_REMOTE=daemon

└$ nix-env -iA nixpkgs.hello
installing 'hello-2.10'
error: cannot connect to daemon at '/nix/var/nix/daemon-socket/socket': No such file or directory
(use '--show-trace' to show detailed location information)

└$ sudo systemctl restart nix-daemon.service

└$ nix-env -iA nixpkgs.hello
installing 'hello-2.10'
these paths will be fetched (6.09 MiB download, 27.04 MiB unpacked):
  /nix/store/2g75chlbpxlrqn15zlby2dfh8hr9qwbk-hello-2.10
  /nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27
copying path '/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27' from 'https://cache.nixos.org'...
copying path '/nix/store/2g75chlbpxlrqn15zlby2dfh8hr9qwbk-hello-2.10' from 'https://cache.nixos.org'...
building '/nix/store/w9adagg6vlikr799nkkqc9la5hbbpgmi-user-environment.drv'...
created 2 symlinks in user environment

(cherry picked from commit a413594baf)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:02 +02:00
Michael Forney
47a12576ff
Pass -J to tar for xz decompression
Some tar implementations can't auto-detect compression formats, so
they must be specified explicitly.

(cherry picked from commit 43eb7b6756)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:01 +02:00
Eelco Dolstra
dd9c8a5f60
Remove $NIX_USER_PROFILE_DIR
This is not used anywhere.

(cherry picked from commit 1c3ccba0f5)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:01 +02:00
Michael Forney
8673883b40
Pass -P to cp to preserve symlinks
This is commonly the default behavior with -R, but POSIX leaves the
default unspecified.

(cherry picked from commit 10414d467b)
Signed-off-by: Domen Kožar <domen@dev.si>
2020-05-26 11:39:01 +02:00