mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 01:33:10 +00:00
37f7581955
https://k8slens.dev/blog/announcing-lens-2024 Refactor to make overlays possible
30 lines
977 B
Nix
30 lines
977 B
Nix
{ lib, stdenv, pname, version, src, meta, appimageTools, makeWrapper, nss_latest }:
|
|
let
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
appimageContents = appimageTools.extractType2 {
|
|
inherit name src;
|
|
};
|
|
|
|
in
|
|
|
|
appimageTools.wrapType2 {
|
|
inherit name src meta;
|
|
|
|
extraInstallCommands =
|
|
''
|
|
mv $out/bin/${name} $out/bin/${pname}
|
|
source "${makeWrapper}/nix-support/setup-hook"
|
|
wrapProgram $out/bin/${pname} \
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
|
install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
|
|
install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/512x512/apps/${pname}.png \
|
|
$out/share/icons/hicolor/512x512/apps/${pname}.png
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
'';
|
|
|
|
extraPkgs = _: [ nss_latest ];
|
|
}
|