NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.04k stars 1.47k forks source link

Nix documentation does not describe how to set up a multi-user nix installation on a new user #11023

Open dwightguth opened 2 months ago

dwightguth commented 2 months ago

Problem

Hi,

I am working on a MacOS 14 machine that already has multi-user nix installed on it. I am trying to set up nix on a new user on that machine, but it seems there is no documentation about how to accomplish this, which seems counterintuitive since it is explicitly talking about a multi-user installation.

Proposal

Documentation should either describe that supporting multiple users is unsupported on a multi-user installation, or it should describe how to set up nix on a second user on a machine with nix already installed. Alternatively, the nix installer could be modified to offer to do this for you if it detects that multi-user nix is already installed.

Checklist

Priorities

Add :+1: to issues you find important.

abathur commented 2 months ago

It isn't documented because, speaking very generally, this should just work for every user you create as long as their shell is correctly sourcing one of the system-wide shell profiles.

Unclear from your report, but have you already tried this?

fricklerhandwerk commented 1 month ago

as long as their shell is correctly sourcing one of the system-wide shell profiles

Yeah, from experience there are some caveats if you have messed with your system before. It may be worth an integration test case. I recently ranted about that we don't have the code setup for it yet, and added a few notes how we could get there: https://github.com/NixOS/nix/pull/10998#issuecomment-2211405429