From 1f55cfb230131c11ced28ecefedb1b29db63e5d2 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Tue, 13 Apr 2021 14:05:10 -0400 Subject: [PATCH] update vim --- default.nix | 1 + modules/cli.nix | 9 --------- modules/vim.nix | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 modules/vim.nix diff --git a/default.nix b/default.nix index 3db8943..f31d893 100644 --- a/default.nix +++ b/default.nix @@ -16,5 +16,6 @@ ./modules/security-tools.nix ./modules/status-on-console.nix ./modules/sway.nix + ./modules/vim.nix ]; } diff --git a/modules/cli.nix b/modules/cli.nix index 896e63d..c742bfd 100644 --- a/modules/cli.nix +++ b/modules/cli.nix @@ -42,15 +42,6 @@ in (writeShellScriptBin "nix-roots" "nix-store --gc --print-roots | grep -v ^/proc/") - (vim_configurable.customize { - name = "vim"; - vimrcConfig.customRC = '' - syntax enable - filetype plugin indent on - set nowrap ruler scrolloff=9 backspace=start,indent - ''; - }) - (writeScriptBin "zfsram" '' #!${pkgs.python3}/bin/python for ln in open('/proc/spl/kstat/zfs/arcstats').readlines(): diff --git a/modules/vim.nix b/modules/vim.nix new file mode 100644 index 0000000..fc655ff --- /dev/null +++ b/modules/vim.nix @@ -0,0 +1,22 @@ +{ config, pkgs, ... }: +let + legacy = (config.system.nixos.release == "20.09"); +in +{ + + environment.systemPackages = if legacy then [ pkgs.vim ] else [ ]; + + programs = if legacy then { } else { + neovim = { + enable = true; + viAlias = true; + configure = { + packages.foo.start = [ pkgs.vimPlugins.vim-nix ]; + customRC = '' + set nowrap scrolloff=9 + ''; + }; + }; + }; + +}