feat(reuse): Switch to an action rather than a git hook, to be less cumbersome #262

Closed
thubrecht wants to merge 1 commit from reuse into main
3 changed files with 42 additions and 6 deletions

View file

@ -0,0 +1,13 @@
###
# This file was automatically generated with nix-actions.
jobs:
pre-commit:
runs-on: nix
steps:
- uses: actions/checkout@v3
- name: REUSE lint
run: nix-shell -A reuse-check --run 'reuse lint'
name: REUSE lint
on:
- push
- pull_request

View file

@ -44,12 +44,6 @@ let
package = pkgs.nixfmt-rfc-style; package = pkgs.nixfmt-rfc-style;
}; };
reuse = nix-reuse.hook {
enable = true;
stages = [ "pre-push" ];
package = pkgs.reuse; # git-hooks.nix is lagging on nixpkgs update
};
commitizen.enable = true; commitizen.enable = true;
}; };
}; };
@ -185,6 +179,7 @@ in
src = sources.nixos-generators; src = sources.nixos-generators;
})) }))
pkgs.npins pkgs.npins
pkgs.reuse
# SSO testing # SSO testing
pkgs.kanidm pkgs.kanidm
@ -216,6 +211,7 @@ in
check-workflows.shellHook = workflows.shellHook; check-workflows.shellHook = workflows.shellHook;
eval-nodes.packages = [ scripts.cache-node ]; eval-nodes.packages = [ scripts.cache-node ];
eval-shell.packages = [ scripts.nix-build-and-cache ]; eval-shell.packages = [ scripts.nix-build-and-cache ];
reuse-check.packages = [ pkgs.reuse ];
}; };
}; };
} }

27
workflows/reuse-check.nix Normal file
View file

@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2024 Tom Hubrecht <tom.hubrecht@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{ nix-actions, ... }:
{
name = "REUSE lint";
on = [
"push"
"pull_request"
];
jobs.pre-commit = {
runs-on = "nix";
steps = [
{ uses = "actions/checkout@v3"; }
{
name = "REUSE lint";
run = nix-actions.lib.nix-shell {
script = "reuse lint";
shell = "reuse-check";
};
}
];
};
}