#builder.sh: # #!/bin/sh # <$file $bsdgames/bin/rot13 > $out with import {}; let squashfsTools = pkgs.squashfsTools.override { lz4Support = true; }; mkSquashFs = settings: contents: stdenv.mkDerivation { name = "squashfs.img"; nativeBuildInputs = [ squashfsTools ]; buildCommand = '' closureInfo=${closureInfo { rootPaths = contents; }} mksquashfs $(cat $closureInfo/store-paths) $out \ -keep-as-directory -all-root -b 1048576 ${settings} ''; }; mkSquashFsLz4 = mkSquashFs "-comp lz4 -Xhc"; image = mkSquashFsLz4 [ bash ]; rot13 = file: derivation { name = file.name + "-rot13"; inherit file; bsdgames = pkgsi686Linux.bsdgames; system = builtins.currentSystem; builder = ./builder.sh; allowedReferences = []; preferLocalBuild = true; }; in rot13 (rot13 image) # the first rot13 derivation has no reference # the second will scan for references among its inputs: # * (rot13 image) which has no references # * 32 bit bsdgames and its deps # This will build iff the squash image does not reference any of the runtime # dependencies of the 32bit bsdgame. That's why I use a 32 bit bsdgames, otherwise # they have glibc in common.