Skip to content

Nix install instructions are outdated/wrong/confusing. #21

Open
@thomastjeffery

Description

@thomastjeffery

The information here is confusing, convoluted, and doesn't seem to work.

The real way to build yi with Nix

To build yi in Nix, here is what you currently can do:

  1. Set up package overrides in Nix, so yi will build at all
    Put the following in your ~/.config/nixpkgs/config.nix:
{
  packageOverrides = pkgs: {
    haskellPackages = pkgs.haskellPackages.override {
      overrides = self: super: {
        yi-core            = super.yi-core_0_16_0;
        yi-frontend-vty    = super.yi-frontend-vty_0_16_0;
        yi-fuzzy-open      = super.yi-fuzzy-open_0_16_0;
        yi-ireader         = super.yi-ireader_0_16_0;
        yi-keymap-cua      = super.yi-keymap-cua_0_16_0;
        yi-keymap-emacs    = super.yi-keymap-emacs_0_16_0;
        yi-keymap-vim      = super.yi-keymap-vim_0_16_0;
        yi-language        = super.yi-language_0_16_0;
        yi-misc-modes      = super.yi-misc-modes_0_16_0;
        yi-mode-haskell    = super.yi-mode-haskell_0_16_0;
        yi-mode-javascript = super.yi-mode-javascript_0_16_0;
        yi-snippet         = super.yi-snippet_0_16_0;
        yi-rope            = super.yi-rope_0_10;
      };
    };
  };
}

If you don't do this, nix will complain that it has missing dependencies.

  1. Copy an example config to the right place
$ cp yi-editor/yi/example-configs/yi-config-that-you-want/* ~/.config/yi/
  1. Go to ~/.config/yi/, and build yi.
    You can leave out the -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz if you are already using the master channel. This will not work on another channel like NixOS-17.09.
$ cd ~/.config/yi/
$ nix-shell -p cabal2nix -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
[nix-shell]$ cabal2nix . > default.nix
[nix-shell]$ cabal2nix --shell . > shell.nix
[nix-shell]$ exit
$ nix-build shell.nix -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
  1. Run yi
    You need to use nix-shell, so yi can rebuild the configuration you made.
$ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz
[nix-shell]$ ./result/bin/yi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions