nix-packages/pkgs/helium/default.nix
mizuki 78ca5b8e3a
Some checks failed
CI / list-packages (pull_request) Successful in 3s
CI / build (helium) (pull_request) Successful in 5s
CI / build (pjsk-cursor) (pull_request) Successful in 3s
CI / build (xcursor-mizuki) (pull_request) Has been cancelled
CI / build (waterfox-bin) (pull_request) Has been cancelled
pkgs/helium: update to 0.11.3.2
2026-04-26 02:19:41 +09:00

56 lines
1.8 KiB
Nix

{
pkgs,
commandLineArgs ? [ ],
enableFeatures ? [ ],
libvaSupport ? pkgs.stdenv.hostPlatform.isLinux,
widevineSupport ? false,
}:
pkgs.appimageTools.wrapType2 rec {
pname = "helium";
version = "0.11.3.2";
src = pkgs.fetchurl {
url = "https://github.com/imputnet/helium-linux/releases/download/${version}/${pname}-${version}-x86_64.AppImage";
sha256 = "sha256-5gdyKg12ZV2hpf0RL+eoJnawuW/J8NobiG+zEA0IOHA=";
};
_enableFeatures =
enableFeatures
++ pkgs.lib.optionals libvaSupport [
"VaapiVideoDecoder"
];
extraPkgs = pkgs: pkgs.lib.optionals libvaSupport [ pkgs.libva ];
extraBwrapArgs = [
"--ro-bind-try /etc/chromium /etc/chromium"
];
nativeBuildInputs = [ pkgs.makeWrapper ];
extraInstallCommands =
let
contents = pkgs.appimageTools.extract { inherit pname version src; };
in
''
wrapProgram $out/bin/${pname} \
${
pkgs.lib.optionalString (
_enableFeatures != [ ]
) "--add-flags \"--enable-features=${pkgs.lib.strings.concatStringsSep "," _enableFeatures}\""
} \
${pkgs.lib.optionalString (
commandLineArgs != [ ]
) "--add-flags \"${pkgs.lib.strings.concatStringsSep " " commandLineArgs}\""} \
${pkgs.lib.optionalString widevineSupport ''
--run "mkdir -p ~/.config/net.imput.helium/WidevineCdm" \
--run "echo '{\"Path\":\"${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm\"}' > ~/.config/net.imput.helium/WidevineCdm/latest-component-updated-widevine-cdm"
''}
install -m 444 -D ${contents}/${pname}.desktop -t $out/share/applications
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
cp -r ${contents}/usr/share/icons $out/share
'';
}