Skip to content

Commit

Permalink
feat(flake): switch to treefmt-nix
Browse files Browse the repository at this point in the history
This allows me to remove all checks and replace them with treefmt-nix
  • Loading branch information
jalil-salame committed Oct 15, 2024
1 parent f2530d1 commit 002c74c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
26 changes: 0 additions & 26 deletions flake-modules/checks.nix

This file was deleted.

17 changes: 13 additions & 4 deletions flake-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ let
in
{
imports = [
./checks.nix
inputs.treefmt-nix.flakeModule

./devshells.nix
./docs.nix
./example-vm.nix
Expand All @@ -15,11 +16,19 @@ in
];

perSystem =
{ system, pkgs, ... }:
{ system, ... }:
{
_module.args.pkgs = import inputs.nixpkgs { inherit system overlays; };

# Nix files formatter (run `nix fmt`)
formatter = pkgs.nixfmt-rfc-style;
# Setup formatters
treefmt = {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
rustfmt.enable = true;
statix.enable = true;
typos.enable = true;
};
};
};
}
6 changes: 4 additions & 2 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
nixpkgs.follows = "unstable";
home-manager.follows = "home-manager";
flake-parts.follows = "flake-parts";
treefmt-nix.follows = "treefmt-nix";
# disable optional inputs
flake-compat.follows = "";
nix-darwin.follows = "";
Expand All @@ -47,6 +48,10 @@
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# For deduplication
systems.url = "github:nix-systems/default";
};
Expand Down

0 comments on commit 002c74c

Please sign in to comment.