mirror of
https://gitlab.com/TECHNOFAB/nixtest.git
synced 2026-05-04 18:29:33 +02:00
chore: add devtools like cocogitto & lefthook
This commit is contained in:
parent
cee15f3677
commit
e91a9774e8
4 changed files with 182 additions and 15 deletions
|
|
@ -3,31 +3,85 @@
|
|||
cell,
|
||||
...
|
||||
}: let
|
||||
inherit (inputs) pkgs devshell treefmt;
|
||||
inherit (inputs) pkgs devshell treefmt devtools-lib;
|
||||
inherit (cell) soonix;
|
||||
treefmtWrapper = treefmt.mkWrapper pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
mdformat.enable = true;
|
||||
gofmt.enable = true;
|
||||
};
|
||||
settings.formatter.mdformat = {
|
||||
excludes = ["CHANGELOG.md" "LICENSE.md"];
|
||||
command = let
|
||||
pkg = pkgs.python3.withPackages (p: [
|
||||
p.mdformat
|
||||
p.mdformat-mkdocs
|
||||
]);
|
||||
in "${pkg}/bin/mdformat";
|
||||
};
|
||||
};
|
||||
in {
|
||||
default = devshell.mkShell {
|
||||
imports = [soonix.devshellModule];
|
||||
imports = [soonix.devshellModule devtools-lib.devshellModule];
|
||||
packages = with pkgs; [
|
||||
(treefmt.mkWrapper pkgs {
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
mdformat.enable = true;
|
||||
gofmt.enable = true;
|
||||
};
|
||||
settings.formatter.mdformat.command = let
|
||||
pkg = pkgs.python3.withPackages (p: [
|
||||
p.mdformat
|
||||
p.mdformat-mkdocs
|
||||
]);
|
||||
in "${pkg}/bin/mdformat";
|
||||
})
|
||||
treefmtWrapper
|
||||
gcc
|
||||
go
|
||||
gopls
|
||||
delve
|
||||
go-tools
|
||||
go-junit-report
|
||||
gocover-cobertura
|
||||
];
|
||||
lefthook.config = {
|
||||
"pre-commit" = {
|
||||
parallel = true;
|
||||
jobs = [
|
||||
{
|
||||
name = "treefmt";
|
||||
stage_fixed = true;
|
||||
run = "${treefmtWrapper}/bin/treefmt";
|
||||
env.TERM = "dumb";
|
||||
}
|
||||
{
|
||||
name = "soonix";
|
||||
stage_fixed = true;
|
||||
run = "nix run .#soonix:update";
|
||||
}
|
||||
];
|
||||
};
|
||||
"pre-push" = {
|
||||
parallel = true;
|
||||
jobs = [
|
||||
{
|
||||
name = "nix build";
|
||||
run = "nix build .#nixtest";
|
||||
}
|
||||
{
|
||||
name = "go test";
|
||||
run = "go test ./...";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
cocogitto.config = {
|
||||
tag_prefix = "v";
|
||||
ignore_merge_commits = true;
|
||||
changelog = {
|
||||
authors = [
|
||||
{
|
||||
username = "TECHNOFAB";
|
||||
signature = "technofab";
|
||||
}
|
||||
];
|
||||
path = "CHANGELOG.md";
|
||||
template = "remote";
|
||||
remote = "gitlab.com";
|
||||
repository = "nixtest";
|
||||
owner = "TECHNOFAB";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue