1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

vscode: add extrapackages option

adds support for a extraPackages option for lsps
based on #4586
This commit is contained in:
xyangst 2024-01-02 09:38:39 +01:00
parent 6e91c5df19
commit fe5953dd13

View file

@ -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 != { }) {