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

vscode: avoid unnecessary IFD (#2506)

This commit is contained in:
Naïm Favier 2021-11-25 02:55:38 +01:00 committed by GitHub
parent 609370699f
commit e28185a2c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,11 +127,13 @@ in {
# Adapted from https://discourse.nixos.org/t/vscode-extensions-setup/1801/2 # Adapted from https://discourse.nixos.org/t/vscode-extensions-setup/1801/2
home.file = let home.file = let
subDir = "share/vscode/extensions"; subDir = "share/vscode/extensions";
toPaths = path: toPaths = ext:
# Links every dir in path to the extension path. # Links every dir in ext to the extension path.
mapAttrsToList map (k: { "${extensionPath}/${k}".source = "${ext}/${subDir}/${k}"; })
(k: _: { "${extensionPath}/${k}".source = "${path}/${subDir}/${k}"; }) (if ext ? vscodeExtUniqueId then
(builtins.readDir (path + "/${subDir}")); [ ext.vscodeExtUniqueId ]
else
builtins.attrNames (builtins.readDir (ext + "/${subDir}")));
toSymlink = concatMap toPaths cfg.extensions; toSymlink = concatMap toPaths cfg.extensions;
dropNullFields = filterAttrs (_: v: v != null); dropNullFields = filterAttrs (_: v: v != null);
in foldr (a: b: a // b) { in foldr (a: b: a // b) {