From 992190a351e4a6134eff2343af690aa985682806 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 6 Jul 2022 23:44:31 +0200 Subject: [PATCH] Move nvim activation script to nvim-specific file --- home.nix | 11 +---------- programs/nvim/default.nix | 32 ++++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/home.nix b/home.nix index 7df0f27..aff2338 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ pkgs, ... }: { imports = [ @@ -60,15 +60,6 @@ wget xz ]; - - activation = { - updateAppCaches = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - # neovim - echo -n '[nvim] Removing luacache file: ' - $DRY_RUN_CMD rm -f $HOME/.cache/nvim/luacache* - echo 'Done' - ''; - }; }; programs = { diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index d851452..b01a6f7 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let customPlugins = import ./plugins.nix { inherit pkgs; }; @@ -400,15 +400,27 @@ in recursive = true; }; - home.file."${nvim-spell-directory}/de.utf-8.spl".source = builtins.fetchurl { - url = "http://ftp.vim.org/pub/vim/runtime/spell/de.utf-8.spl"; - sha256 = "73c7107ea339856cdbe921deb92a45939c4de6eb9c07261da1b9dd19f683a3d1"; - }; + home = { + activation = { + neovimActivation = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + echo -n 'Removing luacache files: ' + $DRY_RUN_CMD rm -f $HOME/.cache/nvim/luacache* + echo 'Done' + ''; + }; - home.file."${nvim-spell-directory}/de.utf-8.sug".source = builtins.fetchurl { - url = "http://ftp.vim.org/pub/vim/runtime/spell/de.utf-8.sug"; - sha256 = "13d0ecf92863d89ef60cd4a8a5eb2a5a13a0e8f9ba8d1c6abe47aba85714a948"; - }; + sessionVariables.EDITOR = "nvim"; - home.sessionVariables.EDITOR = "nvim"; + file = { + "${nvim-spell-directory}/de.utf-8.spl".source = builtins.fetchurl { + url = "http://ftp.vim.org/pub/vim/runtime/spell/de.utf-8.spl"; + sha256 = "73c7107ea339856cdbe921deb92a45939c4de6eb9c07261da1b9dd19f683a3d1"; + }; + + "${nvim-spell-directory}/de.utf-8.sug".source = builtins.fetchurl { + url = "http://ftp.vim.org/pub/vim/runtime/spell/de.utf-8.sug"; + sha256 = "13d0ecf92863d89ef60cd4a8a5eb2a5a13a0e8f9ba8d1c6abe47aba85714a948"; + }; + }; + }; }