feat(flake): switch to treefmt-nix
All checks were successful
/ check (push) Successful in 24s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 2s
/ build (nvim) (push) Successful in 2s
All checks were successful
/ check (push) Successful in 24s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 2s
/ build (nvim) (push) Successful in 2s
This allows me to remove all checks and replace them with treefmt-nix
This commit is contained in:
parent
f2530d1010
commit
002c74ca1b
4 changed files with 22 additions and 32 deletions
|
@ -1,26 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
perSystem =
|
|
||||||
{ pkgs, self', ... }:
|
|
||||||
{
|
|
||||||
checks =
|
|
||||||
let
|
|
||||||
src = builtins.path {
|
|
||||||
path = ../.;
|
|
||||||
name = "configuration.nix";
|
|
||||||
};
|
|
||||||
runCmdInSrc =
|
|
||||||
name: cmd:
|
|
||||||
pkgs.runCommandNoCC name { } ''
|
|
||||||
cd ${src}
|
|
||||||
${cmd}
|
|
||||||
mkdir $out
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
fmt = runCmdInSrc "fmt-src" "${lib.getExe self'.formatter} --check .";
|
|
||||||
lint = runCmdInSrc "lint-src" "${lib.getExe pkgs.statix} check .";
|
|
||||||
typos = runCmdInSrc "typos-src" "${lib.getExe pkgs.typos} .";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -4,7 +4,8 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./checks.nix
|
inputs.treefmt-nix.flakeModule
|
||||||
|
|
||||||
./devshells.nix
|
./devshells.nix
|
||||||
./docs.nix
|
./docs.nix
|
||||||
./example-vm.nix
|
./example-vm.nix
|
||||||
|
@ -15,11 +16,19 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem =
|
perSystem =
|
||||||
{ system, pkgs, ... }:
|
{ system, ... }:
|
||||||
{
|
{
|
||||||
_module.args.pkgs = import inputs.nixpkgs { inherit system overlays; };
|
_module.args.pkgs = import inputs.nixpkgs { inherit system overlays; };
|
||||||
|
|
||||||
# Nix files formatter (run `nix fmt`)
|
# Setup formatters
|
||||||
formatter = pkgs.nixfmt-rfc-style;
|
treefmt = {
|
||||||
|
projectRootFile = "flake.nix";
|
||||||
|
programs = {
|
||||||
|
nixfmt.enable = true;
|
||||||
|
rustfmt.enable = true;
|
||||||
|
statix.enable = true;
|
||||||
|
typos.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,7 +289,9 @@
|
||||||
"unstable"
|
"unstable"
|
||||||
],
|
],
|
||||||
"nuschtosSearch": [],
|
"nuschtosSearch": [],
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": [
|
||||||
|
"treefmt-nix"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728829992,
|
"lastModified": 1728829992,
|
||||||
|
@ -314,6 +316,7 @@
|
||||||
"nixvim": "nixvim",
|
"nixvim": "nixvim",
|
||||||
"stylix": "stylix",
|
"stylix": "stylix",
|
||||||
"systems": "systems",
|
"systems": "systems",
|
||||||
|
"treefmt-nix": "treefmt-nix",
|
||||||
"unstable": "unstable"
|
"unstable": "unstable"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -368,7 +371,6 @@
|
||||||
"treefmt-nix": {
|
"treefmt-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixvim",
|
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
nixpkgs.follows = "unstable";
|
nixpkgs.follows = "unstable";
|
||||||
home-manager.follows = "home-manager";
|
home-manager.follows = "home-manager";
|
||||||
flake-parts.follows = "flake-parts";
|
flake-parts.follows = "flake-parts";
|
||||||
|
treefmt-nix.follows = "treefmt-nix";
|
||||||
# disable optional inputs
|
# disable optional inputs
|
||||||
flake-compat.follows = "";
|
flake-compat.follows = "";
|
||||||
nix-darwin.follows = "";
|
nix-darwin.follows = "";
|
||||||
|
@ -47,6 +48,10 @@
|
||||||
url = "github:hercules-ci/flake-parts";
|
url = "github:hercules-ci/flake-parts";
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
treefmt-nix = {
|
||||||
|
url = "github:numtide/treefmt-nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
# For deduplication
|
# For deduplication
|
||||||
systems.url = "github:nix-systems/default";
|
systems.url = "github:nix-systems/default";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue