dnkmmr69420/nix-installer-scripts

Failed to start nix-daemon.socket: Unit var.mount not found.

Closed this issue · 2 comments

mcdent commented

Trying to run your script on Fedora 38. Ok I realise its not Silverblue and is beta, but wanted to try nix :)

Running the script gives me an error near the start like:-

 A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.
Failed to start nix.mount: Unit var.mount not found.
restorecon: lstat(/nix) failed: No such file or directory
Temorarly setting SELinux to permissive
Prepareing the nix install script
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  4052  100  4052    0     0   2584      0  0:00:01  0:00:01 --:--:--  2584
downloading Nix 2.15.0 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.15.0/nix-2.15.0-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.6nXZEVaOwm'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.0M  100 21.0M    0     0  1662k      0  0:00:12  0:00:12 --:--:-- 2511k
Note: a multi-user installation is possible. See https://nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation
Switching to the Multi-user Installer
Welcome to the Multi-User Nix Installation

This installation tool will set up your computer with the Nix package
manager. This will happen in a few stages:

1. Make sure your computer doesn't already have Nix. If it does, I
   will show you instructions on how to clean up your old install.

Then everything seems to go swimmingly until near the end when:-

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo systemctl start nix-daemon.socket

to start the nix-daemon.socket

Failed to start nix-daemon.socket: Unit var.mount not found.

---- oh no! --------------------------------------------------------------------
Oh no, something went wrong. If you can take all the output and open
an issue, we'd love to fix the problem so nobody else has this issue.

:(

We'd love to help if you need it.

You can open an issue at
https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md

Or get in touch with the community: https://nixos.org/community
Nix installer has finnished running
Now copying service files
Removed "/etc/systemd/system/sockets.target.wants/nix-daemon.socket".
Created symlink /etc/systemd/system/sockets.target.wants/nix-daemon.socket → /etc/systemd/system/nix-daemon.socket.
Failed to start nix-daemon.socket: Unit var.mount not found.
Now setting SELinux back to Enforcing
Making a nix backup
Installing nix backup
#!/bin/bash
sudo echo "Resetting nix..."
sudo rm -rf /nix/*
sudo mkdir -p /nix
sudo cp -R /opt/nb/nix/* /nix/
sudo restorecon -RF /nix
sudo echo "Nix has been resetted. Reboot for changes to apply."
Finnished installing nix backup
Reboot your system by typing
systemctl reboot

Any clues or ideas very welcome.

Are you using workstation or silverblue? If it was workstation, you would need to run the script for mutable selinux based distros.

I can't replicate this bug so I am gonna close this report