Excise use of importJSON
Putting information in external JSON files is IMHO not an improvement over the idiomatic style of Nix expressions. The use of JSON doesn't add anything over Nix expressions (in fact it removes expressive power). And scattering package info over lots of little files makes packages less readable over having the info in one file.
This commit is contained in:
parent
2dc87881b0
commit
c20cc6d0b3
|
@ -102,25 +102,7 @@ rec {
|
|||
min = x: y: if x < y then x else y;
|
||||
max = x: y: if x > y then x else y;
|
||||
|
||||
/* Reads a JSON file. It is useful to import pure data into other nix
|
||||
expressions.
|
||||
|
||||
Example:
|
||||
|
||||
mkDerivation {
|
||||
src = fetchgit (importJSON ./repo.json)
|
||||
#...
|
||||
}
|
||||
|
||||
where repo.json contains:
|
||||
|
||||
{
|
||||
"url": "git://some-domain/some/repo",
|
||||
"rev": "265de7283488964f44f0257a8b4a055ad8af984d",
|
||||
"sha256": "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h"
|
||||
}
|
||||
|
||||
*/
|
||||
/* Reads a JSON file. */
|
||||
importJSON = path:
|
||||
builtins.fromJSON (builtins.readFile path);
|
||||
|
||||
|
|
|
@ -10,7 +10,13 @@ stdenv.mkDerivation rec {
|
|||
libpthreadstubs libXau libXdmcp libXrandr libXext libXinerama libXxf86vm
|
||||
libXcursor libXfixes
|
||||
];
|
||||
src = fetchgit (stdenv.lib.importJSON ./src.json);
|
||||
|
||||
src = fetchgit {
|
||||
url = https://github.com/mkeeter/ao;
|
||||
rev = "69fadb81543cc9031e4a7ec2036c7f2ab505a620";
|
||||
sha256 = "1717k72vr0i5j7bvxmd6q16fpvkljnqfa1hr3i4yq8cjdsj69my7";
|
||||
};
|
||||
|
||||
cmakeFlags = "-G Ninja";
|
||||
buildPhase = "ninja";
|
||||
installPhase = ''
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"url": "https://github.com/mkeeter/ao",
|
||||
"rev": "69fadb81543cc9031e4a7ec2036c7f2ab505a620",
|
||||
"sha256": "1717k72vr0i5j7bvxmd6q16fpvkljnqfa1hr3i4yq8cjdsj69my7"
|
||||
}
|
|
@ -18,11 +18,14 @@ let
|
|||
python = python2;
|
||||
buildType = "release";
|
||||
|
||||
inherit (importJSON ./upstream-info.json) version extpackRev extpack main;
|
||||
extpack = "3982657fd4853bcbc79b9162e618545a479b65aca08e9ced43a904aeeba3ffa5";
|
||||
extpackRev = 112026;
|
||||
main = "98073b1b2adee4e6553df73cb5bb6ea8ed7c3a41a475757716fd9400393bea40";
|
||||
version = "5.1.10";
|
||||
|
||||
# See https://github.com/NixOS/nixpkgs/issues/672 for details
|
||||
extensionPack = requireFile rec {
|
||||
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRev}.vbox-extpack";
|
||||
name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${toString extpackRev}.vbox-extpack";
|
||||
sha256 = extpack;
|
||||
message = ''
|
||||
In order to use the extension pack, you need to comply with the VirtualBox Personal Use
|
||||
|
|
|
@ -12,7 +12,7 @@ stdenv.mkDerivation {
|
|||
|
||||
src = fetchurl {
|
||||
url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
|
||||
sha256 = (lib.importJSON ../upstream-info.json).guest;
|
||||
sha256 = "29fa0af66a3dd273b0c383c4adee31a52061d52f57d176b67f444698300b8c41";
|
||||
};
|
||||
|
||||
KERN_DIR = "${kernel.dev}/lib/modules/*/build";
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"__NOTE": "Generated using update.py from the same directory.",
|
||||
"extpack": "3982657fd4853bcbc79b9162e618545a479b65aca08e9ced43a904aeeba3ffa5",
|
||||
"extpackRev": "112026",
|
||||
"guest": "29fa0af66a3dd273b0c383c4adee31a52061d52f57d176b67f444698300b8c41",
|
||||
"main": "98073b1b2adee4e6553df73cb5bb6ea8ed7c3a41a475757716fd9400393bea40",
|
||||
"version": "5.1.10"
|
||||
}
|
|
@ -10,7 +10,14 @@ stdenv.mkDerivation rec{
|
|||
libjpeg zeromq3 ncurses openssl libpng readline pkgconfig
|
||||
zlib libX11 which
|
||||
];
|
||||
src = fetchgit (stdenv.lib.importJSON ./src.json);
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://github.com/torch/distro";
|
||||
rev = "8b6a834f8c8755f6f5f84ef9d8da9cfc79c5ce1f";
|
||||
sha256 = "120hnz82d7izinsmv5smyqww71dhpix23pm43s522dfcglpql8xy";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
buildPhase = ''
|
||||
cd ..
|
||||
export PREFIX=$out
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"url": "https://github.com/torch/distro",
|
||||
"rev": "8b6a834f8c8755f6f5f84ef9d8da9cfc79c5ce1f",
|
||||
"sha256": "120hnz82d7izinsmv5smyqww71dhpix23pm43s522dfcglpql8xy",
|
||||
"fetchSubmodules": true
|
||||
}
|
|
@ -1,12 +1,15 @@
|
|||
{ stdenv, fetchurl, kernel, writeScript, coreutils, gnugrep, jq, curl
|
||||
}:
|
||||
|
||||
let
|
||||
data = stdenv.lib.importJSON ./update.json;
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "tp_smapi-${data.version}-${kernel.version}";
|
||||
stdenv.mkDerivation rec {
|
||||
name = "tp_smapi-${version}-${kernel.version}";
|
||||
|
||||
src = fetchurl { inherit (data) url sha256; };
|
||||
version = "0.42";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/evgeni/tp_smapi/archive/tp-smapi/${version}.tar.gz";
|
||||
sha256 = "cd28bf6ee21b2c27b88d947cb0bfcb19648c7daa5d350115403dbcad05849381";
|
||||
};
|
||||
|
||||
hardeningDisable = [ "pic" ];
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"version": "0.42",
|
||||
"url": "https://github.com/evgeni/tp_smapi/archive/tp-smapi/0.42.tar.gz",
|
||||
"sha256": "cd28bf6ee21b2c27b88d947cb0bfcb19648c7daa5d350115403dbcad05849381"
|
||||
}
|
Loading…
Reference in New Issue