Skip to content

Commit

Permalink
golden-cheetah: add AppImage derivation
Browse files Browse the repository at this point in the history
Upstream bakes their API tokens for external services
(like Strava) in its source. When users want to connect
golden-cheetah to the external services, they fail and there
is no option to add own API keys during runtime.

So either the user modifies the derivation to add their own API
keys during build, or we add the pre-build AppImage to NixOS.
This has the developers API keys built-in, so the connection to
external services work as expected.

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
  • Loading branch information
gador committed Dec 21, 2022
1 parent 8267046 commit 2c92cbc
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
34 changes: 34 additions & 0 deletions pkgs/applications/misc/golden-cheetah-app/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{ appimageTools, lib, fetchurl }:
let

pname = "golden-cheetah";
version = "3.6-RC3";

src = fetchurl {
url = "https://github.com/GoldenCheetah/GoldenCheetah/releases/download/v${version}/GoldenCheetah_v3.6-DEV_x64.AppImage";
hash = "sha256-Bp1IFql96tHc5ssg9nhTrFQqNtaM+5iYJguPGkguvns=";
};

appimageContents = appimageTools.extract { inherit pname src version; };
in
appimageTools.wrapType2 {
inherit pname src version;

extraPkgs = pkgs: with pkgs; [ R zlib libusb-compat-0_1 ];

extraInstallCommands = ''
mv $out/bin/${pname}-${version} $out/bin/GoldenCheetah
mkdir -p $out/share/applications
mkdir -p $out/share/pixmaps
cp ${appimageContents}/GoldenCheetah.desktop $out/share/applications/
cp ${appimageContents}/gc.png $out/share/pixmaps/
'';

meta = with lib; {
description = "Performance software for cyclists, runners and triathletes. This version includes the API Tokens for e.g. Strava";
platforms = platforms.linux;
maintainers = with maintainers; [ gador ];
license = licenses.gpl2Plus;
sourceProvenance = sourceTypes.binaryNativeCode;
};
}
2 changes: 1 addition & 1 deletion pkgs/applications/misc/golden-cheetah/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ in mkDerivation rec {
'';

meta = with lib; {
description = "Performance software for cyclists, runners and triathletes";
description = "Performance software for cyclists, runners and triathletes. Built from source and without API tokens";
platforms = platforms.linux;
maintainers = [ ];
license = licenses.gpl2Plus;
Expand Down
6 changes: 5 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37917,7 +37917,11 @@ with pkgs;
branch = "canary";
};

golden-cheetah = libsForQt5.callPackage ../applications/misc/golden-cheetah {};
golden-cheetah = golden-cheetah-source;

golden-cheetah-source = libsForQt5.callPackage ../applications/misc/golden-cheetah {};

golden-cheetah-app = callPackage ../applications/misc/golden-cheetah-app {};

linkchecker = callPackage ../tools/networking/linkchecker { };

Expand Down

0 comments on commit 2c92cbc

Please sign in to comment.