Compare commits

..

2 commits

Author SHA1 Message Date
2c29a52d74 test: add lefthook as git hook 2024-04-16 03:03:25 +02:00
818952d910 build: add taskfile 2024-04-16 03:02:33 +02:00
2 changed files with 61 additions and 0 deletions

14
lefthook.yaml Normal file
View file

@ -0,0 +1,14 @@
---
skip_output: [meta, success]
no_tty: true
commit-msg:
commands:
lint:commitmsg:
run: cat {1} | convco check --from-stdin
pre-push:
parallel: false
commands:
check:nix:
tags: check
run: nix flake check

47
taskfile.yaml Normal file
View file

@ -0,0 +1,47 @@
---
version: "3"
set: [errexit, pipefail, nounset]
shopt: [globstar]
tasks:
check:sh:
cmds:
- shellcheck **/*.sh
sources:
- "**/*.sh"
check:typos:
cmds:
- typos .
check:flake:
cmds:
- nix flake check
sources:
- "**/*.nix"
build:*:
silent: true
vars:
TARGET: "{{index .MATCH 0}}"
cmds:
- nixos-rebuild --flake .#{{.TARGET}} build
sources:
- "**/*.nix"
switch:*:
silent: true
vars:
TARGET: "{{index .MATCH 0}}"
requires:
vars: [TARGET]
cmds:
- doas nixos-rebuild --flake .#{{}} switch
sources:
- "**/*.nix"
test:*:
silent: true
vars:
TARGET: "{{index .MATCH 0}}"
cmds:
- doas nixos-rebuild --flake .#{{.TARGET}} test
sources:
- "**/*.nix"