mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
vscode: add extrapackages option
adds support for a extraPackages option for lsps based on #4586
This commit is contained in:
parent
6e91c5df19
commit
fe5953dd13
1 changed files with 23 additions and 1 deletions
|
@ -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 {
|
enableUpdateCheck = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
@ -221,7 +228,22 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
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 [
|
home.file = mkMerge [
|
||||||
(mkIf (mergedUserSettings != { }) {
|
(mkIf (mergedUserSettings != { }) {
|
||||||
|
|
Loading…
Reference in a new issue