refactor(nix): move style app wiring into dotfiles
This commit is contained in:
40
src/dotfiles/apps.nix
Normal file
40
src/dotfiles/apps.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
inputs,
|
||||
lib,
|
||||
}:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||
|
||||
treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs {
|
||||
projectRootFile = "flake.nix";
|
||||
|
||||
programs.nixfmt.enable = true;
|
||||
|
||||
settings.formatter.nixfmt.excludes = [
|
||||
"configs/nixos/hosts/*/hardware-configuration.nix"
|
||||
];
|
||||
};
|
||||
|
||||
styleCheck = pkgs.writeShellApplication {
|
||||
name = "style-check";
|
||||
runtimeInputs = [
|
||||
treefmtEval.config.build.wrapper
|
||||
pkgs.statix
|
||||
pkgs.deadnix
|
||||
];
|
||||
text = ''
|
||||
treefmt --fail-on-change
|
||||
statix check .
|
||||
deadnix --fail --no-lambda-pattern-names --no-underscore .
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
formatter.${system} = treefmtEval.config.build.wrapper;
|
||||
|
||||
apps.${system}.style-check = {
|
||||
type = "app";
|
||||
program = lib.getExe styleCheck;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user