Conversation
|
Oh, I hadn't seen #1087 .. |
|
Which one is more accurate? :) |
|
mine vs his :) 1,3c1,3
< if [ -n $HOME -a -n $USER ]
< set -l __savedpath $PATH
< set -xg PATH @coreutils@
---
> if set -q HOME; and set -q USER
> set -l __savedpath "$PATH"
> set -x PATH @coreutils@
8c8
< set -l NIX_LINK $HOME/.nix-profile
---
> set -l NIX_LINK "$HOME"/.nix-profile
10c10
< set -l NIX_USER_PROFILE_DIR @localstatedir@/nix/profiles/per-user/$USER
---
> set -l NIX_USER_PROFILE_DIR @localstatedir@/nix/profiles/per-user/"$USER"
12c12
< mkdir -m 0755 -p $NIX_USER_PROFILE_DIR
---
> mkdir -m 0755 -p "$NIX_USER_PROFILE_DIR"
14,15c14,15
< if [ (stat --printf '%u' $NIX_USER_PROFILE_DIR) -ne (id -u) ]
< echo "Nix: WARNING: bad ownership on $NIX_USER_PROFILE_DIR, should be "(id -u) >&2
---
> if [ (stat --printf '%u' "$NIX_USER_PROFILE_DIR") != (id -u) ]
> echo Nix: WARNING: bad ownership on "$NIX_USER_PROFILE_DIR", should be (id -u) > output.stderr
18,24c18,23
< if [ -w $HOME ]
< if not [ -L $NIX_LINK ]
< echo "Nix: creating $NIX_LINK" >&2
< if [ $USER != root ]
< ln -s $NIX_USER_PROFILE_DIR/profile $NIX_LINK
< if [ $status -ne 0 ]
< echo "Nix: WARNING: could not create $NIX_LINK -> $NIX_USER_PROFILE_DIR/profile" >&2
---
> if [ -w "$HOME" ]
> if not [ -L "$NIX_LINK" ]
> echo Nix: creating "$NIX_LINK" > output.stderr
> if [ "$USER" != root ]
> if not ln -s "$NIX_USER_PROFILE_DIR"/profile $NIX_LINK
> echo Nix: WARNING: could not create "$NIX_LINK" -> "$NIX_USER_PROFILE_DIR"/profile > output.stderr
28c27
< ln -s @localstatedir@/nix/profiles/default $NIX_LINK
---
> ln -s @localstatedir@/nix/profiles/default "$NIX_LINK"
33,34c32,33
< if not [ -e $HOME/.nix-channels ]
< echo 'https://nixos.org/channels/nixpkgs-unstable nixpkgs' > $HOME/.nix-channels
---
> if not [ -e "$HOME"/.nix-channels ]
> echo "https://nixos.org/channels/nixpkgs-unstable nixpkgs" > "$HOME"/.nix-channels
38,41c37,40
< set -l __user_gcroots @localstatedir@/nix/gcroots/per-user/$USER
< mkdir -m 0755 -p $__user_gcroots
< if [ (stat --printf '%u' $__user_gcroots) -ne (id -u) ]
< echo "Nix: WARNING: bad ownership on $__user_gcroots, should be "(id -u) >&2
---
> set -l __user_gcroots @localstatedir@/nix/gcroots/per-user/"$USER"
> mkdir -m 0755 -p "$__user_gcroots"
> if [ (stat --printf '%u' "$__user_gcroots") != (id -u) ]
> echo Nix: WARNING: bad ownership on "$__user_gcroots", should be (id -u) > output.stderr
45,51c44,48
< set -l __nix_defexpr $HOME/.nix-defexpr
< if [ -L $__nix_defexpr ]; rm -f $__nix_defexpr; end
< mkdir -m 0755 -p $__nix_defexpr
< if [ $USER != root ]
< if not [ -L $__nix_defexpr/channels_root ]
< ln -s @localstatedir@/nix/profiles/per-user/root/channels "$__nix_defexpr"/channels_root
< end
---
> set -l __nix_defexpr "$HOME"/.nix-defexpr
> [ -L "$__nix_defexpr" ]; and rm -f "$__nix_defexpr"
> mkdir -m 0755 -p "$__nix_defexpr"
> if [ "$USER" != root ]; and; not [ -L "$__nix_defexpr"/channels_root ]
> ln -s @localstatedir@/nix/profiles/per-user/root/channels "$__nix_defexpr"/channels_root
58c55,58
< set -xg NIX_PATH (string join : $NIX_PATH nixpkgs=$HOME/.nix-defexpr/channels/nixpkgs)
---
> if set -q NIX_PATH
> set -x NIX_PATH "$NIX_PATH":
> end
> set -x NIX_PATH "$NIX_PATH"nixpkgs="$HOME"/.nix-defexpr/channels/nixpkgs
65,66c65,66
< if [ -d "$i/lib/aspell" ]
< set -xg ASPELL_CONF "dict-dir $i/lib/aspell"
---
> if [ -d "$i"/lib/aspell ]
> set -x ASPELL_CONF "dict-dir $i/lib/aspell"
71,72c71,72
< if [ -e /etc/ssl/certs/ca-certificates.crt ] # NixOS, Ubuntu, Debian, Gentoo, Arch
< set -xg SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt
---
> if [ -e /etc/ssl/certs/ca-certiendcates.crt ] # NixOS, Ubuntu, Debian, Gentoo, Arch
> set -x SSL_CERT_FILE /etc/ssl/certs/ca-certiendcates.crt
74c74
< set -xg SSL_CERT_FILE /etc/ssl/ca-bundle.pem
---
> set -x SSL_CERT_FILE /etc/ssl/ca-bundle.pem
76c76
< set -xg SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt
---
> set -x SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt
78,82c78,82
< set -xg SSL_CERT_FILE /etc/pki/tls/certs/ca-bundle.crt
< else if [ -e "$NIX_LINK/etc/ssl/certs/ca-bundle.crt" ] # fall back to cacert in Nix profile
< set -xg SSL_CERT_FILE "$NIX_LINK/etc/ssl/certs/ca-bundle.crt"
< else if [ -e "$NIX_LINK/etc/ca-bundle.crt" ] # old cacert in Nix profile
< set -xg SSL_CERT_FILE "$NIX_LINK/etc/ca-bundle.crt"
---
> set -x SSL_CERT_FILE /etc/pki/tls/certs/ca-bundle.crt
> else if [ -e "$NIX_LINK"/etc/ssl/certs/ca-bundle.crt ] # fall back to cacert in Nix profile
> set -x SSL_CERT_FILE "$NIX_LINK"/etc/ssl/certs/ca-bundle.crt
> else if [ -e "$NIX_LINK"/etc/ca-bundle.crt ] # old cacert in Nix profile
> set -x SSL_CERT_FILE "$NIX_LINK"/etc/ca-bundle.crt
85,86c85,86
< if [ -n "$MANPATH" ]
< set -xg MANPATH $NIX_LINK/share/man $MANPATH
---
> if not set -q MANPATH
> set -x MANPATH "$NIX_LINK"/share/man $MANPATH
89c89
< set -xg PATH $NIX_LINK/bin $NIX_LINK/sbin $__savedpath
---
> set -x PATH "$NIX_LINK"/bin "$NIX_LINK"/sbin $__savedpath |
|
This one has a mistake at line 58. It should be something like https://github.com/nhooyr/nix/blob/c8d56bdbe1cec2c2f6bd86f9a6f58f49b8500553/scripts/nix-profile.fish.in#L52-L58 The difference between this and mine is that I am using more precise quoting and some fish specific features where it makes sense. |
|
@nhooyr have you tried running the script? Where is the error? BTW, That said, I'm happy with either of our PRs getting merged :) |
|
Oh, no error. My bad. You had no quotes around $NIX_PATH on line 58 which is why it works fine. Thing is, I think there is value in being explicit by quoting $NIX_PATH, as it is not an array, it is a string. I've updated mine https://github.com/nhooyr/nix/blob/33097d955033bf7830444c1249e189abc623abdb/scripts/nix-profile.fish.in#L55 |
|
I'm a fish user as well, and can't wait to use fish as login shell. 😄 @domenkozar I guess I could combine both PRs in a new one and triage the differing parts, if that's what is needed to go on with this? |
d282a8b to
3178d79
Compare
|
@florianjacob fixed conflicts, and updated to keep in sync with bash script. |
|
https://github.com/oh-my-fish/plugin-foreign-env is pretty cool |
|
@domenkozar could we get a call on this PR? I think @asymmetric and everybody else put quite some effort into this already and from what I can see it does not break anything. i suppose we can also cherry pick this into |
|
The main issue is that it would be hard for me to maintain this, since I'm not a fish user... |
|
Perhaps the PR could add a fish build dependency to release.nix and a test or two to ensure that fish support doesn't accidentally break? And a couple of people willing to be notified and fix it if the fish tests start failing?
… On Mar 1, 2017, at 07:24, Eelco Dolstra ***@***.***> wrote:
The main issue is that it would be hard for me to maintain this, since I'm not a fish user...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
@copumpkin That sounds like a good idea. |
|
@copumpkin I would need some help to do that. Is there any guides on how to approach the |
|
Some thoughts: To get Additionally, PS: I need to update my entry in the maintainers file (and relatedly, drop my maintainership of the Gazebo packages, as I no longer use them), but I would like to be one of the folks on the list for making sure this works. PPS: I think the changes in this PR are independently valuable from the ones I'm proposing here. If any of my reasoning seems ill-motivated or my plans poorly conceived, that shouldn't stand in the way of this PR; it can be addressed in whatever PR I write for the changes I've just described instead. |
|
It needs shell -> fish tool developed. |
|
How do I get a copy of the generated nix-profile.fish file? I tried to source the nix-profile.fish.in file but it didn't work and my guess is that it's not the final version of the script. Thanks! I can't wait to try nix out! |
|
For those interested, I wrote a Python script that rewrites the |
|
Could someone re-upload the python script |
|
Could be this one. |
|
I use the Home Manager fish module and have no issues, so I won't be updating this PR further. If anyone's interested in it, feel free to fork. |
Fixes NixOS#838. xattrs were historically disabled in 2017, since then, NFS v4.2 gained support for xattrs and almost all filesystems support xattrs. In addition, moving the build directory to a xattrs-supporting filesystem is always an option. Programs may exploit xattrs (including ACLs) during their build process and testing phase, to better serve these programs, we will remove this limitation. Lix will use POSIX ACLs for its UNIX domain sockets in the future and be one of these programs which will run tests making use of xattrs, while not writing any xattrs in the derivation outputs themselves. xattrs are still scrubbed from derivation outputs so it is not possible to obtain an advantage by writing a security-related xattr to a well chosen file. Tests were added to test these scenarios on Linux. Darwin is carefully excluded because of NixOS#1008 and NixOS#1090, solving that is welcome. In the meantime, they are marked xfail. Change-Id: Ia3255eeb8442e83db4f10dcb5a51cbc368a2550d Signed-off-by: Raito Bezarius <raito@lix.systems>
Second attempt at creating a
nix-profilefor fish.I have successfullt used the fish the script, but I haven't tested the
scripts/install-nix-from-closure.shandscripts/local.mkparts - how would I go about doing that?/cc @garbas