Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kidonng/nix.fish
❄️🐟 Fish plugin for Nix
https://github.com/kidonng/nix.fish
Last synced: 26 days ago
JSON representation
❄️🐟 Fish plugin for Nix
- Host: GitHub
- URL: https://github.com/kidonng/nix.fish
- Owner: kidonng
- License: mit
- Created: 2021-07-04T03:18:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-04T13:32:45.000Z (over 1 year ago)
- Last Synced: 2023-07-04T14:35:19.851Z (over 1 year ago)
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ❄️🐟 Nix.fish
[Fish](https://fishshell.com/) port of [`~/.nix-profile/etc/profile.d/nix.sh`](https://github.com/NixOS/nix/blob/master/scripts/nix-profile.sh.in) which sets up [Nix](https://nixos.org/) environment.
## Installation
- [plug.fish](https://github.com/kidonng/plug.fish)
```sh
plug install kidonng/nix.fish
```- [Fisher](https://github.com/jorgebucaran/fisher)
```sh
fisher install kidonng/nix.fish
```## Differences from [nix-env.fish](https://github.com/lilyball/nix-env.fish)
### Works with [`nix shell`](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-shell.html) / [`nix-shell`](https://nixos.org/manual/nix/stable/command-ref/nix-shell.html)
Nix.fish checks `$PATH` for `/nix/store/*` and respects [`$fish_user_paths`](https://fishshell.com/docs/current/cmds/fish_add_path.html?highlight=fish_user_paths) thus:
- `$PATH` is always set up correctly
- `conf.d`, function and completion scripts are loaded on the fly.### Faster shell startup
Nix.fish is pure fish, while nix-env.fish starts Bash to capture environment variables and hence slower.
### Doesn't replicate [`__fish_build_paths.fish`](https://github.com/NixOS/nixpkgs/blob/09c38c29f2c719cd76ca17a596c2fdac9e186ceb/pkgs/shells/fish/default.nix#L76-L117)
`__fish_build_paths.fish` handles vendored fish scripts from Nixpkgs. It's error-prone to replicate its logic when it is present.
**If fish isn't installed from Nixpkgs, consider `nix-env.fish` instead.**