Add simple script to check reproducibility

Fixes: #16
This commit is contained in:
5225225 2025-10-06 14:05:37 +01:00 committed by Irenes
parent 9dec523254
commit cfd878fcad

View file

@ -0,0 +1,23 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -I "nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz" -p jq
# shellcheck shell=bash
# Simple script to check that all the packages in foundation are reproducible.
# Long term, we'll probably want to build something more like
# https://codeberg.org/raboof/nix-reproducible-builds-report , which is the
# code behind https://reproducible.nixos.org/
# But for now, this works fine :3
#
import_path="${0%/check-reproducibility.sh}/../default.nix"
nix eval --json --impure --expr "builtins.attrNames ((import $import_path) {})" |\
jq --raw-output0 '.[]' |\
xargs --null -I{} nix build --quiet .#packages.i686-linux.{}
echo " Built all packages: now running with --rebuild"
nix eval --json --impure --expr "builtins.attrNames ((import $import_path) {})" |\
jq --raw-output0 '.[]' |\
xargs --null -I{} nix build --quiet .#packages.i686-linux.{} --rebuild --keep-failed