From 2c66a3bcc8bee7af5700ec08c587211f0d8616d3 Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Sun, 16 Mar 2025 16:19:23 -0400 Subject: [PATCH] hamrs-pro: init at 2.33.0 Hamrs PRO is the next version of hamrs. It has both Linux and Darwin support. Signed-off-by: Ethan Carter Edwards --- pkgs/by-name/ha/hamrs-pro/package.nix | 95 +++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 pkgs/by-name/ha/hamrs-pro/package.nix diff --git a/pkgs/by-name/ha/hamrs-pro/package.nix b/pkgs/by-name/ha/hamrs-pro/package.nix new file mode 100644 index 000000000000..9074d15368d4 --- /dev/null +++ b/pkgs/by-name/ha/hamrs-pro/package.nix @@ -0,0 +1,95 @@ +{ + lib, + stdenvNoCC, + appimageTools, + fetchurl, + _7zz, +}: + +let + pname = "hamrs-pro"; + version = "2.33.0"; + + throwSystem = throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}"; + + srcs = { + x86_64-linux = fetchurl { + url = "https://hamrs-dist.s3.amazonaws.com/hamrs-pro-${version}-linux-x86_64.AppImage"; + hash = "sha256-FUwyyuXtWaHauZyvRvrH7KDC0du02eNR5TfKJyiKb9k="; + }; + + aarch64-linux = fetchurl { + url = "https://hamrs-dist.s3.amazonaws.com/hamrs-pro-${version}-linux-arm64.AppImage"; + hash = "sha256-YQPKxjaNXE1AgEspZRLI1OUFU71rAU8NBcS0Jv94MS8="; + }; + + x86_64-darwin = fetchurl { + url = "https://hamrs-dist.s3.amazonaws.com/hamrs-pro-${version}-mac-x64.dmg"; + hash = "sha256-KtrXF47AwVAUXYk1Wu2aKMTXENv7q9JBb86Oy+UHQYY="; + }; + + aarch64-darwin = fetchurl { + url = "https://hamrs-dist.s3.amazonaws.com/hamrs-pro-${version}-mac-arm64.dmg"; + hash = "sha256-H46z4V9lo+n/pZzna7KIiYxQBqTlZULitQrFEEMFDvo="; + }; + }; + + src = srcs.${stdenvNoCC.hostPlatform.system} or throwSystem; + + meta = { + homepage = "https://hamrs.app/"; + description = "Simple, portable logger tailored for activities like Parks on the Air, Field Day, and more"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; + maintainers = with lib.maintainers; [ ethancedwards8 ]; + platforms = [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + }; + + linux = appimageTools.wrapType2 rec { + inherit + pname + version + src + meta + ; + + extraInstallCommands = + let + contents = appimageTools.extract { inherit pname version src; }; + in + '' + install -m 444 -D ${contents}/${pname}.desktop -t $out/share/applications + substituteInPlace $out/share/applications/${pname}.desktop \ + --replace-fail 'Exec=AppRun' 'Exec=${pname}' + cp -r ${contents}/usr/share/icons $out/share + ''; + }; + + darwin = stdenvNoCC.mkDerivation { + inherit + pname + version + src + meta + ; + + nativeBuildInputs = [ _7zz ]; + + sourceRoot = "."; + + installPhase = '' + runHook preInstall + + mkdir -p $out/Applications + cp -r *.app $out/Applications + + runHook postInstall + ''; + }; +in +if stdenvNoCC.hostPlatform.isDarwin then darwin else linux