lix disappear on darwin updates #39

Open
opened 2025-03-05 14:05:38 +00:00 by nim65s · 3 comments

Hi,

This is not blocking for me, but I guess I should report that, since it bit me 4 times already.

The aarch64-darwin machine I have access to tend to forget I installed lix on it. After a reboot, so I guess after some kind of upgrade, the first immediate symptom is:

zsh: command not found: nix

Then, having a very limited darwin experience, a log into an account with admin rights and try again the install step:

% curl -sSf -L https://install.lix.systems/lix | sh -s -- install
info: downloading installer https://install.lix.systems/lix/lix-installer-aarch64-darwin
`lix-installer` needs to run as `root`, attempting to escalate now via `sudo`...


Welcome to the Lix installer! Just a couple of quick questions.

Flakes are an experimental feature, but widely used in the community.
You can change this later in `/etc/nix/nix.conf`.

Enable flakes? ([Y]es/[n]o): y

QUICK NOTE: we've enabled the experimental nix command for you!
Be aware that commands starting with `nix ` such as `nix build` may change syntax.

Lix install plan (v0.17.1)
Planner: macos (with default settings)

Planned actions:
* Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
* Fetch `https://releases.lix.systems/lix/lix-2.92.0/lix-2.92.0-aarch64-darwin.tar.xz` to `/nix/temp-install-dir`
* Create a directory tree in `/nix`
* Move the downloaded Nix into `/nix`
* Create build users (UID 351-382) and group (GID 350)
* Configure Time Machine exclusions
* Setup the default Nix profile
* Place the Nix configuration in `/etc/nix/nix.conf`
* Configure the shell profiles
* Configuring zsh to support using Nix in non-interactive shells
* Configure Nix daemon related settings with launchctl
* Remove directory `/nix/temp-install-dir`


Proceed? ([Y]es/[n]o/[e]xplain): y
 INFO Step: Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix`
ERROR Error saving receipt: RecordingReceipt("/nix/receipt.tmp", Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" })

Error: 
   0: Install failure
   1: Error executing action
   2: Action `create_nix_volume` errored
   3: Failed to execute command with status 1 `"/usr/sbin/diskutil" "info" "/nix"`, stdout: 
      stderr: Could not find disk: /nix

Location:
   src/cli/subcommand/install.rs:300

After that, a uninstall step is proposed, and succeed, and I try again to install and it works.

I think last time I had to manually remove build users and group before the reinstall could succeed.

I use that machine only to test builds, and other people also use it without nix, so I did not try nix-darwin.

Metadata

key value
version 0.17.1
os macos
arch aarch64
Hi, This is not blocking for me, but I guess I should report that, since it bit me 4 times already. The aarch64-darwin machine I have access to tend to forget I installed lix on it. After a reboot, so I guess after some kind of upgrade, the first immediate symptom is: ``` zsh: command not found: nix ``` Then, having a very limited darwin experience, a log into an account with admin rights and try again the install step: ``` % curl -sSf -L https://install.lix.systems/lix | sh -s -- install info: downloading installer https://install.lix.systems/lix/lix-installer-aarch64-darwin `lix-installer` needs to run as `root`, attempting to escalate now via `sudo`... Welcome to the Lix installer! Just a couple of quick questions. Flakes are an experimental feature, but widely used in the community. You can change this later in `/etc/nix/nix.conf`. Enable flakes? ([Y]es/[n]o): y QUICK NOTE: we've enabled the experimental nix command for you! Be aware that commands starting with `nix ` such as `nix build` may change syntax. Lix install plan (v0.17.1) Planner: macos (with default settings) Planned actions: * Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix` * Fetch `https://releases.lix.systems/lix/lix-2.92.0/lix-2.92.0-aarch64-darwin.tar.xz` to `/nix/temp-install-dir` * Create a directory tree in `/nix` * Move the downloaded Nix into `/nix` * Create build users (UID 351-382) and group (GID 350) * Configure Time Machine exclusions * Setup the default Nix profile * Place the Nix configuration in `/etc/nix/nix.conf` * Configure the shell profiles * Configuring zsh to support using Nix in non-interactive shells * Configure Nix daemon related settings with launchctl * Remove directory `/nix/temp-install-dir` Proceed? ([Y]es/[n]o/[e]xplain): y INFO Step: Create an encrypted APFS volume `Nix Store` for Nix on `disk3` and add it to `/etc/fstab` mounting on `/nix` ERROR Error saving receipt: RecordingReceipt("/nix/receipt.tmp", Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" }) Error: 0: Install failure 1: Error executing action 2: Action `create_nix_volume` errored 3: Failed to execute command with status 1 `"/usr/sbin/diskutil" "info" "/nix"`, stdout: stderr: Could not find disk: /nix Location: src/cli/subcommand/install.rs:300 ``` After that, a uninstall step is proposed, and succeed, and I try again to install and it works. I think last time I had to manually remove build users and group before the reinstall could succeed. I use that machine only to test builds, and other people also use it without nix, so I did not try nix-darwin. ## Metadata |key|value| |--|--| |**version**|0.17.1| |**os**|macos| |**arch**|aarch64|
Owner

iirc this is the shell profile tweaks getting eaten while the installation is still there. definitely a bug that we can't fix it.

iirc this is the shell profile tweaks getting eaten while the installation is still there. definitely a bug that we can't fix it.
Author

Thanks for the hint. I guess I can backup /etc/{ba,z}sh* and try to restore those next time.

If this work, maybe we can document that, and/or try to detect this situation in the planner and just run this action.

Thanks for the hint. I guess I can backup `/etc/{ba,z}sh*` and try to restore those next time. If this work, maybe we can document that, and/or try to detect this situation in the planner and just run this action.
Author

That part of /etc/{ba,z}sh* was indeed eaten:

# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
  . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix

But adding it again is not enough:

administrateur@kabayama ~ % ls /nix
ls: /nix: No such file or directory

I had to add nix in /etc/synthetic.conf and reboot.

That part of `/etc/{ba,z}sh*` was indeed eaten: ``` # Nix if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' fi # End Nix ``` But adding it again is not enough: ``` administrateur@kabayama ~ % ls /nix ls: /nix: No such file or directory ``` I had to add `nix` in `/etc/synthetic.conf` and reboot.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix-installer#39
No description provided.