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".
This commit is contained in:
Silvan Mosberger 2017-09-17 17:27:26 +02:00 committed by Nikita Uvarov
parent de5f902487
commit e4deffcbe8
No known key found for this signature in database
GPG key ID: F7A5FB3A7C10EF96

View file

@ -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 ];
}
);
}