Skip to content

Commit

Permalink
book: Install helix declaratively from nixpkgs on NixOS
Browse files Browse the repository at this point in the history
This is really the most simple way, and helix is well maintained in
nixpkgs.

The flake solution is overly complicated for newcomers to NixOS, as I
just witnessed on our support room. Copying/adapting/understanding that
expression is far easier.
  • Loading branch information
mweinelt committed May 18, 2023
1 parent 7f5940b commit 7c1be2c
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion book/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,34 @@ in the AUR, which builds the master branch.

### NixOS

Helix is available as a [flake](https://nixos.wiki/wiki/Flakes) in the project
Helix is packaged into nixpkgs and can be installed declaratively through your system configuration.

```nix
environment.systemPackages = with pkgs; [
helix
];
```

If the version on the NixOS stable release is too old, an overlay can be used to update to the package
version from `nixos-unstable`.

```sh
nix-channel --add https://channels.nixos.org/nixos-unstable nixos-unstable
nix-channel --update
```

```nix
let
unstable = import <nixos-unstable> { };
in
nixpkgs.overlays = [
(prev: final: {
inherit (unstable) helix;
})
];
```

Helix is also available as a [flake](https://nixos.wiki/wiki/Flakes) in the project
root. Use `nix develop` to spin up a reproducible development shell. Outputs are
cached for each push to master using [Cachix](https://www.cachix.org/). The
flake is configured to automatically make use of this cache assuming the user
Expand Down

0 comments on commit 7c1be2c

Please sign in to comment.