aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2023-05-05Merge pull request #6953 from EzraSingh/patch-1Théophane Hufschmitt
Update install-systemd-multi-user.sh
2023-04-20Update install-systemd-multi-user.shEzra Singh
2023-03-01Merge pull request #7925 from cole-h/fixup-xdg-nix-envEelco Dolstra
Check if NIX_LINK_NEW exists instead of checking that NIX_LINK doesn't exist
2023-02-28Check if NIX_LINK_NEW exists instead of checking that NIX_LINK doesn't existCole Helbling
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-28nix-profile{,-daemon}.sh.in: Allow XDG_STATE_HOME to be unsetCole Helbling
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-10A setting to follow XDG Base Directory standardAlexander Bantyev
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-01-14Add escape for systemd service in installer scriptSheng Yang
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-03Fix Nix installation on older versions of fishAlexandre Thomas
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.
2022-12-14Avoid poly_user_note_set twiceTIAN Yuanhao
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-07Merge pull request #7419 from fricklerhandwerk/installer-contactEelco Dolstra
let installer blurb to to community page
2022-12-07let installer blurb point to community pageValentin Gagarin
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-07add template for installer issuesValentin Gagarin
since the installer prompts users to file issues, labelling them automatically should reduce triaging effort significantly.
2022-10-25Add `--yes` option for Nix installation scriptGabriella Gonzalez
2022-10-03Fix fish shell MANPATH creationStel Abrego
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-09-27Use exit instead of return in fish profileJonathan Coates
Older versions of Fish (such as those bundled with Ubuntu LTS 22.04) do not support return outside of functions. We need to use the equivalent exit instead.
2022-09-20fix `uname -m` return value for armv6l/armv7lhiroqn
2022-09-13Add fish suport to installerAna Hobden
Before this patch, installing Nix using the Fish shell did not work because Fish wasn't configured to add Nix to the PATH. Some options in #1512 offered workarounds, but they typically involve extra plugins or packages. This patch adds native, out-of-the-box support for the Fish shell. Note that Fish supports a `conf.d` directory, which is intended for exactly use cases like this: software projects distributing shell snippets. This patch takes advantage of it. The installer doesn't append any Nix loader behavior to any Fish config file. Because of that, the uninstall process is smooth and a reinstall obliterates the existing nix.fish files that we place instead of bothering the user with a backup / manual removal. Both single-user and multi-user cases are covered. It has been tested on Ubuntu, and a Mac with MacPorts, homebrew, and the Fish installer pkg. Closes #1512 Co-authored-by: Graham Christensen <graham@grahamc.com>
2022-09-09Merge pull request #4918 from roberth/installer-pcEelco Dolstra
installer: Jeeze -> Oh no
2022-08-31Set `HOME` var to `root`'s home when running `nix-store` as `root`Dave Nicponski
A [recent-ish change](https://github.com/NixOS/nix/pull/6676) logs a warning when a potentially counterintuitive situation happens. This now causes the multi-user installer to [emit a warning](https://github.com/NixOS/nixpkgs/issues/189043) when it's doing the "seed the Nix database" step via a low-level `nix-store --load-db` invocation. `nix-store` functionality implementations don't actually use profiles or channels or homedir as far as i can tell. So why are we hitting this code at all? Well, the current command approach for functionality here builds a [fat `nix` binary](https://github.com/NixOS/nix/blob/master/src/nix/local.mk#L23-L26) which has _all_ the functionality of previous individual binaries (nix-env, nix-store, etc) bundled in, then [uses the invocation name](https://github.com/NixOS/nix/blob/master/src/nix/main.cc#L274-L277) to select the set of commands to expose. `nix` itself has this behavior, even when just trying to parse the (sub)command and arguments: ``` dave @ davembp2 $ nix error: no subcommand specified Try 'nix --help' for more information. dave @ davembp2 $ sudo nix warning: $HOME ('/Users/dave') is not owned by you, falling back to the one defined in the 'passwd' file error: no subcommand specified Try 'nix --help' for more information. dave @ davembp2 $ HOME=~root sudo nix error: no subcommand specified Try 'nix --help' for more information. ``` This behavior can also be seen pretty easily with an arbitrary `nix-store` invocation: ``` dave @ davembp2 $ nix-store --realize dave @ davembp2 $ sudo nix-store --realize # what installer is doing now warning: $HOME ('/Users/dave') is not owned by you, falling back to the one defined in the 'passwd' file dave @ davembp2 $ sudo HOME=~root nix-store --realize # what this PR effectively does dave @ davembp2 $ ```
2022-08-24Update install-systemd-multi-user.shEzra Singh
2022-08-23darwin-install: fix shell hintJosh Soref
2022-08-19install: only create TMPDIR if missingTravis A. Everett
2022-08-17Ensure that $TMPDIR exists if definedEelco Dolstra
2022-08-17Use plain mktempEelco Dolstra
This fixes the case where $TMPDIR doesn't end in a slash.
2022-08-12Merge pull request #6882 from DeterminateSystems/allow-multi-user-as-rootEelco Dolstra
Allow installing multi-user as root on macOS and Linux
2022-08-10Don't prompt about using sudo if we're already rootGraham Christensen
2022-08-10install-multi-user: abstract is_root, is_os_linux, is_os_darwinGraham Christensen
2022-08-08Only fail if selinux is in enforcingTom Franklin
2022-07-12Fix --no-daemon installationEelco Dolstra
It was accidentally triggering the auto-chroot code path because /nix/var/nix didn't exist. Fixes #6790.
2022-06-10install-multi-user: check if selinux is enabled and if it is then abortArtturin
2022-06-01darwin-install: work around existing vim swapfilesTravis A. Everett
User on Matrix reported install problems which presented as "vifs:editing error" which we traced back to vim griping about an existing swap file. When opened interactively, it did this: E325: ATTENTION Found a swap file by the name "/etc/.fstab.swp" owned by: root dated: Sön Apr 24 16:54:10 2022 file name: /private/etc/fstab modified: YES user name: root host name: MBP.local process ID: 1698 While opening file "/etc/fstab" dated: Sön Apr 24 16:56:27 2022 NEWER than swap file! ...
2022-05-04darwin-install: fix break from bad vimrcTravis A. Everett
It looks like the `--noplugin` flag added in #5489 wasn't enough to skirt this class of vim-init error, so this is swing 2 at a full fix. Fixes #6462.
2022-04-08installer: ask for confirmation on multi-user install without systemdMartin Schwaighofer
On Linux a user can go through all the way through the multi-user install and find out at the end that they now have to manually configure their init system to launch the nix daemon. I suspect that for a significant number of users this is not what they wanted. They might prefer a single-user install. Now they have to manually uninstall nix before they can go through the single-user install. This introduces a confirmation dialog before the install in that specific situation to make sure that they want to proceed. See also: https://github.com/NixOS/nix/issues/4999#issuecomment-1064188080 This closes #4999 but rejecting it and closing that issue anyways would also be valid.
2022-04-06curl: Use --fail to catch errorsEelco Dolstra
2022-03-31scripts/install-systemd-multi-user.sh: fix another typoArtturin
2022-03-26scripts/install-systemd-multi-user.sh: fix typoArtturin
sytemd-tmpfiles -> systemd-tmpfiles
2022-03-24Merge pull request #6285 from flokli/add-tmpfileEelco Dolstra
nix-daemon.conf.in: add tmpfiles file to create nix/daemon-socket directory
2022-03-24install-multi-user.sh: Preserve symlinksEelco Dolstra
We need to pass -P to ensure that symlinks are copied correctly. Fixes #6303.
2022-03-23scripts/install-systemd-multi-user.sh: install ↵Florian Klink
/etc/tmpfiles.d/nix-daemon.conf, too While `create_directories()` from install-multi-user.sh seems to already create parts of the directory structure, it's marked as deprecated, and it won't hurt also copying over the tmpfiles config and have it execute once.
2022-03-01installer: allow overriding nix user GID and UIDsBjørn Forsman
Needed to resolve conflict in case the default GID and UIDs are in use.
2022-02-28Merge pull request #6123 from abathur/fix_6122Domen Kožar
install-darwin: fix mount permission edge-case
2022-02-22install-darwin: track mount permission edge-case fixTravis A. Everett
Same as 1fd127a06833c19a5a2965bd41cf4f695773cca6, but applied to a code path (volume_pass_works -> verify_volume_pass) that the reporting user didn't hit and wasn't able to trigger manually. I am not certain but I suspect it will be easier to add prophylactically than to debug if its absence causes trouble some day.
2022-02-21Merge pull request #6138 from nmattia/nm-clarify-manpathEelco Dolstra
Document usage of MANPATH in nix-profile.sh
2022-02-21Document usage of MANPATH in nix-profile.shNicolas Mattia
While trying to figure out how `nix-env`/`nix profile` work I had a hard time understand how man pages were being installed. Took me quite some time to figure this out, thought it might be useful to others too!
2022-02-18install-darwin: fix mount permission edge-caseTravis A. Everett
Fixes #6122, which reports a problem with trying to run the installer under another user (probably: user is not the disk "owner" and thus can't mount the volume).
2022-02-17Create to daemon-socket folder during installGuillaume Maudoux
2022-02-10check-hydra-status.sh: Ignore unfinished buildsEelco Dolstra
2022-02-10check-hydra-status.sh: Improve error behaviourEelco Dolstra
2022-01-21install-darwin: dodge bash 3.2 command bugTravis A. Everett
The script is trying to find chown in a cross-platform-like way, but there's some sort of deficiency in `command -p` in the default macOS bash 3.2. It looks like it will just use whatever PATH is already set, instead of the "default" path. This attempts to hard-set a PATH via `getconf PATH`. It will just set an empty PATH if that fails for some reason. A properly-functioning `command -p` should not care what we set the PATH to here one way or the other. Hopefully fixes #5768.
2021-12-08Merge pull request #5521 from abathur/clearly_mark_validation_stepDomen Kožar
installer: clarify starting assumption task