-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Bring nix-profile.sh in line with NixOS #452
Conversation
@edolstra anything I can do to help deciding wether this should be merged? |
Is there a nice way for the common parts to be shared so this can be the last time the changes need to be carried over? |
@copumpkin sure there is, tons of ways... But if @edolstra doesn't want to merge this, I don't see how we'll get there... |
@edolstra is this something you'd consider merging? If so I'll fix the merge conflict? |
Could you, please, merge this ? I had problem to run multiuser mode on ArchLinux with the https://aur.archlinux.org/packages/nix/ |
@wmertens If you bring this up to date (ideally with common parts abstracted as per @copumpkin, but not necessary), I'll merge it. |
Use the same logic as NixOS' profile and environment setup. Closes NixOS#414
@shlevy brought up-to-date. A possible modularization would be a script that sets up the user profile dir and nix links, which would also be used instead of https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/shell.nix#L23 |
@wmertens Just to double check, have you verified this works right with the latest nix? Also, which script in NixOS exactly is this meant to be in line with? |
@shlevy I tested it with my unstable Darwin, and it is supposed to provide a similar env as that provided by nixos/modules/programs/shell.nix and nixos/modules/programs/environment.nix |
Kind of weird to have the aspell stuff here IMO, but then again it's there in NixOS so I'll merge. |
Yeah this is really about unbreaking it, and we can address declarative On Mon, Apr 11, 2016 at 3:48 PM Shea Levy notifications@github.com wrote:
Wout. |
Woot! (Wout!) |
This appears to have broken the tests: http://hydra.nixos.org/build/34453788/nixlog/1/raw |
Fixed in 7186539 |
Another test failure (on Darwin):
|
the failure is related to my problems in #879. it would be nice to have unified way how to setup multi-user Nix on non-NixOS systems |
I hope we can try to keep the multi-user capability this time around, and fix these bugs as they crop up. It's worthwhile, in my opinion. |
@@ -34,4 +81,7 @@ if [ -n "$HOME" ]; then | |||
elif [ -e "$NIX_LINK/etc/ca-bundle.crt" ]; then # old cacert in Nix profile | |||
export SSL_CERT_FILE="$NIX_LINK/etc/ca-bundle.crt" | |||
fi | |||
|
|||
export PATH="$NIX_LINK/bin:$NIX_LINK/sbin:$__savedpath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need quotes on this line (85).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this one. export PATH="$NIX_LINK/bin:$NIX_LINK/sbin:$__savedpath"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the quotes don't hurt anything, do they? It's never been totally clear to me exactly when you can safely omit quotes in shell variable assignments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIX_LINK is user-provided via the HOME variable, if HOME happens to have a space in the name that would be annoying.
OTOH, the quotes don't hurt and using them always is easier and less error-prone than needing to decide when to use them.
If we are talking about really solving problems "in the large", then I don't like the hardcoded paths in this code. Most of the paths could be generated by various methods. That is, this script should be the output of a release time build script, not something painstakingly created by a human. I am also not sure what the reason is for all the @-symbols in your code. Perhaps you think it looks nice or something, but I would get rid of it. |
The |
Hmmm, it is rather the other way around. In a single-user install, the entire /nix tree is owned by the user…
The test runs with The fix is simply to put
Single-user installs are supposed to have /nix owned by the user, no? So it should just be writeable? The Nix store assumes that gcroots is available for writing to. Also, this version of the profile relies only on a bash-like shell and coreutils, which it ships with. |
Use the same logic as NixOS' profile and environment setup. Closes #414 and paves the way for enabling multi-user setups from a single-user nix install.