2020-08-04 18:38:33 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
}:
|
|
|
|
|
2020-08-10 18:25:53 +02:00
|
|
|
apps:
|
2020-08-10 15:27:46 +02:00
|
|
|
|
2020-08-04 18:38:33 +02:00
|
|
|
stdenv.mkDerivation {
|
2020-08-10 15:27:46 +02:00
|
|
|
name = "launcher";
|
2020-08-04 18:38:33 +02:00
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2020-08-10 18:25:53 +02:00
|
|
|
buildInputs = [] ++ apps;
|
|
|
|
apps = apps;
|
2020-08-04 18:38:33 +02:00
|
|
|
phases = [ "installPhase" ];
|
2020-08-10 18:25:53 +02:00
|
|
|
dontPatchShebangs = true;
|
2020-08-04 18:38:33 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2020-08-10 18:25:53 +02:00
|
|
|
mkdir -p $out/apps
|
|
|
|
for j in $apps; do
|
|
|
|
ln -s $j $out/apps/$(basename $j)
|
2020-08-04 18:38:33 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2020-08-10 15:27:46 +02:00
|
|
|
cat > $out/bin/run <<EOF
|
2020-08-10 14:13:28 +02:00
|
|
|
#!/bin/sh
|
2020-08-04 18:38:33 +02:00
|
|
|
|
2020-08-10 18:25:53 +02:00
|
|
|
for j in $out/apps/*; do
|
|
|
|
\$j/bin/run
|
2020-08-04 18:38:33 +02:00
|
|
|
done
|
|
|
|
EOF
|
|
|
|
|
2020-08-10 15:27:46 +02:00
|
|
|
chmod +x $out/bin/run
|
2020-08-04 18:38:33 +02:00
|
|
|
'';
|
|
|
|
}
|