Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the installer on single-user Nix installs nixbld* accounts #287

Open
knl opened this issue Feb 4, 2021 · 6 comments
Open

Running the installer on single-user Nix installs nixbld* accounts #287

knl opened this issue Feb 4, 2021 · 6 comments

Comments

@knl
Copy link

knl commented Feb 4, 2021

I've just nuked my nix install (running in the single user mode) and reinstalled it again (in the single user mode). I then tried to install nix-darwin, and I'm noticing this:

./result/bin/darwin-installer

Installing nix-darwin...

Would you like to edit the default configuration.nix before starting? [y/n] y
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
building the system configuration...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
Would you like to load darwin configuration in /etc/bashrc? [y/n] y
Password:
if test -e /etc/static/bashrc; then . /etc/static/bashrc; fi
Would you like to load darwin configuration in /etc/zshrc? [y/n] y
if test -e /etc/static/zshrc; then . /etc/static/zshrc; fi
grep: /etc/nix/nix.conf: No such file or directory
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
user defaults...
setting up user launchd services...
setting up groups...
creating group nixbld...
updating group members nixbld...
setting up users...
creating user nixbld1...
creating user nixbld2...
creating user nixbld3...
creating user nixbld4...
creating user nixbld5...
creating user nixbld6...
creating user nixbld7...
creating user nixbld8...
creating user nixbld9...
creating user nixbld10...
creating user nixbld11...
creating user nixbld12...
creating user nixbld13...
creating user nixbld14...
creating user nixbld15...

nixbld* users should not be created for a single-user mode, no?

My system is 10.14.6 (Mojave), and zsh is my main shell.

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 18.7.0, macOS 10.14.6`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.10`
 - channels(knl): `"nixpkgs-21.03pre267956.e74cfaf6710"`
 - nixpkgs: `/Users/knl/.nix-defexpr/channels/nixpkgs`
@LnL7
Copy link
Owner

LnL7 commented Feb 10, 2021

They are not required but the installer creates them by default to make upgrading a single user install or accidentally misconfiguring services.nix-daemon much less of a problem.

@richardcooper
Copy link

Creating these users might be triggering a bug where doing a Big Sur update boots you to System Recovery.

That bug report talks about multi-user nix installs but I encountered it on a single user install. I think the reason it happened to me is that even though I was using single-user nix, nix-darwin still created the problematic nixbld* users.

The solution to the nix bug seem to be to rename and relocate the users. So regardless of whether nix-darwin continues to create the users on single-user installs, it looks like nix-darwin will need to be made aware of that change.

Also - just for context - it seems likely that single-user installs might be going away on darwin.

@LnL7
Copy link
Owner

LnL7 commented Feb 13, 2021

Yeah, I'm aware of that issue. The module should be updated to create and migrate the new users, that way darwin-install can also be used to resolve this issue on existing installations.

As a workaround it's possible to disable this step by adding the following to your configuration during install.

{ config, lib, ... }:
with lib;
{
  users.nix.configureBuildUsers = mkForce false;
}

@ahmedelgabri
Copy link

Just got this message when I was rebuilding my config.

warning: Detected old style nixbld users
These can cause migration problems when upgrading to certain macOS versions
Running the installer again will remove and recreate the users in a way that avoids these problems

$ darwin-install

or enable to automatically manage the users

    users.nix.configureBuildUsers = true;

But I don't have darwin-install in my $PATH for some reason, I can only see darwin-help, darwin-option & darwin-rebuild I'm using nix-darwin with flakes. My config is here

@azuzunaga
Copy link

@ahmedelgabri the following worked for me:

Run ./result/bin/darwin-installer and when it asks you if you want to edit configuration.nix enter y. Then in the configuration add a newline with users.nix.configureBuildUsers = true;.

You can also just add that line and rebuild.

@ahmedelgabri
Copy link

@azuzunaga I already added that to my config and it worked. I was just wondering why I didn't have darwin-install in my $PATH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants