From 0ad3568114382c0f50e83a13991370a13a6aab06 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 25 Jul 2019 13:38:50 +0200 Subject: [PATCH 1/2] _3llo: init at 0.3.0 Simple CLI client for `trello.com`. It can be used like this: ``` $ export TRELLO_USER=your_username $ export TRELLO_KEY=your_key $ export TRELLO_TOKEN=your_token $ ./result/bin/3llo ``` I didn't create a module for this as I don't think that those secrets should live in the Nix store. Ideally `3llo` can be used from a script which retrieves secrets from some kind of password store like this: ``` export TRELLO_KEY=$(pass show trello/key) export TRELLO_TOKEN=$(pass show trello/token) 3llo $@ ``` --- pkgs/tools/misc/3llo/Gemfile | 2 + pkgs/tools/misc/3llo/Gemfile.lock | 27 ++++++++++ pkgs/tools/misc/3llo/default.nix | 31 +++++++++++ pkgs/tools/misc/3llo/gemset.nix | 85 +++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 5 files changed, 147 insertions(+) create mode 100644 pkgs/tools/misc/3llo/Gemfile create mode 100644 pkgs/tools/misc/3llo/Gemfile.lock create mode 100644 pkgs/tools/misc/3llo/default.nix create mode 100644 pkgs/tools/misc/3llo/gemset.nix diff --git a/pkgs/tools/misc/3llo/Gemfile b/pkgs/tools/misc/3llo/Gemfile new file mode 100644 index 000000000000000..17a1086d78f0e57 --- /dev/null +++ b/pkgs/tools/misc/3llo/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem '3llo', '0.3.0' diff --git a/pkgs/tools/misc/3llo/Gemfile.lock b/pkgs/tools/misc/3llo/Gemfile.lock new file mode 100644 index 000000000000000..0696ba341651d94 --- /dev/null +++ b/pkgs/tools/misc/3llo/Gemfile.lock @@ -0,0 +1,27 @@ +GEM + remote: https://rubygems.org/ + specs: + 3llo (0.3.0) + tty-prompt (~> 0.12.0) + equatable (0.6.1) + necromancer (0.4.0) + pastel (0.7.3) + equatable (~> 0.6) + tty-color (~> 0.5) + tty-color (0.5.0) + tty-cursor (0.4.0) + tty-prompt (0.12.0) + necromancer (~> 0.4.0) + pastel (~> 0.7.0) + tty-cursor (~> 0.4.0) + wisper (~> 1.6.1) + wisper (1.6.1) + +PLATFORMS + ruby + +DEPENDENCIES + 3llo (= 0.3.0) + +BUNDLED WITH + 1.17.2 diff --git a/pkgs/tools/misc/3llo/default.nix b/pkgs/tools/misc/3llo/default.nix new file mode 100644 index 000000000000000..1f59d1f16a78501 --- /dev/null +++ b/pkgs/tools/misc/3llo/default.nix @@ -0,0 +1,31 @@ +{ lib, ruby, bundlerApp, fetchpatch }: + +bundlerApp { + pname = "3llo"; + + gemfile = ./Gemfile; + lockfile = ./Gemfile.lock; + + gemset = lib.recursiveUpdate (import ./gemset.nix) ({ + "3llo" = { + dontBuild = false; + patches = [ + (fetchpatch { + url = https://github.com/qcam/3llo/commit/7667c67fdc975bac315da027a3c69f49e7c06a2e.patch; + sha256 = "0ahp19igj77x23b2j9zk3znlmm7q7nija7mjgsmgqkgfbz2r1y7v"; + }) + ]; + }; + }); + + inherit ruby; + + exes = [ "3llo" ]; + + meta = with lib; { + description = "Trello interactive CLI on terminal"; + license = licenses.mit; + homepage = https://github.com/qcam/3llo; + maintainers = with maintainers; [ ma27 ]; + }; +} diff --git a/pkgs/tools/misc/3llo/gemset.nix b/pkgs/tools/misc/3llo/gemset.nix new file mode 100644 index 000000000000000..5c50ea9b21229ce --- /dev/null +++ b/pkgs/tools/misc/3llo/gemset.nix @@ -0,0 +1,85 @@ +{ + "3llo" = { + dependencies = ["tty-prompt"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "082g42lkkynnb2piz37ih696zm2ms63mz2q9rnfzjsd149ig39yy"; + type = "gem"; + }; + version = "0.3.0"; + }; + equatable = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0fzx2ishipnp6c124ka6fiw5wk42s7c7gxid2c4c1mb55b30dglf"; + type = "gem"; + }; + version = "0.6.1"; + }; + necromancer = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0v9nhdkv6zrp7cn48xv7n2vjhsbslpvs0ha36mfkcd56cp27pavz"; + type = "gem"; + }; + version = "0.4.0"; + }; + pastel = { + dependencies = ["equatable" "tty-color"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "0m43wk7gswwkl6lfxwlliqc9v1qp8arfygihyz91jc9icf270xzm"; + type = "gem"; + }; + version = "0.7.3"; + }; + tty-color = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1zpp6zixkkchrc2lqnabrsy24pxikz2px87ggz5ph6355fs803da"; + type = "gem"; + }; + version = "0.5.0"; + }; + tty-cursor = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "07whfm8mnp7l49s2cm2qy1snhsqq3a90sqwb71gvym4hm2kx822a"; + type = "gem"; + }; + version = "0.4.0"; + }; + tty-prompt = { + dependencies = ["necromancer" "pastel" "tty-cursor" "wisper"]; + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "1026nyqhgmgxi2nmk8xk3hca07gy5rpisjs8y6w00wnw4f01kpv0"; + type = "gem"; + }; + version = "0.12.0"; + }; + wisper = { + groups = ["default"]; + platforms = []; + source = { + remotes = ["https://rubygems.org"]; + sha256 = "19bw0z1qw1dhv7gn9lad25hgbgpb1bkw8d599744xdfam158ms2s"; + type = "gem"; + }; + version = "1.6.1"; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e4c044e5312d385..9a2a4e048201d1d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -435,6 +435,8 @@ in _0x0 = callPackage ../tools/misc/0x0 { }; + _3llo = callPackage ../tools/misc/3llo { }; + _1password = callPackage ../applications/misc/1password { }; _9pfs = callPackage ../tools/filesystems/9pfs { }; From ebc4a417d0be3853577d095f25947563bea405e1 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 28 Jul 2019 15:52:54 +0200 Subject: [PATCH 2/2] ruby/bundlerApp: ignore `gemset` in env attribute set The `gemset` field can be an attribute set as well in `buildRubyGem`, however attribute sets can't be coerced to strings for the environment set. The impact should be relatively small as the environment variables are only used by the `runCommand` script for `bunlderApp` which doesn't refer to `gemset` at all. --- pkgs/development/ruby-modules/bundler-app/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/ruby-modules/bundler-app/default.nix b/pkgs/development/ruby-modules/bundler-app/default.nix index f8843c6158212ad..10ddde0c1ff1112 100644 --- a/pkgs/development/ruby-modules/bundler-app/default.nix +++ b/pkgs/development/ruby-modules/bundler-app/default.nix @@ -36,7 +36,7 @@ let basicEnv = (callPackage ../bundled-common {}) args; - cmdArgs = removeAttrs args [ "pname" "postBuild" "gemConfig" "passthru" ] // { + cmdArgs = removeAttrs args [ "pname" "postBuild" "gemConfig" "passthru" "gemset" ] // { inherit preferLocalBuild allowSubstitutes; # pass the defaults buildInputs = buildInputs ++ lib.optional (scripts != []) makeWrapper;