2009-05-10 14:03:53 +02:00
|
|
|
{stdenv}:
|
|
|
|
{ name
|
|
|
|
, type ? "Application"
|
|
|
|
, exec
|
|
|
|
, icon ? ""
|
|
|
|
, comment ? ""
|
|
|
|
, terminal ? "false"
|
|
|
|
, desktopName
|
|
|
|
, genericName
|
|
|
|
, mimeType ? ""
|
|
|
|
, categories ? "Application;Other;"
|
2015-12-13 00:25:56 +01:00
|
|
|
, startupNotify ? null
|
2009-05-10 14:03:53 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2016-01-10 15:17:33 +01:00
|
|
|
name = "${name}.desktop";
|
2009-05-10 14:03:53 +02:00
|
|
|
buildCommand = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/share/applications
|
2016-01-10 15:17:33 +01:00
|
|
|
cat > $out/share/applications/${name}.desktop <<EOF
|
2009-05-10 14:03:53 +02:00
|
|
|
[Desktop Entry]
|
|
|
|
Type=${type}
|
|
|
|
Exec=${exec}
|
|
|
|
Icon=${icon}
|
|
|
|
Comment=${comment}
|
|
|
|
Terminal=${terminal}
|
|
|
|
Name=${desktopName}
|
|
|
|
GenericName=${genericName}
|
|
|
|
MimeType=${mimeType}
|
|
|
|
Categories=${categories}
|
2015-12-13 00:25:56 +01:00
|
|
|
${if startupNotify == null then ''EOF'' else ''
|
|
|
|
StartupNotify=${startupNotify}
|
|
|
|
EOF''}
|
2009-05-10 14:03:53 +02:00
|
|
|
'';
|
|
|
|
}
|