feat(lib): shell: +check-tool

This commit is contained in:
2025-07-17 16:22:31 +00:00
parent be3aab9b48
commit 92def64fea
2 changed files with 10 additions and 1 deletions

View File

@@ -48,7 +48,10 @@ in {
forSystems = systems: nixpkgs.lib.genAttrs systems; forSystems = systems: nixpkgs.lib.genAttrs systems;
forAllSystems = nixpkgs.lib.genAttrs commonSystems; forAllSystems = nixpkgs.lib.genAttrs commonSystems;
shellModules.logs = builtins.readFile ./shell/logs.sh; shellModules = {
logs = builtins.readFile ./shell/logs.sh;
check-tool = builtins.readFile ./shell/check-tool.sh;
};
sharedShellAliases = { sharedShellAliases = {
jc = ''journalctl''; jc = ''journalctl'';

6
lib/shell/check-tool.sh Normal file
View File

@@ -0,0 +1,6 @@
check_tool() {
if ! command -v "$1" >/dev/null; then
echo "Required tool \`$2\` are not installed or binary \`$1\` not found." >&2
exit 1
fi
}