aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix43
1 files changed, 36 insertions, 7 deletions
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
+ ];
+ };
+
+ };
};
- };
}