Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8628,6 +8628,12 @@
email = "nfjinjing@gmail.com";
name = "Jinjing Wang";
};
ngiger = {
email = "niklaus.giger@member.fsf.org";
github = "ngiger";
githubId = 265800;
name = "Niklaus Giger";
};
nh2 = {
email = "mail@nh2.me";
matrix = "@nh2:matrix.org";
Expand Down
2 changes: 2 additions & 0 deletions pkgs/applications/misc/postrunner/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'postrunner'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we pin the version here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pinned the version there. But I think this violates an assumption of the bundler-update-script (see pkgs/development/ruby-modules/bundler-update-script/default.nix).
But bundler-update-script is not documented and I am still a novice NixOS user.
I would appreciate if @nicknovitski could answer this question.
I would suggest to add
in https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/ruby.section.md#packaging-executables-that-require-wrapping
a few lines to mention the purpose of bundler-update-script and when it is called. Probably somewhere via another script at a given point for each NixOS release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote it to follow the convention that I saw in other packages and the manual (including in that linked section), where no version specification is added to the Gemfile, since committing the lockfile pins the version anyway.

25 changes: 25 additions & 0 deletions pkgs/applications/misc/postrunner/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
GEM
remote: https://rubygems.org/
specs:
bindata (2.4.10)
fit4ruby (3.9.0)
bindata (~> 2.4.8)
mini_portile2 (2.7.1)
nokogiri (1.13.1)
mini_portile2 (~> 2.7.0)
racc (~> 1.4)
perobs (4.3.0)
postrunner (1.0.5)
fit4ruby (~> 3.9.0)
nokogiri
perobs (~> 4.3.0)
racc (1.6.0)

PLATFORMS
ruby

DEPENDENCIES
postrunner

BUNDLED WITH
2.1.4
21 changes: 21 additions & 0 deletions pkgs/applications/misc/postrunner/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# To run it call: nix-build -A postrunner.tests
{ lib, bundlerApp, bundlerUpdateScript, callPackage }:

bundlerApp {
pname = "postrunner";
gemdir = ./.;
exes = [ "postrunner" ];
passthru.updateScript = bundlerUpdateScript "postrunner";
passthru.tests = {
simple-execution = callPackage ./tests.nix { };
};


meta = with lib; {
description = "PostRunner is an application to manage FIT files produced by Garmin products";
homepage = "https://github.com/scrapper/postrunner";
license = licenses.gpl2Only;
maintainers = with maintainers; [ ngiger ];
platforms = platforms.unix;
};
}
75 changes: 75 additions & 0 deletions pkgs/applications/misc/postrunner/gemset.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
bindata = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "06lqi4svq5qls9f7nnvd2zmjdqmi2sf82sq78ci5d78fq0z5x2vr";
type = "gem";
};
version = "2.4.10";
};
fit4ruby = {
dependencies = ["bindata"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1s30g027v0pvk53fgkszm1qj7mmljgam4gwd9wbljap7i4c32w7d";
type = "gem";
};
version = "3.9.0";
};
mini_portile2 = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0d3ga166pahsxavzwj19yjj4lr13rw1vsb36s2qs8blcxigrdp6z";
type = "gem";
};
version = "2.7.1";
};
nokogiri = {
dependencies = ["mini_portile2" "racc"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1zqzawia52cdcmi55lp7v8jmiqyw7pcpwsksqlnirwfm3f7bnf11";
type = "gem";
};
version = "1.13.1";
};
perobs = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0cygqn869fvlsiq27qfg5ak8dr7pagp8yqr34h0hvzg8h8yq9fjq";
type = "gem";
};
version = "4.3.0";
};
postrunner = {
dependencies = ["fit4ruby" "nokogiri" "perobs"];
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "116xs2zn1178906ybpfll3f1k0jai2ccr3bxq1c175faiskdalxg";
type = "gem";
};
version = "1.0.5";
};
racc = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0la56m0z26j3mfn1a9lf2l03qx1xifanndf9p3vx1azf6sqy7v9d";
type = "gem";
};
version = "1.6.0";
};
}
20 changes: 20 additions & 0 deletions pkgs/applications/misc/postrunner/tests.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ runCommand, postrunner, stdenv }:

let
inherit (postrunner) name;
version = (import ./gemset.nix).postrunner.version;
in

runCommand "${name}-tests" { meta.timeout = 3; }
''
# get version of installed program and compare with package version
if [[ `${postrunner}/bin/postrunner version` != *"${version}"* ]]; then
echo "Error: program version does not match package version"
exit 1
fi
# run help
${postrunner}/bin/postrunner --help | grep 'Usage postrunner .command. .options.'
echo All test for $name passed
# needed for Nix to register the command as successful
touch $out
''
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26485,6 +26485,8 @@ with pkgs;
buildGoModule = buildGo117Module;
};

postrunner = callPackage ../applications/misc/postrunner { };

slack = callPackage ../applications/networking/instant-messengers/slack { };

slack-cli = callPackage ../tools/networking/slack-cli { };
Expand Down