├── .gitignore ├── .travis.yml ├── README.md ├── default.nix └── nix ├── sources.json └── sources.nix /.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: nix 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## nix-neovim-nightly 2 | 3 | [![Build Status](https://travis-ci.com/gilligan/nix-neovim-nightly.svg?branch=master)](https://travis-ci.com/gilligan/nix-neovim-nightly) 4 | 5 | This repository provides a nix package of neovim nightly. If you want to try bleeding edge features like 6 | floating window support and you are using Nix/NixOS you have come to the right place ;-) 7 | 8 | ### Installation 9 | 10 | ``` 11 | $ nix-env -i -f https://github.com/gilligan/nix-neovim-nightly/tarball/master 12 | ``` 13 | 14 | **NOTE**: neovim is installed as `nvim-nightly` since you might want to install it side by side with 15 | a stable neovim version. 16 | 17 | #### Cachix 18 | 19 | You can also make use of [cachix](https://cachix.org) if you want to avoid building anything 20 | 21 | ``` 22 | $ cachix use neovim-nightly 23 | ``` 24 | 25 | ### Notes 26 | 27 | This build uses the [this nixpkgs fork](https://github.com/rvolosatovs/nixpkgs/tree/feature/nightly-neovim) mentioned 28 | in [this nixpkgs issue](https://github.com/NixOS/nixpkgs/issues/64400) since building recent neovim versions from master 29 | is currently broken on nixpkgs. 30 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? (import ./nix/sources.nix).nixpkgs 2 | , nvim ? (import ./nix/sources.nix).neovim 3 | }: 4 | 5 | let 6 | overlay = self: super: { 7 | neovim-nightly = super.neovim.overrideAttrs (old: { 8 | src = self.fetchFromGitHub { 9 | owner = nvim.owner; 10 | repo = nvim.repo; 11 | rev = nvim.rev; 12 | sha256 = nvim.sha256; 13 | }; 14 | }); 15 | }; 16 | in 17 | let 18 | nixpkgs = (import pkgs {config = {}; overlays = [overlay]; }); 19 | in 20 | nixpkgs.stdenv.mkDerivation { 21 | pname = "neovim-nightly"; 22 | version = nvim.rev; 23 | buildInputs = [nixpkgs.makeWrapper]; 24 | buildCommand = '' 25 | makeWrapper ${nixpkgs.neovim-nightly}/bin/nvim $out/bin/nvim-nightly 26 | ''; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /nix/sources.json: -------------------------------------------------------------------------------- 1 | { 2 | "neovim": { 3 | "branch": "nightly", 4 | "description": "Vim-fork focused on extensibility and usability", 5 | "homepage": "https://neovim.io", 6 | "owner": "neovim", 7 | "repo": "neovim", 8 | "rev": "0785f8e8b11b2fa290cfbc0604d570f49b954ba6", 9 | "sha256": "0pj7r14b056r8jwc5571qd8xk1aq2sx1ydc70jdgldcc92ixkgrq", 10 | "type": "tarball", 11 | "url": "https://github.com/neovim/neovim/archive/0785f8e8b11b2fa290cfbc0604d570f49b954ba6.tar.gz", 12 | "url_template": "https://github.com///archive/.tar.gz" 13 | }, 14 | "niv": { 15 | "branch": "master", 16 | "description": "Easy dependency management for Nix projects", 17 | "homepage": "https://github.com/nmattia/niv", 18 | "owner": "nmattia", 19 | "repo": "niv", 20 | "rev": "5e9671a9a87c240b1c6ce981d04ad23ba4291451", 21 | "sha256": "08j7msxkv452pyxnh0sgn6h9930i5mk9mszba49bj5401gzmfb8a", 22 | "type": "tarball", 23 | "url": "https://github.com/nmattia/niv/archive/5e9671a9a87c240b1c6ce981d04ad23ba4291451.tar.gz", 24 | "url_template": "https://github.com///archive/.tar.gz" 25 | }, 26 | "nixpkgs": { 27 | "branch": "feature/nightly-neovim", 28 | "description": "Nix Packages collection", 29 | "homepage": null, 30 | "owner": "rvolosatovs", 31 | "repo": "nixpkgs", 32 | "rev": "cc7106d6cbf11f291df6d6db7cd162985d450d1a", 33 | "sha256": "1jsmb1x52vpl7gn4c8f3xwgfjgwikdbvgp50zr66rlbvwfrarfrv", 34 | "type": "tarball", 35 | "url": "https://github.com/rvolosatovs/nixpkgs/archive/cc7106d6cbf11f291df6d6db7cd162985d450d1a.tar.gz", 36 | "url_template": "https://github.com///archive/.tar.gz" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /nix/sources.nix: -------------------------------------------------------------------------------- 1 | # This file has been generated by Niv. 2 | 3 | # A record, from name to path, of the third-party packages 4 | with rec 5 | { 6 | pkgs = 7 | if hasNixpkgsPath 8 | then 9 | if hasThisAsNixpkgsPath 10 | then import (builtins_fetchTarball { inherit (sources_nixpkgs) url sha256; }) {} 11 | else import {} 12 | else 13 | import (builtins_fetchTarball { inherit (sources_nixpkgs) url sha256; }) {}; 14 | 15 | sources_nixpkgs = 16 | if builtins.hasAttr "nixpkgs" sources 17 | then sources.nixpkgs 18 | else abort 19 | '' 20 | Please specify either (through -I or NIX_PATH=nixpkgs=...) or 21 | add a package called "nixpkgs" to your sources.json. 22 | ''; 23 | 24 | # fetchTarball version that is compatible between all the versions of Nix 25 | builtins_fetchTarball = 26 | { url, sha256 }@attrs: 27 | let 28 | inherit (builtins) lessThan nixVersion fetchTarball; 29 | in 30 | if lessThan nixVersion "1.12" then 31 | fetchTarball { inherit url; } 32 | else 33 | fetchTarball attrs; 34 | 35 | # fetchurl version that is compatible between all the versions of Nix 36 | builtins_fetchurl = 37 | { url, sha256 }@attrs: 38 | let 39 | inherit (builtins) lessThan nixVersion fetchurl; 40 | in 41 | if lessThan nixVersion "1.12" then 42 | fetchurl { inherit url; } 43 | else 44 | fetchurl attrs; 45 | 46 | # A wrapper around pkgs.fetchzip that has inspectable arguments, 47 | # annoyingly this means we have to specify them 48 | fetchzip = { url, sha256 }@attrs: pkgs.fetchzip attrs; 49 | 50 | hasNixpkgsPath = (builtins.tryEval ).success; 51 | hasThisAsNixpkgsPath = 52 | (builtins.tryEval ).success && == ./.; 53 | 54 | sources = builtins.fromJSON (builtins.readFile ./sources.json); 55 | 56 | mapAttrs = builtins.mapAttrs or 57 | (f: set: with builtins; 58 | listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))); 59 | 60 | # borrowed from nixpkgs 61 | functionArgs = f: f.__functionArgs or (builtins.functionArgs f); 62 | callFunctionWith = autoArgs: f: args: 63 | let auto = builtins.intersectAttrs (functionArgs f) autoArgs; 64 | in f (auto // args); 65 | 66 | getFetcher = spec: 67 | let fetcherName = 68 | if builtins.hasAttr "type" spec 69 | then builtins.getAttr "type" spec 70 | else "builtin-tarball"; 71 | in builtins.getAttr fetcherName { 72 | "tarball" = fetchzip; 73 | "builtin-tarball" = builtins_fetchTarball; 74 | "file" = pkgs.fetchurl; 75 | "builtin-url" = builtins_fetchurl; 76 | }; 77 | }; 78 | # NOTE: spec must _not_ have an "outPath" attribute 79 | mapAttrs (_: spec: 80 | if builtins.hasAttr "outPath" spec 81 | then abort 82 | "The values in sources.json should not have an 'outPath' attribute" 83 | else 84 | if builtins.hasAttr "url" spec && builtins.hasAttr "sha256" spec 85 | then 86 | spec // 87 | { outPath = callFunctionWith spec (getFetcher spec) { }; } 88 | else spec 89 | ) sources 90 | --------------------------------------------------------------------------------