From f2c4d486c0e5763b9fcd92987128df262233c1a9 Mon Sep 17 00:00:00 2001 From: Chris Wells Date: Wed, 25 Feb 2026 10:39:15 -0600 Subject: Basic templates so far --- flake.nix | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ed95723 --- /dev/null +++ b/flake.nix @@ -0,0 +1,55 @@ +{ + description = "Project templates"; + + 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; + + imports = [ inputs.treefmt-nix.flakeModule ]; + + flake.templates = { + class = { + description = "Class template"; + path = ./class; + }; + paper = { + description = "TeX paper template"; + path = ./paper; + }; + tex = { + description = "Generic TeX projects"; + path = ./tex; + }; + }; + + perSystem = + { config, pkgs, ... }: + { + treefmt = { + programs = { + nixfmt = { + enable = true; + strict = true; + }; + }; + }; + + devShells.default = pkgs.mkShellNoCC { + inputsFrom = [ config.treefmt.build.devShell ]; + nativeBuildInputs = with pkgs; [ + nixd + deadnix + ]; + }; + + }; + }; +} -- cgit v1.2.3