Compare commits
1 Commits
main
...
edf9fdd2b8
| Author | SHA1 | Date | |
|---|---|---|---|
| edf9fdd2b8 |
@@ -3,9 +3,17 @@
|
|||||||
lib,
|
lib,
|
||||||
formatter,
|
formatter,
|
||||||
system,
|
system,
|
||||||
|
ignore,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
deadnixExcludeArgs = lib.concatStringsSep " " ([ "--exclude" ] ++ ignore);
|
||||||
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||||
|
statixIgnoreArgs = lib.escapeShellArgs (
|
||||||
|
lib.concatMap (path: [
|
||||||
|
"--ignore"
|
||||||
|
(if path == "third_party" then "${path}/**" else path)
|
||||||
|
]) ignore
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
fix = {
|
fix = {
|
||||||
@@ -20,8 +28,8 @@ in
|
|||||||
];
|
];
|
||||||
text = ''
|
text = ''
|
||||||
treefmt
|
treefmt
|
||||||
statix fix .
|
statix fix ${statixIgnoreArgs} .
|
||||||
deadnix --edit --exclude configs/nixos/hosts/*/hardware-configuration.nix -- .
|
deadnix --edit ${deadnixExcludeArgs} -- .
|
||||||
treefmt
|
treefmt
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
system,
|
system,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
ignore = import ./ignore.nix;
|
||||||
|
|
||||||
util = import ./util.nix { inherit lib; };
|
util = import ./util.nix { inherit lib; };
|
||||||
|
|
||||||
registry = import ./registry.nix {
|
registry = import ./registry.nix {
|
||||||
@@ -43,7 +45,7 @@ in
|
|||||||
{
|
{
|
||||||
formatter.${system} =
|
formatter.${system} =
|
||||||
(import ./formatter.nix {
|
(import ./formatter.nix {
|
||||||
inherit inputs system;
|
inherit inputs system ignore;
|
||||||
}).config.build.wrapper;
|
}).config.build.wrapper;
|
||||||
|
|
||||||
apps.${system} = import ./apps.nix {
|
apps.${system} = import ./apps.nix {
|
||||||
@@ -51,6 +53,7 @@ in
|
|||||||
inputs
|
inputs
|
||||||
lib
|
lib
|
||||||
system
|
system
|
||||||
|
ignore
|
||||||
;
|
;
|
||||||
formatter = self.formatter.${system};
|
formatter = self.formatter.${system};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
{ inputs, system }:
|
{
|
||||||
|
inputs,
|
||||||
|
system,
|
||||||
|
ignore,
|
||||||
|
}:
|
||||||
inputs.treefmt-nix.lib.evalModule inputs.nixpkgs.legacyPackages.${system} {
|
inputs.treefmt-nix.lib.evalModule inputs.nixpkgs.legacyPackages.${system} {
|
||||||
projectRootFile = "flake.nix";
|
projectRootFile = "flake.nix";
|
||||||
|
|
||||||
programs.nixfmt.enable = true;
|
programs.nixfmt.enable = true;
|
||||||
|
|
||||||
settings.formatter.nixfmt.excludes = [
|
settings.excludes = map (path: if path == "third_party" then "${path}/**" else path) ignore;
|
||||||
"configs/nixos/hosts/*/hardware-configuration.nix"
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
4
src/dotfiles/ignore.nix
Normal file
4
src/dotfiles/ignore.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[
|
||||||
|
"third_party"
|
||||||
|
"configs/nixos/hosts/*/hardware-configuration.nix"
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user