Skip to content

Commit

Permalink
chore(nix): cleanup (ayamir#1252)
Browse files Browse the repository at this point in the history
* chore(nix): cleanup

This commit introduced three changes:

1. Opt for a shallow clone whenever we run the `update_flake`
   workflow since there's no need to retrive past commits.
2. Deleted `result` from `.gitignore` bc I couldn't track down its
   source (correct me if I'm wrong!)
3. Ensure either XCode or the CLT is installed on macOS before
   running `otool`. These aren't included by default on a fresh
   macOS install, and using `xcrun` can sort out those dependency
   snags.

Signed-off-by: Jint-lzxy <[email protected]>

* revert(gitignore): add `result/` back

Signed-off-by: Charles Chiu <[email protected]>

---------

Signed-off-by: Jint-lzxy <[email protected]>
Signed-off-by: Charles Chiu <[email protected]>
Co-authored-by: Charles Chiu <[email protected]>
  • Loading branch information
2 people authored and Saafo committed Jun 24, 2024
1 parent a6a3356 commit 6f812b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/update_flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to count the commits
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-unstable
Expand Down
12 changes: 6 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@
name = "check-linker";
text =
let
ldd_cmd = if pkgs.stdenv.isDarwin then "otool -L" else "${pkgs.glibc.bin}/bin/ldd";
ldd_cmd = if pkgs.stdenv.isDarwin then "xcrun 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"
source <(sed -ne :1 -e 'N;1,1b1' -e 'P;D' "${self.packages.${system}.testEnv}/home-path/bin/nvim")
echo "Checking files 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"
echo "$line" | grep -q "/nix/store" || printf '%s: %s does not link to /nix/store \n' "$(basename "$link")" "$line"
done
done
echo "check done"
echo "*** Done ***"
'';
};
};
Expand All @@ -69,7 +69,7 @@
motd = ''
{202}🔨 Welcome to devshell{reset}
Symlink configs to "''${XDG_CONFIG_HOME}"/nvimdots!
And NVIM_APPNAME=nvimdots is already configured, so neovim will put file under "\$XDG_xxx_HOME"/nvimdots.
And NVIM_APPNAME=nvimdots is already configured, so neovim will put files under "\$XDG_xxx_HOME"/nvimdots.
To uninstall, remove "\$XDG_xxx_HOME"/nvimdots.
$(type -p menu &>/dev/null && menu)
Expand Down

0 comments on commit 6f812b2

Please sign in to comment.