2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, appimageTools
|
|
|
|
, buildFHSEnv
|
|
|
|
, makeDesktopItem
|
|
|
|
, extraPkgs ? pkgs: []
|
|
|
|
, appimage-run-tests ? null
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2023-03-15 16:39:30 +00:00
|
|
|
name = "appimage-run";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
fhsArgs = appimageTools.defaultFhsEnvArgs;
|
2023-03-15 16:39:30 +00:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
inherit name;
|
|
|
|
exec = name;
|
|
|
|
desktopName = name;
|
|
|
|
genericName = "AppImage runner";
|
|
|
|
noDisplay = true;
|
|
|
|
mimeTypes = ["application/vnd.appimage" "application/x-iso9660-appimage"];
|
|
|
|
categories = ["PackageManager" "Utility"];
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
in buildFHSEnv (lib.recursiveUpdate fhsArgs {
|
2023-03-15 16:39:30 +00:00
|
|
|
inherit name;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
targetPkgs = pkgs: [ appimageTools.appimage-exec ]
|
|
|
|
++ fhsArgs.targetPkgs pkgs ++ extraPkgs pkgs;
|
|
|
|
runScript = "appimage-exec.sh";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
extraInstallCommands = ''
|
|
|
|
cp --recursive "${desktopItem}/share" "$out/"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
passthru.tests.appimage-run = appimage-run-tests;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
meta.mainProgram = "appimage-run";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|