fix: the small things
All checks were successful
conventional commits / conventional commits (push) Successful in 13s
build / run (push) Successful in 21s
check / run (push) Successful in 1m15s

* small typo on the flake description
* crane went full lib mode so it doesn't have any inputs to override
* `treefmt` warns on `nixfmt-rfc-style` as its `nixfmt` module is also
  `nixfmt-rfc-style`, switch to the `nixfmt` module.
* `pre-commit-hooks` uses `nixfmt-classic` when requesting `nixfmt` so
  we need to filter out `nixfmt` and enable `nixfmt-rfc-style` manually.
* there was an unneeded with statement warning from `nixd`

Signed-off-by: Jalil David Salame Messina <jalil.salame@gmail.com>
This commit is contained in:
Jalil David Salamé Messina 2024-09-11 08:56:51 +02:00 committed by Christina Sørensen
parent 19fa28545f
commit 6efdad5e66
Signed by: cafkafk
GPG key ID: 26C542FD97F965CE
2 changed files with 10 additions and 8 deletions

View file

@ -5,7 +5,7 @@
{
projectRootFile = "Cargo.toml";
programs = {
nixfmt-rfc-style.enable = true; # nix
nixfmt.enable = true; # nix
statix.enable = true; # nix static analysis
deadnix.enable = true; # find dead nix code
rustfmt.enable = true; # rust

View file

@ -3,7 +3,7 @@
# SPDX-License-Identifier: EUPL-1.2
{
description = "Nix Weather - Check Cache Availablility of NixOS Configurations";
description = "Nix Weather - Check Cache Availability of NixOS Configurations";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@ -13,10 +13,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
fenix = {
url = "github:nix-community/fenix";
@ -244,7 +241,10 @@
pre-commit-check =
let
# some treefmt formatters are not supported in pre-commit-hooks we filter them out for now.
toFilter = [ "yamlfmt" ];
toFilter = [
"yamlfmt"
"nixfmt"
];
filterFn = n: _v: (!builtins.elem n toFilter);
treefmtFormatters = pkgs.lib.mapAttrs (_n: v: { inherit (v) enable; }) (
pkgs.lib.filterAttrs filterFn (import ./.config/treefmt.nix).programs
@ -255,10 +255,12 @@
hooks = treefmtFormatters // {
# not in treefmt
convco.enable = true;
# named nixfmt in treefmt (which defaults to nixfmt-classic for pre-commit-hooks)
nixfmt-rfc-style.enable = true;
reuse = {
enable = true;
name = "reuse";
entry = with pkgs; "${pkgs.reuse}/bin/reuse lint";
entry = with pkgs; "${reuse}/bin/reuse lint";
pass_filenames = false;
};
};