nixpkgs/pkgs/build-support/make-desktopitem/default.nix
2015-12-12 17:25:56 -06:00

35 lines
685 B
Nix

{stdenv}:
{ name
, type ? "Application"
, exec
, icon ? ""
, comment ? ""
, terminal ? "false"
, desktopName
, genericName
, mimeType ? ""
, categories ? "Application;Other;"
, startupNotify ? null
}:
stdenv.mkDerivation {
inherit name;
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}
${if startupNotify == null then ''EOF'' else ''
StartupNotify=${startupNotify}
EOF''}
'';
}