From e4deffcbe8f71c51585507d878d7a9fbd2fe91e5 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Sun, 17 Sep 2017 17:27:26 +0200 Subject: [PATCH] vim: add package option This adds a readonly package option which will be set to the resulting configured vim package, so it can be refered to by other configuration. An example would be home.sessionVariables.EDITOR = config.programs.vim.package + "/bin/vim". --- modules/programs/vim.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/programs/vim.nix b/modules/programs/vim.nix index e019751a..e246c21f 100644 --- a/modules/programs/vim.nix +++ b/modules/programs/vim.nix @@ -46,6 +46,12 @@ in ''; description = "Custom .vimrc lines"; }; + + package = mkOption { + type = types.package; + description = "Resulting customized vim package"; + readOnly = true; + }; }; }; @@ -71,7 +77,8 @@ in }; in mkIf cfg.enable { - home.packages = [ vim ]; + programs.vim.package = vim; + home.packages = [ cfg.package ]; } ); }