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

vscode: fix erroneous application of lib.optional (#3655)

This commit is contained in:
Nathan van Doorn 2023-02-08 12:18:28 +01:00 committed by GitHub
parent d7a5a28fc3
commit e631d78ddf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,7 +221,7 @@ in {
builtins.attrNames (builtins.readDir (ext + "/${subDir}"))); builtins.attrNames (builtins.readDir (ext + "/${subDir}")));
in if cfg.mutableExtensionsDir then in if cfg.mutableExtensionsDir then
mkMerge (concatMap toPaths cfg.extensions mkMerge (concatMap toPaths cfg.extensions
++ lib.optional (lib.versionAtLeast vscodeVersion "1.74.0") [{ ++ lib.optional (lib.versionAtLeast vscodeVersion "1.74.0") {
# Whenever our immutable extensions.json changes, force VSCode to regenerate # Whenever our immutable extensions.json changes, force VSCode to regenerate
# extensions.json with both mutable and immutable extensions. # extensions.json with both mutable and immutable extensions.
"${extensionPath}/.extensions-immutable.json" = { "${extensionPath}/.extensions-immutable.json" = {
@ -232,14 +232,14 @@ in {
$DRY_RUN_CMD ${getExe cfg.package} --list-extensions > /dev/null $DRY_RUN_CMD ${getExe cfg.package} --list-extensions > /dev/null
''; '';
}; };
}]) })
else { else {
"${extensionPath}".source = let "${extensionPath}".source = let
combinedExtensionsDrv = pkgs.buildEnv { combinedExtensionsDrv = pkgs.buildEnv {
name = "vscode-extensions"; name = "vscode-extensions";
paths = cfg.extensions paths = cfg.extensions
++ lib.optional (lib.versionAtLeast vscodeVersion "1.74.0") ++ lib.optional (lib.versionAtLeast vscodeVersion "1.74.0")
[ extensionJsonFile ]; extensionJsonFile;
}; };
in "${combinedExtensionsDrv}/${subDir}"; in "${combinedExtensionsDrv}/${subDir}";
})) }))