3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support/make-desktopitem/default.nix

37 lines
739 B
Nix
Raw Normal View History

{stdenv}:
{ name
, type ? "Application"
, exec
, icon ? ""
, comment ? ""
, terminal ? "false"
, desktopName
, genericName
, mimeType ? ""
, categories ? "Application;Other;"
2015-12-12 23:25:56 +00:00
, startupNotify ? null
, extraEntries ? ""
}:
stdenv.mkDerivation {
name = "${name}.desktop";
buildCommand = ''
mkdir -p $out/share/applications
cat > $out/share/applications/${name}.desktop <<EOF
[Desktop Entry]
Type=${type}
Exec=${exec}
Icon=${icon}
Comment=${comment}
Terminal=${terminal}
Name=${desktopName}
GenericName=${genericName}
MimeType=${mimeType}
Categories=${categories}
${extraEntries}
2015-12-12 23:25:56 +00:00
${if startupNotify == null then ''EOF'' else ''
StartupNotify=${startupNotify}
EOF''}
'';
}