An empty Eleventy site which uses Nix and nixpkgs
| bin | ||
| src | ||
| .eleventy.js | ||
| .envrc | ||
| .gitignore | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| node-deps.nix | ||
| README.md | ||
| yarn.lock | ||
Empty Eleventy Template, using Nix
This template should let you get started with the Eleventy static site builder on NixOS / Nix, really easily.
Featuring Nix'y features like:
- direnv support via
flake.nix- rundirenv allow - or run
nix developif you don't have direnv nix-buildsupport usingflake-compatserveshell script to run Eleventy and SASS locallybuildshell script to build the site into_site
And Eleventy features like:
- Canonical URLs
- A directory to store favicon cruft
- A
_data/site.jsonmetadata store - An
collection.imagescollection of the files insrc/images
Changing Packages
If you want to change the packages in packages.json, here's the steps:
- Remove all
nodeModuleslines fromnode-deps.nixandflake.nix - Use
direnv reloadornix developto get a dev shell - Add the new packages to
node-deps.nixand rundirenv reloadto re-buildpackages.json - Run
yarn -lto create a newyard.lock - Re-add the
nodeModulelines tonode-deps.nixandflake.nix
Upgrading Packages
This is a little fiddlier:
- Remove all
nodeModuleslines fromnode-deps.nixandflake.nix - Copy the generated
package.jsonto your clipboard - Delete
package.jsonto remove the symbolic link - Paste your clipbard back into a new
package.json - Run
yarn upgradeto create a newyarn.lockand updatepackage.json - Copy those new version numbers from
package.jsontonode-deps.nix - Re-add the
nodeModulelines tonode-deps.nixandflake.nix
..I do intend to make those steps simpler some day. If you've got ideas of how I could, please contact me!