Skip to content

Commit

Permalink
Backport refined bump_completions from #576
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed May 27, 2024
1 parent 505593d commit 4c7187f
Showing 1 changed file with 27 additions and 9 deletions.
36 changes: 27 additions & 9 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,35 @@
# - Tiny tools by me, they may be rewritten with another language.
# - Aliases across multiple shells
rec {
bump_completions = pkgs.writeShellScriptBin "bump_completions" ''
set -euo pipefail
bump_completions = pkgs.writeShellApplication {
name = "bump_completions";
runtimeInputs = with pkgs; [
git
podman
dprint
];
text = ''
podman completion bash > ./dependencies/podman/completions.bash
podman completion zsh > ./dependencies/podman/completions.zsh
podman completion fish > ./dependencies/podman/completions.fish
git add ./dependencies/podman
# https://stackoverflow.com/q/34807971
git update-index -q --really-refresh
git diff-index --quiet HEAD || git commit -m 'Update podman completions' ./dependencies/podman
${pkgs.podman}/bin/podman completion bash > ./dependencies/podman/completions.bash
${pkgs.podman}/bin/podman completion zsh > ./dependencies/podman/completions.zsh
${pkgs.podman}/bin/podman completion fish > ./dependencies/podman/completions.fish
dprint completions bash > ./dependencies/dprint/completions.bash
dprint completions zsh > ./dependencies/dprint/completions.zsh
dprint completions fish > ./dependencies/dprint/completions.fish
${pkgs.dprint}/bin/dprint completions bash > ./dependencies/dprint/completions.bash
${pkgs.dprint}/bin/dprint completions zsh > ./dependencies/dprint/completions.zsh
${pkgs.dprint}/bin/dprint completions fish > ./dependencies/dprint/completions.fish
'';
git add ./dependencies/dprint
git update-index -q --really-refresh
git diff-index --quiet HEAD || git commit -m 'Update dprint completions' ./dependencies/dprint
'';
meta = {
description = "Bump shell completions with cached files to make faster";
};
};

check_no_dirty_xz_in_nix_store = pkgs.writeShellApplication {
name = "check_no_dirty_xz_in_nix_store";
Expand Down

0 comments on commit 4c7187f

Please sign in to comment.