Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
78 lines
1.9 KiB
Nix
78 lines
1.9 KiB
Nix
{
|
|
buildNpmPackage,
|
|
fetchFromGitHub,
|
|
fetchpatch2,
|
|
lib,
|
|
makeDesktopItem,
|
|
nix-update-script,
|
|
nwjs,
|
|
}:
|
|
|
|
buildNpmPackage (finalAttrs: {
|
|
pname = "onlykey";
|
|
version = "5.5.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "trustcrypto";
|
|
repo = "OnlyKey-App";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-8MSdr+ghCBPeGp63Yi1T+gyEwXOEUW3vqi9CrCmozrw=";
|
|
};
|
|
|
|
patches = [
|
|
# Provides package-lock.json
|
|
(fetchpatch2 {
|
|
url = "https://github.com/trustcrypto/OnlyKey-App/commit/b8918cec80f5feda50c24a0aec3d6fb914ea8481.patch";
|
|
hash = "sha256-ULMZI7fo5SJGrfCRqZzZVoGOTDQ8q/NG/uXMjNkQ+qk=";
|
|
})
|
|
];
|
|
|
|
desktopItem = makeDesktopItem {
|
|
name = "onlykey";
|
|
exec = "onlykey";
|
|
icon = "onlykey";
|
|
desktopName = "OnlyKey";
|
|
comment = finalAttrs.meta.description;
|
|
categories = [
|
|
"Utility"
|
|
];
|
|
terminal = false;
|
|
};
|
|
|
|
npmDepsHash = "sha256-DpjB95KEHfAc4GBxY40uUjlN7ifBMUncufVTmTXqDo8=";
|
|
|
|
# when installing packages, nw tries to download nwjs in its postInstall
|
|
# script. There are currently no other postInstall scripts, so this
|
|
# should not break other things.
|
|
npmFlags = [ "--ignore-scripts" ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p "$out/share"
|
|
cp -r build "$out/share/onlykey"
|
|
|
|
ln -s "${finalAttrs.desktopItem}/share/applications" "$out/share/applications"
|
|
|
|
mkdir -p "$out/share/icons/hicolor/128x128/apps"
|
|
install -D resources/onlykey_logo_128.png "$out/share/icons/hicolor/128x128/apps/onlykey.png"
|
|
|
|
makeWrapper ${nwjs}/bin/nw "$out/bin/onlykey" \
|
|
--add-flags "$out/share/onlykey"
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = nix-update-script { };
|
|
};
|
|
|
|
meta = {
|
|
description = "Setup and configure OnlyKey";
|
|
homepage = "https://github.com/trustcrypto/OnlyKey-App";
|
|
changelog = "https://github.com/trustcrypto/OnlyKey-App/releases/tag/v${finalAttrs.version}";
|
|
license = lib.licenses.asl20;
|
|
mainProgram = "onlykey";
|
|
};
|
|
})
|