From 818952d91041f9dcc2d4c50ae9fd54c7abd62367 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 16 Apr 2024 03:02:33 +0200 Subject: [PATCH 1/2] build: add taskfile --- taskfile.yaml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 taskfile.yaml diff --git a/taskfile.yaml b/taskfile.yaml new file mode 100644 index 0000000..beafb64 --- /dev/null +++ b/taskfile.yaml @@ -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" From 2c29a52d7416cfc94fc23561005aae50d0bfee67 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 16 Apr 2024 03:03:25 +0200 Subject: [PATCH 2/2] test: add lefthook as git hook --- lefthook.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lefthook.yaml diff --git a/lefthook.yaml b/lefthook.yaml new file mode 100644 index 0000000..ced9740 --- /dev/null +++ b/lefthook.yaml @@ -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