fix: the small things
* 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:
parent
19fa28545f
commit
6efdad5e66
2 changed files with 10 additions and 8 deletions
|
@ -5,7 +5,7 @@
|
||||||
{
|
{
|
||||||
projectRootFile = "Cargo.toml";
|
projectRootFile = "Cargo.toml";
|
||||||
programs = {
|
programs = {
|
||||||
nixfmt-rfc-style.enable = true; # nix
|
nixfmt.enable = true; # nix
|
||||||
statix.enable = true; # nix static analysis
|
statix.enable = true; # nix static analysis
|
||||||
deadnix.enable = true; # find dead nix code
|
deadnix.enable = true; # find dead nix code
|
||||||
rustfmt.enable = true; # rust
|
rustfmt.enable = true; # rust
|
||||||
|
|
16
flake.nix
16
flake.nix
|
@ -3,7 +3,7 @@
|
||||||
# SPDX-License-Identifier: EUPL-1.2
|
# 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 = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
@ -13,10 +13,7 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
crane = {
|
crane.url = "github:ipetkov/crane";
|
||||||
url = "github:ipetkov/crane";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fenix = {
|
fenix = {
|
||||||
url = "github:nix-community/fenix";
|
url = "github:nix-community/fenix";
|
||||||
|
@ -244,7 +241,10 @@
|
||||||
pre-commit-check =
|
pre-commit-check =
|
||||||
let
|
let
|
||||||
# some treefmt formatters are not supported in pre-commit-hooks we filter them out for now.
|
# 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);
|
filterFn = n: _v: (!builtins.elem n toFilter);
|
||||||
treefmtFormatters = pkgs.lib.mapAttrs (_n: v: { inherit (v) enable; }) (
|
treefmtFormatters = pkgs.lib.mapAttrs (_n: v: { inherit (v) enable; }) (
|
||||||
pkgs.lib.filterAttrs filterFn (import ./.config/treefmt.nix).programs
|
pkgs.lib.filterAttrs filterFn (import ./.config/treefmt.nix).programs
|
||||||
|
@ -255,10 +255,12 @@
|
||||||
hooks = treefmtFormatters // {
|
hooks = treefmtFormatters // {
|
||||||
# not in treefmt
|
# not in treefmt
|
||||||
convco.enable = true;
|
convco.enable = true;
|
||||||
|
# named nixfmt in treefmt (which defaults to nixfmt-classic for pre-commit-hooks)
|
||||||
|
nixfmt-rfc-style.enable = true;
|
||||||
reuse = {
|
reuse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = "reuse";
|
name = "reuse";
|
||||||
entry = with pkgs; "${pkgs.reuse}/bin/reuse lint";
|
entry = with pkgs; "${reuse}/bin/reuse lint";
|
||||||
pass_filenames = false;
|
pass_filenames = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue