From 51728e2a5b26518cecd135ef32377798c55c78d6 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Sun, 22 Feb 2026 22:57:53 -0600 Subject: Added formatters --- flake.nix | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index d17aca5..ba74979 100644 --- a/flake.nix +++ b/flake.nix @@ -2,18 +2,47 @@ description = "TeX devShell for flake-parts"; inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; flake-parts.url = "github:hercules-ci/flake-parts"; + treefmt-nix.url = "github:numtide/treefmt-nix"; systems.url = "github:nix-systems/default"; }; - outputs = inputs @ { self, flake-parts, ... }: flake-parts.lib.mkFlake { inherit self inputs; } { - systems = import inputs.systems; + outputs = + inputs@{ self, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit self inputs; } { + systems = import inputs.systems; - flake.flakeModules.default = ./module.nix; + imports = [ inputs.treefmt-nix.flakeModule ]; - flake.templates.default = { - path = ./template; - description = "TeX-utils default template"; + flake.flakeModules.default = ./module.nix; + + flake.templates.default = { + path = ./template; + description = "TeX-utils default template"; + }; + + perSystem = + { config, pkgs, ... }: + { + treefmt = { + programs = { + nixfmt = { + enable = true; + strict = true; + }; + }; + }; + + devShells.default = pkgs.mkShellNoCC { + inputsFrom = [ config.treefmt.build.devShell ]; + nativeBuildInputs = with pkgs; [ + nixd + statix + deadnix + ]; + }; + + }; }; - }; } -- cgit v1.2.3