From 3d60e899141dd2d0314686c7d2c4f1303d03580f Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 7 May 2024 00:09:25 +0800 Subject: [PATCH 1/2] 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 <50296129+Jint-lzxy@users.noreply.github.com> --- .github/workflows/update_flake.yml | 2 -- .gitignore | 1 - flake.nix | 12 ++++++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/update_flake.yml b/.github/workflows/update_flake.yml index 88090f3b7..9d9e31c51 100644 --- a/.github/workflows/update_flake.yml +++ b/.github/workflows/update_flake.yml @@ -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 diff --git a/.gitignore b/.gitignore index 51c6018f4..8dec07754 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ lua/modules/plugins/custom.lua lua/modules/configs/custom lua/user -result diff --git a/flake.nix b/flake.nix index f24cfc588..9dd3840c7 100644 --- a/flake.nix +++ b/flake.nix @@ -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 ***" ''; }; }; @@ -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) From 7c510004a84ecc62806e54e1fb316d833452d6f6 Mon Sep 17 00:00:00 2001 From: Charles Chiu Date: Tue, 7 May 2024 14:26:14 +0800 Subject: [PATCH 2/2] revert(gitignore): add `result/` back Signed-off-by: Charles Chiu --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8dec07754..51c6018f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ lua/modules/plugins/custom.lua lua/modules/configs/custom lua/user +result