Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
37 lines
847 B
Nix
37 lines
847 B
Nix
{ lib
|
|
, appimageTools
|
|
, buildFHSEnv
|
|
, 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 buildFHSEnv (lib.recursiveUpdate 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;
|
|
|
|
meta.mainProgram = "appimage-run";
|
|
})
|