diff --git a/Makefile b/Makefile index e45c766..b002431 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,8 @@ docs-build: .PHONY: update update: npins update + +# Ideally this should be done before committing. +.PHONY: format +format: + treefmt diff --git a/shell.nix b/shell.nix index d1cff49..c471c34 100644 --- a/shell.nix +++ b/shell.nix @@ -4,19 +4,16 @@ in { pkgs ? import sources.nixos-unstable { } }: let - websiteDevshell = import ./docs/shell.nix { inherit pkgs; }; + websitePkg = import ./docs { inherit pkgs; }; in pkgs.mkShell { - packages = with pkgs; [ - websiteDevshell + inputsFrom = [ websitePkg ]; + packages = with pkgs; [ npins treefmt nixpkgs-fmt - hugo - asciidoctor - # For easy validation of the test suite. yajsv jq diff --git a/treefmt.toml b/treefmt.toml new file mode 100644 index 0000000..4deb3fd --- /dev/null +++ b/treefmt.toml @@ -0,0 +1,8 @@ +[global] +excludes = [ + "npins/default.nix" +] + +[formatter.nix] +command = "nixfmt" +includes = [ "*.nix" ]