diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ca27d661..5e9cbba5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,5 @@ -## Description +--- - - -## Checklist +### Checklist - [ ] Titles and headings use [AP Title Case](https://titlecaseconverter.com/) (see [Style Guide](../CONTRIBUTING.md#style-guide)) diff --git a/.gitignore b/.gitignore index 3d7b7a0a..8810e1ec 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,11 @@ node_modules/ ### General ### *~ + +# macOS .DS_Store +# Nix /.direnv/ +/result +/result-* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f6923f72..a620f7d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,7 +95,7 @@ npm run build # compile -> assets/css/tailwind.built.css npm run watch # same, then recompile on source/content changes ``` -If you do not want to install `npm` globally and have `nix` available, drop into the Nix development shell which provides `npm` and a basic Haskell toolchain. +If you do not want to install `npm` globally and have `nix` available, `nix develop` drops you into a shell with `npm` and the Haskell toolchain, including every dependency of the site generator prebuilt — so `cabal build` compiles only `site.hs` instead of spending half an hour on Pandoc. `nix build` alone gives you the `site` executable without a shell. **Commit the regenerated `assets/css/tailwind.built.css` with your change.** CI reruns `npm run build` on every push and PR and fails if the committed copy has drifted, so a stale stylesheet cannot reach the live site. diff --git a/flake.nix b/flake.nix index c5eaf976..069a0e51 100644 --- a/flake.nix +++ b/flake.nix @@ -18,25 +18,41 @@ ]; perSystem = { + lib, pkgs, ... }: + let + haskellPkgs = pkgs.haskellPackages; + + # Only the Haskell sources; the site content is read at run time. + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./haskell-foundation.cabal + ./site.hs + ./tools/social-crossposting + ]; + }; + + haskell-foundation = haskellPkgs.callCabal2nix "haskell-foundation" src { }; + in { - devShells.default = pkgs.mkShell { + packages.default = haskell-foundation; + + devShells.default = haskellPkgs.shellFor { + packages = _: [ haskell-foundation ]; + nativeBuildInputs = [ # Node; pinned to same version as CI. pkgs.nodejs_24 # Haskell. pkgs.cabal-install - pkgs.ghc pkgs.haskell-language-server # Screenshotting pages during design work. (pkgs.python3.withPackages (ps: [ ps.playwright ])) - - # System. - pkgs.zlib ]; env = {