5 ms·
After yesterday's post about Nix I tried to install it on my Arch+fish machine. I couldn't. Somewhat naively, I assumed that installing it from the official ch
by Cosi1125 4y ago
After yesterday's post about Nix I tried to install it on my Arch+fish machine. I couldn't.
Somewhat naively, I assumed that installing it from the official channel would do the job. It didnt't. I then searched the Internet and found a very "creative" workaround for Arch users that didn't work either.
My own problems aside, I would expect from a tool marketed as something that helps you keep your environment clean to not litter my disk with a ton of hidden files and directories spread all over the filesystem.
I hope it doesn't sound too harsh. I'm keeping my fingers crossed for the development of this amazing project!
- forgotpwd16 4y ago> I couldn't. Did you tried the method shown in Nix's site? https://nixos.org/download.html https://nixos.org/download.html >I assumed that installing it from the official channel would do the job. It didnt't. "Official channel" you mean from repos? That's a problem of your distro's package then, isn't it?
- Cosi1125 4y agoAs I said, I've tried installing it from the Arch repo and using Nix's installer (+ the adjustments described here [1]). [1] https://github.com/NixOS/nix/issues/879#issuecomment-410904367 https://github.com/NixOS/nix/issues/879#issuecomment-4109043...
- SuperSandro2000 4y agoThe rsync requirement got recently removed.
- rgoulter 4y ago> My own problems aside, I would expect from a tool marketed as something that helps you keep your environment clean to not litter my disk with a ton of hidden files and directories spread all over the filesystem. On non-nixOS, I think the changes Nix makes are: 1. puts the majority of its stuff under /nix 2. in the user directory, puts some files under ~/.nix-channels, ~/.nix-defexpr and ~/.nix-profile 3. modifies the default shell script /etc/bashrc or so, with some stuff under /etc/nix. 4. adds multiple users nixbuild1 ... nixbuildN. The uninstall command given in the manual is a one-line: ``` sudo rm -rf /etc/profile/nix.sh /etc/nix /nix ~root/.nix-profile ~root/.nix-defexpr ~root/.nix-channels ~/.nix-profile ~/.nix-defexpr ~/.nix-channels ```
- Thorentis 4y agoObscene.
- SuperSandro2000 4y agoThe files in the user directory are mostly symlinks and there are only multiple because it was designed without xdg in mind years ago. There is an open RFC to change those directories to xdg compliant ones.
- slurpmaker 4y agoDon't worry after you install it it doesn't exactly get any better. Take this as a sign :P
- pxc 4y ago> naively, I assumed that installing it from the official channel would do the job. Years ago, I submitted a PR that added this exact behavior. But it depended on interpolating a Nix-internal variable into a config file in the Fish package which at the time was undocumented (@NIX_STATE_DIR@) and upon the layout of profiles within it, so there was concern that it might break on future Nix releases. There were a few other issues, too, and at the time I don't think there was a great way to add tests, either. (That's important because if you screw this up, you can break login for Nix users— I know because I did it once, and that was awful.) Anyway, I felt discouraged and didn't know where to go with it next, so I got lazy and dropped the PR. At any rate, I don't think your expectation there was unreasonable. I think that would be a good and sensible UX, and your intuition was reasonable. > After yesterday's post about Nix I tried to install it on my Arch+fish machine. I couldn't. So the problem is this: the official Nix installer leverages an initialization script, to be sourced at shell init time, which is written in POSIX shell. Fish can't just source it because it's not compatible with POSIX shell. > I then searched the Internet and found a very "creative" workaround for Arch users that didn't work either. Arch users shouldn't need anything special here. You can use fenv¹ to source it, you can translate it to bash using babelfish, or you can exec into fish after running bash to log in (make sure to set $SHELL after if you choose that option). Just make sure you do it as early as possible if you want to use things installed by Nix in your other Fish config snippets. I think Home Manager will also take care of this for you. (The other module systems, Nix-Darwin and NixOS, both do.) If you wanna do it like NixOS does, you can install Fish via Nix and then create your own preinit environment script in /etc/fish. This has the advantage of setting up your Nix environment variables before any other config is sourced. You can take a look at it here, which also explains some of the Fish initialization process: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/fish.nix#L172 https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/p... and here's where the hooks go in the Fish package, where the comments describe the Fish initialization process in detail as well as why things are done this way on NixOS: https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/fish/default.nix#L42 https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/fis... — 1: https://github.com/oh-my-fish/plugin-foreign-env https://github.com/oh-my-fish/plugin-foreign-env 2: https://github.com/bouk/babelfish https://github.com/bouk/babelfish
- 4y ago