vscode: add extrapackages option
adds support for a extraPackages option for lsps based on #4586
This commit is contained in:
parent
6e91c5df19
commit
fe5953dd13
|
@ -72,6 +72,13 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
extraPackages = mkOption {
|
||||
type = with types; listOf package;
|
||||
default = [ ];
|
||||
example = literalExpression "[ pkgs.nil ]";
|
||||
description = "Extra packages available to hx.";
|
||||
};
|
||||
|
||||
enableUpdateCheck = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -221,7 +228,22 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = if cfg.extraPackages != [ ] then
|
||||
[
|
||||
(pkgs.symlinkJoin {
|
||||
name =
|
||||
"${lib.getName cfg.package}-wrapped-${lib.getVersion cfg.package}";
|
||||
paths = [ cfg.package ];
|
||||
preferLocalBuild = true;
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/code \
|
||||
--prefix PATH : ${lib.makeBinPath cfg.extraPackages}
|
||||
'';
|
||||
})
|
||||
]
|
||||
else
|
||||
[ cfg.package ];
|
||||
|
||||
home.file = mkMerge [
|
||||
(mkIf (mergedUserSettings != { }) {
|
||||
|
|
Loading…
Reference in a new issue