nix-actions/default.nix

59 lines
942 B
Nix
Raw Normal View History

2024-11-11 16:29:36 +01:00
{
sources ? import ./npins,
pkgs ? import sources.nixpkgs { },
}:
let
inherit (pkgs) lib mkShell;
git-checks = (import sources.git-hooks).run {
src = ./.;
hooks = {
statix = {
enable = true;
stages = [ "pre-push" ];
settings.ignore = [ "npins" ];
};
deadnix = {
enable = true;
stages = [ "pre-push" ];
};
nixfmt-rfc-style = {
enable = true;
stages = [ "pre-push" ];
};
commitizen.enable = true;
};
};
in
{
devShell = mkShell {
name = "nix-actions.dev";
inherit (git-checks) shellHook;
};
install =
config:
let
project = lib.evalModules {
modules = [
./modules
{
config = config // {
_module.args.pkgs = pkgs;
};
}
];
};
in
{
shellHook = project.config.installationScript;
};
}