From 0c5caf0a9d46a66862c7382c77a5e3f7b2c9ed34 Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Mon, 5 Aug 2024 10:55:47 +0200 Subject: Use nix to configure treefmt --- flake.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 8324f07..361061c 100644 --- a/flake.nix +++ b/flake.nix @@ -37,31 +37,41 @@ url = "github:nlewo/comin"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # development stuff + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { + self, nixpkgs, futils, nix-on-droid, + treefmt-nix, ... }@inputs: futils.lib.eachSystem ( system: let - pkgs = inputs.nixpkgs.legacyPackages.${system}; + pkgs = import inputs.nixpkgs { inherit system; }; + treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in { devShells.default = futils.lib.minimalMkShell pkgs { - buildInputs = with pkgs; [ - git + packages = with pkgs; [ + gitMinimal sops - - # Formatting - treefmt - nixfmt-rfc-style ]; }; + + formatter = treefmtEval.config.build.wrapper; + checks = { + formatting = treefmtEval.config.build.check self; + }; } ) // { -- cgit v1.3.1