Skip to content

Commit

Permalink
Merge branch 'fix/nixos' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
misumisumi committed May 4, 2024
2 parents bc03e46 + 51b2080 commit fe06f6b
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,24 @@
testEnv = (import ./nixos/testEnv.nix { inherit inputs pkgs; }).activationPackage;
check-linker = pkgs.writeShellApplication {
name = "check-linker";
text = ''
os=$(uname -s)
if [ "$os" = "Darwin" ]; then
ldd_cmd="otool -L"
elif [ "$os" = "Linux" ]; then
ldd_cmd="${pkgs.glibc.bin}/bin/ldd"
else
echo "Unsupported OS"
exit 1
fi
#shellcheck disable=SC1090
source <(sed -ne :1 -e 'N;1,1b1' -e 'P;D' "${self.packages.${system}.testEnv}/home-path/bin/nvim")
echo "check file under ''${XDG_DATA_HOME}/''${NVIM_APPNAME:-nvim}/mason/bin"
find "''${XDG_DATA_HOME}/''${NVIM_APPNAME:-nvim}/mason/bin" -type l | while read -r link; do
"$ldd_cmd" "$(readlink -f "$link")" > /dev/zero 2>&1 || continue
linkers=$("$ldd_cmd" "$(readlink -f "$link")" | tail -n+2)
echo "$linkers" | while read -r line; do
[ -z "$line" ] && continue
echo "$line" | grep -q "/nix/store" || printf '%s: %s do not link to /nix/store \n' "$(basename "$link")" "$line"
text =
let
ldd_cmd = if pkgs.stdenv.isDarwin then "otool -L" else "${pkgs.glibc.bin}/bin/ldd";
in
''
#shellcheck disable=SC1090
source <(sed -ne :1 -e 'N;1,1b1' -e 'P;D' "${self.packages.${system}.testEnv}/home-path/bin/nvim")
echo "check file under ''${XDG_DATA_HOME}/''${NVIM_APPNAME:-nvim}/mason/bin"
find "''${XDG_DATA_HOME}/''${NVIM_APPNAME:-nvim}/mason/bin" -type l | while read -r link; do
"${ldd_cmd}" "$(readlink -f "$link")" > /dev/zero 2>&1 || continue
linkers=$("${ldd_cmd}" "$(readlink -f "$link")" | tail -n+2)
echo "$linkers" | while read -r line; do
[ -z "$line" ] && continue
echo "$line" | grep -q "/nix/store" || printf '%s: %s do not link to /nix/store \n' "$(basename "$link")" "$line"
done
done
done
echo "check done"
'';
echo "check done"
'';
};
};
devshells.default = {
Expand Down

0 comments on commit fe06f6b

Please sign in to comment.