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:
parent
609370699f
commit
e28185a2c0
1 changed files with 7 additions and 5 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue