flake: add Nix flake files
Hi,
This PR adds flake.nix
and flake.lock
files to the root of the project, making it fully reproducible.
You can view the available outputs of the flake by running the following command:
nix flake show "git+https://salsa.debian.org/reproducible-builds/reproducible-website/?ref=add-flake"
Here are some explanations:
-
nix develop
: Spawns a new shell with all the necessary tools for local development and building of the website:- Ruby
- Jekyll + plugins
- GNU Make
- Python
- Po4a
- Which
-
nix run
: Compiles the website into HTML and serves it using Caddy athttp://127.0.0.1:4000/
. -
nix run .#devserver
: Runs the embedded Jekyll server on port 4000, similar to Caddy but with Jekyll (not recommended for production use). -
nix run .#serve
: Runs the embedded Jekyll server on port 4000 with livereload enabled, for development purposes. -
nix build
: Compiles the website into a reproducible derivation.
These outputs are available for the four most common architectures: x86_64-linux
, x86_64-darwin
, aarch64-linux
, aarch64-darwin
.
One of the key advantages of including a flake in the project is the ability for anyone to run the project locally using the project's URL. If you already have Nix installed on your machine, you can test this branch by running:
nix run "git+https://salsa.debian.org/reproducible-builds/reproducible-website/?ref=add-flake"
Please let me know if you're comfortable with including these files in the project.