Skip to content

flake: add Nix flake files

Pol Dellaiera requested to merge add-flake into master

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:

  1. 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
  2. nix run: Compiles the website into HTML and serves it using Caddy at http://127.0.0.1:4000/.

  3. nix run .#devserver: Runs the embedded Jekyll server on port 4000, similar to Caddy but with Jekyll (not recommended for production use).

  4. nix run .#serve: Runs the embedded Jekyll server on port 4000 with livereload enabled, for development purposes.

  5. 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.

Edited by Pol Dellaiera

Merge request reports

Loading