diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-12-29 11:31:39 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-12-29 11:31:39 +0100 |
commit | dc10144003f159e8de99c82f4195587fef64cd46 (patch) | |
tree | 89136313352468b87723aa3d7dc9104f5a687642 /libs.nix | |
parent | 25fd1d16198334f678129ddcd6e77ebf7edf9b72 (diff) | |
download | Nix-dc10144003f159e8de99c82f4195587fef64cd46.tar.gz Nix-dc10144003f159e8de99c82f4195587fef64cd46.tar.zst Nix-dc10144003f159e8de99c82f4195587fef64cd46.zip |
Move nixpkgs import to libs
Diffstat (limited to 'libs.nix')
-rw-r--r-- | libs.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libs.nix b/libs.nix new file mode 100644 index 0000000..da13a03 --- /dev/null +++ b/libs.nix | |||
@@ -0,0 +1,29 @@ | |||
1 | let nixpkgs_unstable = import (builtins.fetchTarball { | ||
2 | # FIXME: upgrade to nixpkgs 19 when stable and stick to stable | ||
3 | # versions | ||
4 | name = "nixos-unstable-2018-12-08"; | ||
5 | url = https://github.com/nixos/nixpkgs/archive/61c3169a0e17d789c566d5b241bfe309ce4a6275.tar.gz; | ||
6 | sha256 = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq"; | ||
7 | }) {}; | ||
8 | in | ||
9 | with nixpkgs_unstable; | ||
10 | { | ||
11 | inherit nixpkgs_unstable; | ||
12 | fetchedGithub = path: | ||
13 | let | ||
14 | json = lib.importJSON path; | ||
15 | in rec { | ||
16 | version = json.tag; | ||
17 | name = "${json.meta.name}-${version}"; | ||
18 | src = fetchFromGitHub json.github; | ||
19 | }; | ||
20 | |||
21 | fetchedGit = path: | ||
22 | let | ||
23 | json = lib.importJSON path; | ||
24 | in rec { | ||
25 | version = json.tag; | ||
26 | name = "${json.meta.name}-${version}"; | ||
27 | src = fetchgit json.git; | ||
28 | }; | ||
29 | } | ||