feat: drop xtask
This commit is contained in:
parent
1aac97d906
commit
2e5b98bdee
|
@ -56,7 +56,7 @@ let
|
||||||
with (fromJSON (readFile ./flake.lock)).nodes.${name}.locked; {
|
with (fromJSON (readFile ./flake.lock)).nodes.${name}.locked; {
|
||||||
inherit rev;
|
inherit rev;
|
||||||
outPath = fetchurl {
|
outPath = fetchurl {
|
||||||
url = url;
|
inherit url;
|
||||||
sha256 = narHash;
|
sha256 = narHash;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
20
flake.nix
20
flake.nix
|
@ -32,9 +32,27 @@
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
packages = eachSystem (system: packagesFn pkgs.${system});
|
packages = eachSystem (system: packagesFn pkgs.${system});
|
||||||
overlays.default = final: prev: packagesFn prev;
|
overlays.default = _: packagesFn;
|
||||||
githubActions = nix-github-actions.lib.mkGithubMatrix {
|
githubActions = nix-github-actions.lib.mkGithubMatrix {
|
||||||
checks = nixpkgs.lib.getAttrs ["x86_64-linux"] self.packages;
|
checks = nixpkgs.lib.getAttrs ["x86_64-linux"] self.packages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
formatter = eachSystem (system:
|
||||||
|
pkgs.${system}.writeShellApplication {
|
||||||
|
name = "format";
|
||||||
|
runtimeInputs = with pkgs.${system}; [
|
||||||
|
alejandra
|
||||||
|
deadnix
|
||||||
|
shfmt
|
||||||
|
statix
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
set -euo pipefail
|
||||||
|
shfmt --write --simplify --language-dialect bash --indent 2 --case-indent --space-redirects .;
|
||||||
|
deadnix --edit
|
||||||
|
statix check . || statix fix .
|
||||||
|
alejandra --quiet .
|
||||||
|
'';
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
disabled = [
|
||||||
|
"repeated_keys"
|
||||||
|
]
|
||||||
|
nix_version = '2.4'
|
||||||
|
ignore = ['.direnv']
|
46
xtask
46
xtask
|
@ -1,46 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -u
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
case "${1:-nothing}" in
|
|
||||||
build)
|
|
||||||
nix flake show --json | jq -r '.packages."x86_64-linux"|keys[]' | xargs -I {} nix build .#{}
|
|
||||||
;;
|
|
||||||
clean)
|
|
||||||
fd -Itl -X rm -rfv
|
|
||||||
;;
|
|
||||||
hash)
|
|
||||||
shift
|
|
||||||
declare -a FIELDS=()
|
|
||||||
FULL_SLUG="${1}"
|
|
||||||
REV="${2}"
|
|
||||||
IFS='/' read -r -a FIELDS <<<"${FULL_SLUG:?}"
|
|
||||||
if [[ ${#FIELDS[@]} -eq 2 ]]; then
|
|
||||||
CHECKSUM="$(nix-prefetch-url --type sha256 --unpack "https://github.com/${FULL_SLUG}/archive/${REV:?}.tar.gz" 2>/dev/null)"
|
|
||||||
nix hash to-sri --type sha256 "${CHECKSUM:?}"
|
|
||||||
else
|
|
||||||
echo -e "${CL_RED}Repo slug should be in OWNER/REPO format${CL_RST}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
fmt)
|
|
||||||
alejandra --quiet .
|
|
||||||
shfmt -w -s -i 2 -ci xtask update.sh
|
|
||||||
;;
|
|
||||||
update)
|
|
||||||
shift
|
|
||||||
PACKAGE="${1-}"
|
|
||||||
VERSION="${2-}"
|
|
||||||
echo "{\"package\": \"${PACKAGE}\", \"version\": \"${VERSION}\"}" | gh workflow run update.yml --json
|
|
||||||
sleep 5
|
|
||||||
gh run list --workflow=update.yml --json databaseId | jq .[0].databaseId | xargs gh run watch
|
|
||||||
;;
|
|
||||||
sri)
|
|
||||||
shift
|
|
||||||
nix hash to-sri --type sha256 "${1:?}"
|
|
||||||
;;
|
|
||||||
nothing)
|
|
||||||
echo -e "${CL_RED}USAGE:${CL_RST}\n${CL_YLW}${0} '<action>'\n\t[possible values: 'clean' 'hash' 'fmt' 'update' 'sri']${CL_RST}"
|
|
||||||
;;
|
|
||||||
esac
|
|
Loading…
Reference in New Issue