From 719156204e8a9569a687ec14ef88660da1eb08f3 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Fri, 22 Jun 2018 10:39:14 +0200 Subject: refact: allow recursive versionning --- default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 0c12df8..e40d19a 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,6 @@ { pkgs ? import {} }: with pkgs; - -callPackage ./clever-tools { - nodegit = callPackage ./nodegit {}; +{ + latest = callPackage ./clever-tools { + nodegit = callPackage ./nodegit {}; + }; } -- cgit v1.2.3 From ea59684d2272824c06d4a4373bd69fa2e54a2764 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 25 Jun 2018 11:40:03 +0200 Subject: refact: update example --- README.md | 14 ++++++-------- example.nix | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3e0c1bb..b47a4bc 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,13 @@ Main job of those derivations is to use patchelf to make it nix compliant. ## How to use it ```nix -{ pkgs ? import {} }: +{ pkgs ? import {} }: with pkgs; -let - clever-tools = pkgs.fetchFromGitHub - { owner = "fmenou"; +let clever-tools = fetchFromGitHub { + owner = "fretlink"; repo = "clever-tools-nix"; - rev = "7c2a7868b387ffd064dd14c51f7b18224cdc5c88"; - sha256 = "0r4bc4k90xpq325djvsyix9a6hiabmd4nba14j0plgdrwgzb36rh"; + rev = "DESIRED_REVISION_HASH"; + sha256 = "CONTENT_HASH"; }; - -in import clever-tools { inherit pkgs; } +in (import clever-tools {}).latest # select appropriate version ``` diff --git a/example.nix b/example.nix index 1245fec..d7b53db 100644 --- a/example.nix +++ b/example.nix @@ -1,11 +1,9 @@ -{ pkgs ? import {} }: +{ pkgs ? import {} }: with pkgs; -let - clever-tools = pkgs.fetchFromGitHub - { owner = "fmenou"; +let clever-tools = fetchFromGitHub { + owner = "fretlink"; repo = "clever-tools-nix"; - rev = "7c2a7868b387ffd064dd14c51f7b18224cdc5c88"; - sha256 = "0r4bc4k90xpq325djvsyix9a6hiabmd4nba14j0plgdrwgzb36rh"; + rev = "DESIRED_REVISION_HASH"; + sha256 = "CONTENT_HASH"; }; - -in import clever-tools { inherit pkgs; } +in (import clever-tools {}).latest # select appropriate version -- cgit v1.2.3 From 266a698ef2a6f297d772a1a221c83d0c1df76cc6 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 25 Jun 2018 12:03:09 +0200 Subject: add: introduce recursive versionning --- default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/default.nix b/default.nix index e40d19a..e8849a1 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,15 @@ { pkgs ? import {} }: with pkgs; +let + mkOlderVersion = { rev, sha256 }: + let + olderVersion = fetchFromGitHub { + owner = "fretlink"; + repo = "clever-tools-nix"; + inherit rev; + inherit sha256; + }; + in (import olderVersion {}).latest; +in { latest = callPackage ./clever-tools { nodegit = callPackage ./nodegit {}; -- cgit v1.2.3 From a7beaed870bf1169a53b218abfbe66c62bf846a3 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 25 Jun 2018 14:13:00 +0200 Subject: fix: update travis script to build the latest only --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9f457c4..8b81afc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: nix script: - - nix-env -i -f default.nix + - nix-env -i -f default.nix -A latest - ./check.sh . notifications: -- cgit v1.2.3