Files
nixpkgs/pkgs/by-name/tk/tk-safe/package.nix
Dark Steveneq 646b892680
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
push sheeet
2025-10-09 14:15:47 +02:00

104 lines
2.1 KiB
Nix

{
stdenv,
lib,
fetchurl,
squashfsTools,
autoPatchelfHook,
copyDesktopItems,
alsa-lib,
nss,
libdrm,
libgbm,
libGL,
libxkbcommon,
pcsclite,
makeDesktopItem,
makeWrapper,
wrapGAppsHook3,
udev,
}:
stdenv.mkDerivation rec {
pname = "tk-safe";
version = "25.8.2";
# To update, check https://search.apps.ubuntu.com/api/v1/package/tk-safe and copy the anon_download_url and version.
src = fetchurl {
url = "https://api.snapcraft.io/api/v1/snaps/download/rLNeIGEaag0TKFQLO0TxF3ARXg3rcTNx_19.snap";
hash = "sha256-bjlkLCTHkGH2LdeGd3LIp7L8f7SzZetpEpvGpPEzjcA=";
};
desktopItems = [
(makeDesktopItem {
name = "tk-safe";
icon = "tk-safe";
exec = "tk-safe";
desktopName = "TK-Safe";
comment = meta.description;
genericName = "Eletronic medical record (ePA)";
categories = [ "Utility" ];
})
];
nativeBuildInputs = [
autoPatchelfHook
copyDesktopItems
makeWrapper
squashfsTools
wrapGAppsHook3
];
unpackPhase = ''
runHook preUnpack
unsquashfs $src
runHook postUnpack
'';
sourceRoot = "squashfs-root";
postPatch = ''
rm -rf lib usr
'';
buildInputs = [
alsa-lib
nss
libdrm
libgbm
libxkbcommon
udev
pcsclite
];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,opt/tk-safe}
mv * $out/opt/tk-safe
ln -s $out/opt/tk-safe/app/tk-safe $out/bin/tk-safe
mkdir -p $out/share/icons/hicolor/1024x1024/apps
ln -s $out/opt/tk-safe/meta/gui/icon.png $out/share/icons/hicolor/1024x1024/apps/tk-safe.png
runHook postInstall
'';
preFixup = ''
wrapProgram $out/opt/tk-safe/app/tk-safe \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}"
'';
meta = {
description = "Electronic medical record (ePA) by Techniker Krankenkasse (TK)";
homepage = "https://snapcraft.io/tk-safe";
license = lib.licenses.unfree;
platforms = [ "x86_64-linux" ];
# Vendored copy of Electron.
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ felschr ];
mainProgram = "tk-safe";
};
}