Created
April 23, 2018 02:18
-
-
Save grahamc/1493857a070df6574a79cb23400bedc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ runCommand, lib, php }: | |
runCommand "ihavenoideawhatimdoing.dog" { | |
buildInputs = [ php ]; | |
gifs = (builtins.toJSON | |
(builtins.map | |
(name: ./gifs + "/${name}") | |
(builtins.attrNames | |
(lib.filterAttrs | |
(name: value: value == "regular") | |
(builtins.readDir ./gifs) | |
) | |
) | |
) | |
); | |
} '' | |
cp ${./index.php} ./index.php | |
chmod a+w ./index.php | |
printf 'function giflist() {\n\treturn %s;\n}' "$gifs" >> ./index.php | |
cat index.php | |
php -l ./index.php | |
mkdir $out | |
cp ./index.php $out/index.php | |
'' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment