mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-14 16:14:50 +00:00
d8008dee9f
Tests the program by running it on a handful of entries from the `nixos-artwork` attrset, and then test that the resulting Lua files can be evaluated with `loadfile` in standard Lua.
35 lines
1.2 KiB
Nix
35 lines
1.2 KiB
Nix
{
|
|
runCommand,
|
|
sanjuuni,
|
|
nixos-artwork,
|
|
lua5_2,
|
|
}:
|
|
let
|
|
makeCommand = derivation: baseFilename: ''
|
|
echo "sanjuuni-test-run-on-nixos-artwork: Running Sanjuuni on ${derivation}/share/backgrounds/nixos/${baseFilename}.png"
|
|
sanjuuni --lua --disable-opencl \
|
|
--input ${derivation}/share/backgrounds/nixos/${baseFilename}.png \
|
|
--output $out/${baseFilename}.lua
|
|
echo "sanjuuni-test-run-on-nixos-artwork: Checking syntax on $out/${baseFilename}.lua"
|
|
lua -e "loadfile(\"$out/${baseFilename}.lua\")"
|
|
'';
|
|
in
|
|
runCommand "sanjuuni-test-run-on-nixos-artwork"
|
|
{
|
|
nativeBuildInputs = [
|
|
sanjuuni
|
|
lua5_2
|
|
nixos-artwork.wallpapers.simple-blue
|
|
nixos-artwork.wallpapers.simple-red
|
|
nixos-artwork.wallpapers.simple-dark-gray
|
|
nixos-artwork.wallpapers.stripes
|
|
];
|
|
}
|
|
''
|
|
mkdir -p $out
|
|
${makeCommand nixos-artwork.wallpapers.simple-blue "nix-wallpaper-simple-blue"}
|
|
${makeCommand nixos-artwork.wallpapers.simple-red "nix-wallpaper-simple-red"}
|
|
${makeCommand nixos-artwork.wallpapers.simple-dark-gray "nix-wallpaper-simple-dark-gray"}
|
|
${makeCommand nixos-artwork.wallpapers.stripes "nix-wallpaper-stripes"}
|
|
''
|