Skip to content

Commit

Permalink
Merge pull request #135 from marienz/main
Browse files Browse the repository at this point in the history
Omit symlinks to avoid a file collision
  • Loading branch information
Mic92 authored Dec 26, 2024
2 parents 02dadae + 0a961f6 commit 89188f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 3 additions & 5 deletions comma-wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
lib,
linkFarm,
symlinkJoin,
makeBinaryWrapper,
comma,
Expand All @@ -13,13 +13,11 @@ symlinkJoin {
name = "comma-with-db-${comma.version}";
paths = [ commaOverridden ];
nativeBuildInputs = [ makeBinaryWrapper ];
databaseDirectory = linkFarm "nix-index-database" { files = nix-index-database; };
postBuild = ''
mkdir -p $out/share/cache/nix-index
ln -s ${nix-index-database} $out/share/cache/nix-index/files
for cmd in "," "comma"; do
wrapProgram "$out/bin/$cmd" \
--set NIX_INDEX_DATABASE $out/share/cache/nix-index
--set NIX_INDEX_DATABASE $databaseDirectory
done
'';

Expand Down
7 changes: 3 additions & 4 deletions nix-index-wrapper.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
linkFarm,
symlinkJoin,
makeBinaryWrapper,
nix-index-unwrapped,
Expand All @@ -9,12 +10,10 @@ symlinkJoin {
name = "nix-index-with-${db-type}-db-${nix-index-unwrapped.version}";
paths = [ nix-index-unwrapped ];
nativeBuildInputs = [ makeBinaryWrapper ];
databaseDirectory = linkFarm "nix-index-database" { files = nix-index-database; };
postBuild = ''
mkdir -p $out/share/cache/nix-index
ln -s ${nix-index-database} $out/share/cache/nix-index/files
wrapProgram $out/bin/nix-locate \
--set NIX_INDEX_DATABASE $out/share/cache/nix-index
--set NIX_INDEX_DATABASE $databaseDirectory
mkdir -p $out/etc/profile.d
rm -f "$out/etc/profile.d/command-not-found.sh"
Expand Down

0 comments on commit 89188f9

Please sign in to comment.