| Commit message (Collapse) | Author | Age |
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
`mktemp` tries to use the `TMPDIR` from `nixos-install` outside of the
`chroot` instead of `/tmp` inside the `chroot` and fails. For some
reason the `TMPDIR` is being passed through the `chroot` call.
I haven't tested if other environment variables are being passed through
that shouldn't be.
|
|
|
|
| |
See <https://github.com/koalaman/shellcheck/wiki/SC2239>.
|
| |
|
| |
|
|\
| |
| | |
nixos/nixos-enter: Create /tmp
|
| |
| |
| |
| |
| |
| |
| | |
/tmp is normally created by the systemd-tmpfiles-setup systemd service
at startup.
Fixes #39140
|
|/
|
|
|
| |
Fix shebangs and other shell uses in the NixOS tools, allowing them to work
correctly on cross-compiled systems.
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases, /dev/stderr may not point to a sensible location. For
example, running nixos-enter inside a systemd unit where the unit's
StandardOutput and StandardError are set to be sockets. In these
cases, this line would fail.
Piping to fd2 directly works just as well, even under strange and
twisted executions.
Co-authored-by: Michael Bishop <michael.bishop@iohk.io>
|
|
|
|
| |
Also, fix a few shellcheck errors.
|
|
|
|
|
|
|
|
|
| |
This reverts commit 10addad6035034b2b78f3c74ef436cd7146d5231, reversing
changes made to 7786575c6c0e1b010d46ad00b14d0bb5bf08d7d2.
NixOS scripts should be kept in the NixOS source tree, not in
pkgs. Moving them around is just confusing and creates unnecessary
code/history churn.
|
|
|
|
|
|
|
|
|
|
| |
Move all the nixos-* scripts from the nixos distribution as real
packages in the pkgs/ package set.
This allows non-nixos users to run the script as well. For example,
deploying a remote machine with:
nixos-rebuild --target-host root@hostname --build-host root@hostname
|
|
|
|
|
|
|
|
|
|
|
|
| |
This partially reverts a change from e88f28965a7d76e83478d3ae6fcddc165b1c94f1
which removed the `mount --rbind /sys`.
While true that the activation scripts will mount `sysfs` at `/sys`,
none of the mountpoints lower in the `/sys` tree are handled by the
activation script, which includes `efivarfs`.
This fixes #38477 since it ensures the presence of `efivarfs` in the
`/sys` tree, which is why the systemd-boot installation failed.
|
|
|
|
|
| |
Not doing so makes it impossible to use nixos-enter from a non-NixOS
distro
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Of course, you'll get a bunch of warnings from the activation script:
$ nixos-enter --root /tmp/mnt/
setting up /etc...
mount: /dev: permission denied.
mount: /dev/pts: permission denied.
mount: /dev/shm: permission denied.
mount: /sys: permission denied.
/nix/var/nix/profiles/system/activate: line 74: /proc/sys/kernel/modprobe: Permission denied
chown: changing ownership of '/run/wrappers/wrappers.0pKlU8JsvV/dbus-daemon-launch-helper': Invalid argument
NOTE: Under Linux, effective file capabilities must either be empty, or
exactly match the union of selected permitted and inheritable bits.
Failed to set capabilities on file `/run/wrappers/wrappers.0pKlU8JsvV/ping' (Operation not permitted)
chown: changing ownership of '/run/wrappers/wrappers.0pKlU8JsvV/unix_chkpwd': Invalid argument
[root@nixos:/]#
|
| |
|
|
|
|
| |
The activation script already does this.
|
|
This factors out the functionality in nixos-install for running a
command inside a NixOS installation (nixos-install --chroot).
|