mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 15:44:20 +00:00
73981dd9c2
Thanks @jtotnar for help with the tests <https://discourse.nixos.org/t/how-to-test-desktop-item-mime-types/24510>!
30 lines
790 B
Nix
30 lines
790 B
Nix
{ appimageTools, buildFHSUserEnv, makeDesktopItem, extraPkgs ? pkgs: [], appimage-run-tests ? null }:
|
|
|
|
let
|
|
name = "appimage-run";
|
|
|
|
fhsArgs = appimageTools.defaultFhsEnvArgs;
|
|
|
|
desktopItem = makeDesktopItem {
|
|
inherit name;
|
|
exec = name;
|
|
desktopName = name;
|
|
genericName = "AppImage runner";
|
|
noDisplay = true;
|
|
mimeTypes = ["application/vnd.appimage" "application/x-iso9660-appimage"];
|
|
categories = ["PackageManager" "Utility"];
|
|
};
|
|
in buildFHSUserEnv (fhsArgs // {
|
|
inherit name;
|
|
|
|
targetPkgs = pkgs: [ appimageTools.appimage-exec ]
|
|
++ fhsArgs.targetPkgs pkgs ++ extraPkgs pkgs;
|
|
runScript = "appimage-exec.sh";
|
|
|
|
extraInstallCommands = ''
|
|
cp --recursive "${desktopItem}/share" "$out/"
|
|
'';
|
|
|
|
passthru.tests.appimage-run = appimage-run-tests;
|
|
})
|