universe/home/system/packages/derivations/ubports-installer/default.nix

53 lines
1.3 KiB
Nix
Raw Normal View History

2025-03-07 12:55:45 +00:00
{
lib,
appimageTools,
fetchurl,
makeDesktopItem,
}: let
pname = "ubports-installer";
2025-03-08 05:28:08 +00:00
icon = ./ubports-mascot.png;
2025-03-07 12:55:45 +00:00
desktopItems = [
(makeDesktopItem {
name = pname;
inherit icon;
desktopName = "Ubuntu Touch Installer";
genericName = "GUI for installing Ubuntu Touch";
exec = "@out@/bin/ubports-installer";
comment = "GUI for installing Ubuntu Touch";
categories = ["System"];
startupNotify = false;
keywords = ["system" "os" "network" "ubuntu" "touch" "mobile"];
})
];
in
appimageTools.wrapType2 rec {
inherit pname;
version = "0.10.0";
src = fetchurl {
url = "https://github.com/ubports/ubports-installer/releases/download/${version}/ubports-installer_${version}_linux_x86_64.AppImage";
2025-03-08 05:28:08 +00:00
hash = "sha256-RmSim4dJMCQsw+lFN17dhuL5AqfHNLyiDYQtzO5gymU=";
2025-03-07 12:55:45 +00:00
};
extraInstallCommands =
2025-03-08 05:28:08 +00:00
lib.concatMapStringsSep "\n "
2025-03-07 12:55:45 +00:00
(e: ''
install -Dm444 -t $out/share/applications ${e}/share/applications/*.desktop
'')
desktopItems
+ ''
install -Dm444 ${icon} $out/share/icons/apps/${pname}.jpg;
for f in $out/share/applications/*.desktop; do
substituteInPlace $f --subst-var out
done
'';
meta = with lib; {
description = "Ubuntu Touch installer";
license = licenses.free;
};
}