hyprspace/dev/formatting.nix
Max 71eeca5801
Fix Nix eval warnings (#112)
* runCommandNoCC -> runCommand

* drop x86_64-darwin

* use upstream hercules-ci-effects

* flake.lock: Update

Flake lock file updates:

• Updated input 'hercules-ci-effects':
    'github:max-privatevoid/hercules-ci-effects/f3a32947c119cfe0f0130ad91b37028a3dae22d1?narHash=sha256-3A2B8k6YCuzt5pT/CQEltUghtE6heSlk2tMYkg/fUWI%3D' (2026-04-15)
  → 'github:hercules-ci/hercules-ci-effects/af4331c44f13977b6964745454eadcfee2d244d1?narHash=sha256-OOEWyt8ma7QAysDbiP65J7li7KIdtZfnbA11gFnwyEI%3D' (2026-05-16)
2026-05-22 22:54:48 +02:00

30 lines
772 B
Nix

{ lib, ... }:
{
perSystem =
{ config, pkgs, ... }:
{
formatter = pkgs.nixfmt;
checks =
let
inherit (lib.fileset) toSource fileFilter;
filesWithExtension =
ext:
toSource {
root = ../.;
fileset = fileFilter (file: file.hasExt ext) ../.;
};
in
{
format-nix = pkgs.runCommand "format-nix" { } ''
${lib.getExe config.formatter} -c ${filesWithExtension "nix"}
touch $out
'';
format-go = pkgs.runCommand "format-go" { } ''
test "$(${lib.getExe' pkgs.go "gofmt"} -l ${filesWithExtension "go"} | tee /dev/stderr | wc -l)" == 0
touch $out
'';
};
};
}