From 27bd5f86528bcf25122c9fa8917798a4ce52a41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 1 Oct 2022 13:37:46 +0100 Subject: [PATCH] add nil to vim --- flake.lock | 51 +++++++++++++++++++++++++++++ flake.nix | 12 ++++++- nixos/home-manager/programs/vim.nix | 22 ++++++++++--- 3 files changed, 80 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 69fd4c03..02b0f9d8 100644 --- a/flake.lock +++ b/flake.lock @@ -58,6 +58,31 @@ "type": "github" } }, + "nil": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs-nixos-unstable" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1664360253, + "narHash": "sha256-QXXzd6SYgpuFGcr6D8gtALC2V23kPIT4IkSM0eU6MJI=", + "owner": "oxalica", + "repo": "nil", + "rev": "d2a22b8460279a001bf070bcd6da660bda9c8bd7", + "type": "github" + }, + "original": { + "owner": "oxalica", + "ref": "main", + "repo": "nil", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1663229557, @@ -159,6 +184,7 @@ "darwin": "darwin", "flake-utils": "flake-utils", "home-manager": "home-manager", + "nil": "nil", "nixos-hardware": "nixos-hardware", "nixpkgs-master": "nixpkgs-master", "nixpkgs-nixos-unstable": "nixpkgs-nixos-unstable", @@ -167,6 +193,31 @@ "sops": "sops" } }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "nil", + "flake-utils" + ], + "nixpkgs": [ + "nil", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1663815552, + "narHash": "sha256-J4j/d69SGKx1qripBCINe7T3SUtMM1sdj5PoHRThV5Q=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "f45f856ae5a9fe2c48d756fa17bb9c5b3b8070c5", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "sops": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index 4d34c6e5..5175d181 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "NixOS configuration with flakes"; outputs = { self, flake-utils, home-manager, nixpkgs-nixos-unstable - , nixpkgs-master, nixpkgs-stable, darwin, nixos-hardware, nur, sops, + , nixpkgs-master, nixpkgs-stable, darwin, nixos-hardware, nur, sops, nil }@inputs: let @@ -66,6 +66,7 @@ imports = [ ./nixos/home-manager ./nixos/home-manager/linux.nix ]; _module.args.inputs = inputs; + _module.args.system = system; }; } @@ -262,6 +263,15 @@ ref = "master"; }; + nil = { + type = "github"; + owner = "oxalica"; + repo = "nil"; + ref = "main"; + inputs.nixpkgs.follows = "nixpkgs-nixos-unstable"; + inputs.flake-utils.follows = "flake-utils"; + }; + sops = { type = "github"; owner = "Mic92"; diff --git a/nixos/home-manager/programs/vim.nix b/nixos/home-manager/programs/vim.nix index 4aa1c978..1fee233a 100644 --- a/nixos/home-manager/programs/vim.nix +++ b/nixos/home-manager/programs/vim.nix @@ -1,4 +1,6 @@ -{ config, pkgs, lib, inputs, ... }: { +{ config, pkgs, lib, inputs, system, ... }: +let nil = inputs.nil.packages."${system}".default; +in { home.file.".vimrc".source = ../../../.vimrc; home.packages = with pkgs; [ ripgrep ]; programs.neovim = { @@ -7,15 +9,27 @@ enable = true; package = pkgs.vimUtils.buildVimPluginFrom2Nix { pname = "coc.nvim"; - version = "2022-05-21"; + version = "v0.0.82"; src = pkgs.fetchFromGitHub { owner = "neoclide"; repo = "coc.nvim"; - rev = "791c9f673b882768486450e73d8bda10e391401d"; - sha256 = "sha256-MobgwhFQ1Ld7pFknsurSFAsN5v+vGbEFojTAYD/kI9c="; + rev = "v0.0.82"; + sha256 = "sha256-TIkx/Sp9jnRd+3jokab91S5Mb3JV8yyz3wy7+UAd0A0="; }; meta.homepage = "https://github.com/neoclide/coc.nvim/"; }; + settings = '' + { + "languageserver": { + "nix": { + "command": "${nil}/bin/nil", + "filetypes": ["nix"], + "rootPatterns": ["flake.nix"] + } + } + } + ''; + }; viAlias = true; vimAlias = true;