aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFrédéric Menou <frederic.menou@fretlink.com>2018-08-23 17:50:21 +0200
committerGitHub <noreply@github.com>2018-08-23 17:50:21 +0200
commita60f5f961215e9a011b4a0dfe651758001f116d8 (patch)
tree6b6351d79fb567c68fb2d5e2bf4f1b8469891546
parent1838266541adbdea6e58e86324d85af0616dfda8 (diff)
parenta7beaed870bf1169a53b218abfbe66c62bf846a3 (diff)
downloadclever-tools-nix-a60f5f961215e9a011b4a0dfe651758001f116d8.tar.gz
clever-tools-nix-a60f5f961215e9a011b4a0dfe651758001f116d8.tar.zst
clever-tools-nix-a60f5f961215e9a011b4a0dfe651758001f116d8.zip
Merge pull request #5 from hussein-aitlahcen/multiple-versions-1
Exhaustive versionning of packages
-rw-r--r--.travis.yml2
-rw-r--r--README.md14
-rw-r--r--default.nix18
-rw-r--r--example.nix14
4 files changed, 28 insertions, 20 deletions
diff --git a/.travis.yml b/.travis.yml
index 9f457c4..8b81afc 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,7 +2,7 @@
2language: nix 2language: nix
3 3
4script: 4script:
5 - nix-env -i -f default.nix 5 - nix-env -i -f default.nix -A latest
6 - ./check.sh . 6 - ./check.sh .
7 7
8notifications: 8notifications:
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.
13## How to use it 13## How to use it
14 14
15```nix 15```nix
16{ pkgs ? import <nixpkgs> {} }: 16{ pkgs ? import <nixpkgs> {} }: with pkgs;
17 17
18let 18let clever-tools = fetchFromGitHub {
19 clever-tools = pkgs.fetchFromGitHub 19 owner = "fretlink";
20 { owner = "fmenou";
21 repo = "clever-tools-nix"; 20 repo = "clever-tools-nix";
22 rev = "7c2a7868b387ffd064dd14c51f7b18224cdc5c88"; 21 rev = "DESIRED_REVISION_HASH";
23 sha256 = "0r4bc4k90xpq325djvsyix9a6hiabmd4nba14j0plgdrwgzb36rh"; 22 sha256 = "CONTENT_HASH";
24 }; 23 };
25 24in (import clever-tools {}).latest # select appropriate version
26in import clever-tools { inherit pkgs; }
27``` 25```
diff --git a/default.nix b/default.nix
index 0c12df8..e8849a1 100644
--- a/default.nix
+++ b/default.nix
@@ -1,5 +1,17 @@
1{ pkgs ? import <nixpkgs> {} }: with pkgs; 1{ pkgs ? import <nixpkgs> {} }: with pkgs;
2 2let
3callPackage ./clever-tools { 3 mkOlderVersion = { rev, sha256 }:
4 nodegit = callPackage ./nodegit {}; 4 let
5 olderVersion = fetchFromGitHub {
6 owner = "fretlink";
7 repo = "clever-tools-nix";
8 inherit rev;
9 inherit sha256;
10 };
11 in (import olderVersion {}).latest;
12in
13{
14 latest = callPackage ./clever-tools {
15 nodegit = callPackage ./nodegit {};
16 };
5} 17}
diff --git a/example.nix b/example.nix
index 1245fec..d7b53db 100644
--- a/example.nix
+++ b/example.nix
@@ -1,11 +1,9 @@
1{ pkgs ? import <nixpkgs> {} }: 1{ pkgs ? import <nixpkgs> {} }: with pkgs;
2 2
3let 3let clever-tools = fetchFromGitHub {
4 clever-tools = pkgs.fetchFromGitHub 4 owner = "fretlink";
5 { owner = "fmenou";
6 repo = "clever-tools-nix"; 5 repo = "clever-tools-nix";
7 rev = "7c2a7868b387ffd064dd14c51f7b18224cdc5c88"; 6 rev = "DESIRED_REVISION_HASH";
8 sha256 = "0r4bc4k90xpq325djvsyix9a6hiabmd4nba14j0plgdrwgzb36rh"; 7 sha256 = "CONTENT_HASH";
9 }; 8 };
10 9in (import clever-tools {}).latest # select appropriate version
11in import clever-tools { inherit pkgs; }