aboutsummaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2024-09-27build: fix deprecated uses of configure_fileOlivia Crain
Using `configure_file` to copy files has been deprecated since Meson 0.64.0. The intended replacement is the `fs.copyfile` method. This removes the following deprecation warning that arises when a minimum Meson version is specified: `` Project [...] uses feature deprecated since '0.64.0': copy arg in configure_file. Use fs.copyfile instead `` Change-Id: I09ffc92e96311ef9ed594343a0a16d51e74b114a
2024-05-07remove the autoconf+Make buildsystemQyriad
We're not using it anymore. Any leftover bugs in the Meson buildsystem are now just bugs. Closes #249. Change-Id: I0465a0c37ae819f94d40e7829f5bff046aa63d73
2024-04-09meson: correctly differentiate $profiledir and $sysconfdir/profile.dQyriad
The configured sysconfdir is used to look for nix.conf, so it needs to be /etc, and not $out/etc, so we separate out the place where shell profile files are installed, which is the only other place sysconfdir is at all used. See https://git.lix.systems/lix-project/lix/issues/231#issuecomment-1989 for more info. Change-Id: Idbed8ba82e711b8a9d6b6127904befa27d58e279
2024-03-29meson: install shell fileseldritch horrors
Change-Id: I7c30690e5763d095cf7444333f7b687509051c5f
2024-03-27meson: implement functional testsQyriad
Functional tests can be run with `meson test -C build --suite installcheck`. Notably, functional tests must be run *after* running `meson install` (Lix's derivation runs the installcheck suite in installCheckPhase so it does this correctly), due to some quirks between Meson and the testing system. As far as I can tell the functional tests are meant to be run after installing anyway, but unfortunately I can't transparently make `meson test --suite installcheck` depend on the install targets. The script that runs the functional tests, meson/run-test.py, checks that `meson install` has happened and fails fast with a (hopefully) helpful error message if any of the functional tests are run before installing. TODO: this change needs reflection in developer documentation Change-Id: I8dcb5fdfc0b6cb17580973d24ad930abd57018f6
2024-03-25Restore system-install profile files from the previous installerJade Lovelace
These files are required to get Nix in PATH in existing multi-user installs using the legacy installer. We really could use some tests. Cc: https://git.lix.systems/lix-project/lix/issues/33 This partially reverts commit 93cc063344323a8b0d630d0a67acd121cdc3f86a. Fixes: https://git.lix.systems/lix-project/lix/issues/173 Change-Id: Iafb55280596732670a432f604b897f48562868e4
2024-03-14Delete the existing installerPuck Meerburg
We're not going to use it. Fixes: #31 Change-Id: Ib17a2eb6cae1ecbbf9ad1062e576ba6107a3c13b
2024-03-04Merge pull request #10001 from abathur/fix_macos_daemon_permseldritch horrors
install-darwin: fix symbolic perms for install cmd (cherry picked from commit ee9f6d022f33663501503cf7d2b3d0cf605ac268) Change-Id: I83240e1e93aa9a2ba34d5ac3abd8ef4f7ec54ac3
2024-03-04Merge pull request #9639 from awakesecurity/mz/darwin-UID-overrideeldritch horrors
installer: allow overriding of NIX_FIRST_BUILD_ID on darwin (cherry picked from commit e85fd92816571ea00abafa3929298d0e091bcb9b) Change-Id: Ifffc3fedd740079345c205f54c62c76053e24846
2024-03-04Merge pull request #9425 from iFreilicht/fix-unbound-variable-errorseldritch horrors
Fix "unbound variable" errors in bash (cherry picked from commit 9ad9e988b83a9a9a9748034ac77e743b2cab20e6) Change-Id: Ib7c8cb303f34104b9785c9376225f93174f3dae7
2024-03-04Update scripts/nix-profile-daemon.fish.ineldritch horrors
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> (cherry picked from commits 867f894289437a96630579592a46a4253151f079, 896013ec0c0d4633349ff0373bdae626667adc77, 150b5aba509d169a50c6ad62100c3ad7bf00242b, 1362a0a55aaddccef5a525e3b1179239d650bb07) Change-Id: I0ba6a399d22cc5e927d9ef7046cc6f95856c1559
2023-06-15Merge pull request #8512 from scarf005/install-show-uidJohn Ericson
build: show UID and GID in welcome message
2023-06-15style: use plurals in uid rangesscarf
Co-authored-by: John Ericson <git@JohnEricson.me>
2023-06-15style: use mathematical interval notationscarf
2023-06-14darwin installer: remove the file before installing new oneDomen Kožar
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-14build: show UID and GID in welcome messagescarf
2023-06-01Update install-multi-user.shsvenz
delete duplicate word 'with' in status message
2023-05-25Merge pull request #7948 from mkenigs/ventura-diffThéophane Hufschmitt
installer: don't assume GNU diff
2023-05-25installer: don't assume GNU diffMatthew Kenigsberg
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-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! ...