feat: switch to nixfmt and add pre-commit hook
This commit is contained in:
6
.pre-commit-config.yaml
Normal file
6
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/nixos/nixfmt
|
||||
rev: v1.2.0
|
||||
hooks:
|
||||
- id: nixfmt-nix
|
||||
args: [--, --check]
|
||||
17
flake.nix
17
flake.nix
@@ -94,11 +94,22 @@
|
||||
lib = nixpkgs.lib;
|
||||
} { };
|
||||
}
|
||||
// flake-utils.lib.eachDefaultSystem (system: {
|
||||
// flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
packages = import ./packages {
|
||||
inherit my-lib;
|
||||
lib = nixpkgs.lib;
|
||||
} (inputs // { inherit system; });
|
||||
formatter = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
|
||||
});
|
||||
|
||||
formatter = pkgs.nixfmt-tree;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [ pkgs.pre-commit ];
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[formatter.nix]
|
||||
command = "nix"
|
||||
options = ["fmt"]
|
||||
includes = [ "*.nix" ]
|
||||
Reference in New Issue
Block a user