Hello I installed Nixos yesterday for my personal PC, using the official Calamares installer.
If I use nix commands such as ‘nix-shell’, or the new ‘nix search’ without sudo, I get:
error: opening lock file '/nix/store/(...)-nix-info.drv.lock': Read-only file system
The command sudo nix-shell -p nix-info --run "nix-info -m"
returns:
- system: `"x86_64-linux"`
- host os: `Linux 5.15.64, NixOS, 22.05 (Quokka), 22.05.2889.67e45078141`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.11.0`
- channels(drito): `"nixpkgs"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
If my install is set to multi user I suppose the nix daemon is expected to run so I checked the daemon.
sudo systemctl status nix-daemon
○ nix-daemon.service - Nix Daemon
Loaded: loaded (/etc/systemd/system/nix-daemon.service; linked; vendor preset: enabled)
Drop-In: /nix/store/l64lzk5ibcdgn8hfswn0q7ycwq822h63-system-units/nix-daemon.service.d
└─overrides.conf
Active: inactive (dead)
TriggeredBy: ● nix-daemon.socket
Docs: man:nix-daemon
https://nixos.org/manual
I tried to enable the nix-daemon.
sudo systemctl enable nix-daemon
But the answer was:
Failed to enable unit: File /etc/systemd/system/multi-user.target.wants/nix-daemon.service: Read-only file system
Notice that even sudo is not enough in this case.
During the install with Calamares I placed ‘/’ mount point on sda2 (previously owned by my broken arch based distro), and /home on my existing sda3. It is the only thing not default.
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465,8G 0 disk
├─sda1 8:1 0 2G 0 part
├─sda2 8:2 0 95,7G 0 part /nix/store
│ /
└─sda3 8:3 0 368,1G 0 part /home
sr0 11:0 1 1024M 0 rom
The “mount” commands show me that about the partition owned by nixos.
/dev/sda2 on / type ext4 (rw,relatime)
/dev/sda2 on /nix/store type ext4 (ro,relatime)
How to restore a normal behaviour ?