Commit graph

1027 commits

Author SHA1 Message Date
Eelco Dolstra
36cc8d5f4b Run the flake-regressions test suite 2024-06-21 15:37:08 +02:00
Hamir Mahal
03883f0d1d
fix: copy in install-multi-user.sh (#10902) 2024-06-13 21:13:21 +00:00
Eelco Dolstra
1450b553fa
Merge pull request #10806 from jdek/riscv64_install
scripts/install.in: add riscv64 support to installer
2024-06-03 15:42:13 +02:00
Robert Hensing
de5050f73b
Merge pull request #9590 from wh0/patch-1
nix-profile: fix both profile links detection
2024-06-03 14:37:08 +02:00
J. Dekker
0ed356f3c0 scripts/install.in: add riscv64 support to installer
The artifacts are already built and hosted, the install script just needs to be taught about riscv64.

Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-05-30 15:03:20 +02:00
John Ericson
567265ae67 Start getting all shell scripts passing shellcheck
Like with the formatter, we are blacklisting most files by default.

Do a few files to get us started, and get a sense of what this looks
like.
2024-05-27 22:39:56 -04:00
ramboman
b4950404ba
Honor the same set of proxy environment variables (#10611)
Different parts of the project honor different sets of proxy environment
variables. With this commit all parts of the project will honor the same
set of proxy environment variables.

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2024-05-06 15:39:22 -04:00
Andrew Davis
a2a633d332
Prevent nix-daemon.sh from leaking variable into user environment
The script at `/nix/store/...-nix-2.21.0/etc/profile.d/nix-daemon.sh`  was leaving behind a variable, which was visible in the user's shell environment, but not used outside the script.
2024-04-06 10:26:29 -04:00
Jesse Schalken
c448636f7c
Fix loop over $NIX_PROFILES in nix-profile-daemon.fish.in 2024-03-20 15:23:31 +11:00
Théophane Hufschmitt
f175b3a4b7 Revert "install-multi-user.sh: _sudo: add proxy variables to sudo"
This reverts commit 24fd7e2755.
2024-03-07 10:06:33 +01:00
Théophane Hufschmitt
739f53aca4 Revert "Fix sudo in the darwin installer (#10128)"
This reverts commit 686405ef41.
2024-03-07 10:06:33 +01:00
Théophane Hufschmitt
686405ef41
Fix sudo in the darwin installer (#10128) 2024-03-06 22:36:37 +01:00
ramboman
24fd7e2755
install-multi-user.sh: _sudo: add proxy variables to sudo 2024-02-24 01:00:13 +00:00
Travis A. Everett
64a076fe06 install-darwin: fix symbolic perms for install cmd
The symbolic form in use here doesn't seem to have an effect
in either the BSD or coreutils install commands, leaving the
daemon plist with empty permissions. This seems to cause its
own problems.

I think I've got the right symbolic syntax now :)
2024-02-13 01:18:08 -06:00
w
29eb4d354a nix-profile: add cross reference to installer test 2023-12-29 07:14:53 +00:00
wh0
5d0bdb1d3f nix-profile: fix both profile links detection 2023-12-29 05:43:22 +00:00
Mel Zuser
fa4bbe53e8 installer: allow overriding of NIX_FIRST_BUILD_ID on darwin
because there are often already users in the 300 range and it's painful
to work around.

revives #6466
2023-12-18 15:02:26 -08:00
John Ericson
19573f1b05 Restore comment 2023-12-13 15:33:15 -05:00
John Ericson
ff992f8b46 Merge remote-tracking branch 'upstream/master' into package-nix 2023-12-11 15:26:12 -05:00
John Ericson
77003a4f0c Factor out the installer script 2023-12-03 18:29:15 -05:00
John Ericson
e275f0adfb Move binary-tarball.nix to scripts dir 2023-12-03 18:16:07 -05:00
Felix Uhl
64827360be Fix "unbound variable" errors in bash
Fixes #9414
2023-11-21 14:49:48 +01:00
Felix Uhl
1362a0a55a Fix logic for default XDG_DATA_DIRS value
The [POSIX test manpage](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html)
as well as the [fish test manpage](https://fishshell.com/docs/current/cmds/test.html#operators-for-text-strings)
specify that `-z` will be "True if the length of string string is zero;
otherwise, false."

The `-n` was likely a mixup and not caught during testing of
https://github.com/NixOS/nix/pull/8985 due to a lack of missing
conflicting entries in `XDG_DATA_DIRS`.
2023-11-07 03:41:19 +01:00
Ana Hobden
150b5aba50 Update scripts/nix-profile-daemon.fish.in
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-11-06 20:43:27 +01:00
Ana Hobden
896013ec0c Fix bad copy-paste 2023-11-06 20:43:27 +01:00
Ana Hobden
867f894289 Populate $XDG_DATA_DIRS with appropriate folder from Nix profile
On non-NixOS systems, the default `nix` install does not populate the
`$XDG_DATA_DIRS`. This populates it and enables things like bash-completion
and `.desktop` file detection for `nix` profile installed packages.

Signed-off-by: Ana Hobden <operator@hoverbear.org>
2023-11-06 20:43:27 +01:00
Théophane Hufschmitt
e304e8d053
Merge pull request #7593 from miallo/ignore-identical-rc-backup-files-for-installation
install-multi-user: ignore profile_target backups that have no change
2023-09-25 14:14:53 +02:00
John Ericson
e672d52f7c
Merge pull request #8512 from scarf005/install-show-uid
build: show UID and GID in welcome message
2023-06-15 13:49:44 +02:00
scarf
80451b762d
style: use plurals in uid ranges
Co-authored-by: John Ericson <git@JohnEricson.me>
2023-06-15 14:47:18 +09:00
scarf
4b487317c3
style: use mathematical interval notation 2023-06-15 08:52:34 +09:00
Domen Kožar
c73daea61e darwin installer: remove the file before installing new one
Otherwise results into:

cp: /Library/LaunchDaemons/org.nixos.nix-daemon.plist and /nix/var/nix/profiles/default/Library/LaunchDaemons/org.nixos.nix-daemon.plist are identical (not copied).
2023-06-14 12:28:01 -04:00
scarf
bfb5e0bdcd
build: show UID and GID in welcome message 2023-06-14 19:06:04 +09:00
svenz
38ce40c66c
Update install-multi-user.sh
delete duplicate word 'with' in status message
2023-06-01 15:20:31 +02:00
Théophane Hufschmitt
f41dd2c306
Merge pull request #7948 from mkenigs/ventura-diff
installer: don't assume GNU diff
2023-05-25 18:15:42 +02:00
Matthew Kenigsberg
367fcd9eb5
installer: don't assume GNU diff
macOS Ventura ships with it's own version of diff. Try to output a
similar diff with Apple diff as with GNU diff, instead of failing

Helps https://github.com/NixOS/nix/issues/7286
2023-05-25 08:59:05 -06:00
Théophane Hufschmitt
81778c8d55
Merge pull request #6953 from EzraSingh/patch-1
Update install-systemd-multi-user.sh
2023-05-05 13:20:22 +02:00
Ezra Singh
24005270cc
Update install-systemd-multi-user.sh 2023-04-20 18:36:01 -04:00
Eelco Dolstra
ffadc35df1
Merge pull request #7925 from cole-h/fixup-xdg-nix-env
Check if NIX_LINK_NEW exists instead of checking that NIX_LINK doesn't exist
2023-03-01 23:01:42 +01:00
Cole Helbling
2b801d6e3c Check if NIX_LINK_NEW exists instead of checking that NIX_LINK doesn't exist
For brand new installations, neither NIX_LINK_NEW
(`$XDG_STATE_HOME/nix/profile` or `~/.local/state/nix/profile`), nor
NIX_LINK (`~/.nix-profile`) will exist.

This restores functionality to nix-env, which is relied upon by GitHub
Actions such as https://github.com/cachix/cachix-action and the Nixpkgs
EditorConfig (and other) CI.
2023-02-28 16:10:42 -08:00
Cole Helbling
24eaa086f0 nix-profile{,-daemon}.sh.in: Allow XDG_STATE_HOME to be unset
One of our CI machines installs Nix via the official script and then
sources the nix-profile.sh script to setup the environment. However, it
doesn't have XDG_STATE_HOME set, which causes sourcing the script to
fail.
2023-02-28 10:10:20 -08:00
Alexander Bantyev
2384d36083
A setting to follow XDG Base Directory standard
XDG Base Directory is a standard for locations for storing various
files. Nix has a few files which seem to fit in the standard, but
currently use a custom location directly in the user's ~, polluting
it:

- ~/.nix-profile
- ~/.nix-defexpr
- ~/.nix-channels

This commit adds a config option (use-xdg-base-directories) to follow
the XDG spec and instead use the following locations:

- $XDG_STATE_HOME/nix/profile
- $XDG_STATE_HOME/nix/defexpr
- $XDG_STATE_HOME/nix/channels

If $XDG_STATE_HOME is not set, it is assumed to be ~/.local/state.

Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
Co-authored-by: Tim Fenney <kodekata@gmail.com>
Co-authored-by: pasqui23 <pasqui23@users.noreply.github.com>
Co-authored-by: Artturin <Artturin@artturin.com>
Co-authored-by: John Ericson <Ericson2314@Yahoo.com>
2023-02-10 20:14:06 +04:00
Sheng Yang
7c08144c4a Add escape for systemd service in installer script
Among all the characters that are allowed in a URL, both the percentage
sign "%" and the single quotation mark "'" needs escaping when written
as a environment variable in a systemd service file. While the single
quotation mark may be rare, the percentage sign is widely used to escape
characters in a URL. This is especially common in proxy setting, where
username and password may contain special characters that need
percentage escaping. This patch applies the following replacements:

  % -> %%
  ' -> \'
2023-01-14 03:46:11 +08:00
Michael Lohmann
c74248c56e install-multi-user: ignore profile_target backups that have no change
If there was a prior nix installation that created this backup file and
then you tried to install it again, it would stop to tell you there is
this file. But if the file and its backup are identical in content,
there is no harm in continuing and in a later step overwriting the
existing backup file with the identical one. This is just a convenience
feature.
2023-01-12 15:53:49 +01:00
Alexandre Thomas
49e058f1cf Fix Nix installation on older versions of fish
The `fish_add_path` function is only available for fish 3.2.0 or newer,
and not on older versions.
This commit adds an alternative way to update the PATH when
`fish_add_path` does not exist.
2023-01-03 21:14:01 +01:00
TIAN Yuanhao
09830ab829 Avoid poly_user_note_set twice
f06f810 incorrectly introduces a boolean flip, resulting in a senseless
poly_user_note_set even though the user comment has been set correctly.
2022-12-14 03:03:12 +00:00
Eelco Dolstra
9c9768572b
Merge pull request #7419 from fricklerhandwerk/installer-contact
let installer blurb to to community page
2022-12-07 13:27:09 +01:00
Valentin Gagarin
6833ded764 let installer blurb point to community page
being too specific about it requires more maintenance (or otherwise
produced more confusion and churn), since these points of contact change
over time.
2022-12-07 10:05:37 +01:00
Valentin Gagarin
e5a2af2832 add template for installer issues
since the installer prompts users to file issues, labelling them
automatically should reduce triaging effort significantly.
2022-12-07 10:00:27 +01:00
Gabriella Gonzalez
a71e3172af Add --yes option for Nix installation script 2022-10-25 16:43:00 -07:00
Stel Abrego
34e3fa3a4a Fix fish shell MANPATH creation
Previously the MANPATH was set even if MANPATH was empty beforehand
which resulted in a MANPATH of only ~/.nix-profile/share/man which
omitted the default man page directory (commonly /opt/local/share/man)
from man page results.
2022-10-03 14:37:28 -07:00