flake.nix: add treefmt-nix
Some checks failed
Check flake / build-amd64-linux (push) Failing after 1m21s

This commit is contained in:
2025-08-15 21:37:06 +01:00
parent a40e84ddb4
commit 77ca125bde
3 changed files with 51 additions and 10 deletions

23
flake.lock generated
View File

@@ -1136,7 +1136,8 @@
"nixvim": "nixvim",
"pre-commit-hooks": "pre-commit-hooks_2",
"secrets": "secrets",
"thunderbird-gnome-theme": "thunderbird-gnome-theme"
"thunderbird-gnome-theme": "thunderbird-gnome-theme",
"treefmt-nix": "treefmt-nix_2"
}
},
"secrets": {
@@ -1282,6 +1283,26 @@
"type": "github"
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1754847726,
"narHash": "sha256-2vX8QjO5lRsDbNYvN9hVHXLU6oMl+V/PsmIiJREG4rE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "7d81f6fb2e19bf84f1c65135d1060d829fae2408",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems_2"

View File

@@ -14,7 +14,10 @@
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
};
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
@@ -95,6 +98,11 @@
url = "github:rafaelmardojai/thunderbird-gnome-theme";
flake = false;
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@@ -108,6 +116,7 @@
inputs.agenix-rekey.flakeModule
inputs.pre-commit-hooks.flakeModule
inputs.nix-topology.flakeModule
inputs.treefmt-nix.flakeModule
./nix/devshell.nix
./nix/hosts.nix
];
@@ -141,21 +150,28 @@
check-case-conflicts.enable = true;
check-executables-have-shebangs.enable = true;
check-merge-conflicts.enable = true;
deadnix = {
enable = true;
settings = {
noLambdaArg = true;
};
};
detect-private-keys.enable = true;
end-of-file-fixer.enable = true;
fix-byte-order-marker.enable = true;
mixed-line-endings.enable = true;
nixfmt-rfc-style.enable = true;
treefmt.enable = true;
trim-trailing-whitespace.enable = true;
};
};
};
treefmt = {
projectRootFile = "flake.nix";
programs = {
deadnix = {
enable = true;
no-lambda-arg = true;
};
mdformat.enable = true;
nixfmt-rfc-style.enable = true;
shellcheck.enable = true;
};
};
};
};
}

View File

@@ -5,10 +5,14 @@
];
perSystem =
{ pkgs, ... }:
{ config, pkgs, ... }:
{
devshells.default = {
commands = [
{
package = config.treefmt.build.wrapper;
help = "Format all files";
}
{
package = pkgs.deploy-rs;
name = "deploy";