2022-09-22 00:01:21 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
expr=$(cat <<"EXPR"
|
|
|
|
let
|
2022-09-23 18:21:43 +02:00
|
|
|
overlay = import <liminix/overlay.nix>;
|
|
|
|
nixpkgs = import <nixpkgs> { overlays = [overlay]; };
|
|
|
|
structure = import ./structure.nix;
|
2022-09-22 00:01:21 +02:00
|
|
|
in nixpkgs.pkgs.pseudofile "pseudo.s6-init" structure
|
|
|
|
EXPR
|
2022-09-23 18:21:43 +02:00
|
|
|
)
|
2022-09-22 00:01:21 +02:00
|
|
|
|
2022-09-23 18:21:43 +02:00
|
|
|
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -E "${expr}" -o result $*
|
|
|
|
diff result result.expected
|
2022-09-22 00:01:21 +02:00
|
|
|
test -f /tmp/out.squashfs && rm /tmp/out.squashfs
|
2022-09-23 18:21:43 +02:00
|
|
|
nix-shell -p squashfsTools -p qprint --run "mksquashfs - /tmp/out.squashfs -p '/ d 755 0 0' -pf result -quiet -no-progress"
|
2022-09-22 00:01:21 +02:00
|
|
|
foo="$(nix-shell -p squashfsTools --run 'unsquashfs -cat /tmp/out.squashfs service/s6-linux-init-runleveld/run')"
|
|
|
|
test "$foo" = "$(printf "hello\nworld")"
|