aboutsummaryrefslogtreecommitdiff
path: root/minion
diff options
context:
space:
mode:
authorTom Harley2021-11-21 08:23:16 +0000
committerTom Harley2021-11-21 08:23:16 +0000
commit27fe4cc810d630b3933bbb666776e510050b0f9e (patch)
tree3acdc65895689f7063b46c1220eea00ea4b79af0 /minion
parentAdd beginnings of stdenv (diff)
downloadmagpkgs-27fe4cc810d630b3933bbb666776e510050b0f9e.tar.gz
magpkgs-27fe4cc810d630b3933bbb666776e510050b0f9e.zip

Remove stdenv/fetch things

It was a bit too much effort for now. Specifically, making fetch helpers that don’t download the item to hash it are a little more involved.

I might come back to this stuff in the future (although it might end up in a separate repo).

Diffstat (limited to 'minion')
-rw-r--r--minion/default.nix44
1 files changed, 25 insertions, 19 deletions
diff --git a/minion/default.nix b/minion/default.nix
index b72e036..9662b83 100644
--- a/minion/default.nix
+++ b/minion/default.nix
@@ -1,35 +1,41 @@
{ stdenv
, unzip
, coreutils
-, fetch
+, fetchzip
, ...
}:
-stdenv.mkDerivations rec {
- pname = "minion";
+let
+ default_info = {
+ pname = "minion";
+ version = "1.8";
- variations = [
- {
- version = "1.8";
- src = fetch.tar {
- url = https://blogs.cs.st-andrews.ac.uk/constraintmodelling/files/2015/06/minion-1.8-linux.tar_1.gz;
- sha256 = "1346fcssic7hcsy0v4l95ng5iqqlzmm1g8d7p3g944rwzs70g7zp";
- };
- }
+ src = fetchzip {
+ # hacky fix thanks to https://github.com/NixOS/nixpkgs/issues/60157#issuecomment-524965720
+ url = "https://blogs.cs.st-andrews.ac.uk/constraintmodelling/files/2015/06/minion-1.8-linux.tar_1.gz#.tgz";
+ sha256 = "1346fcssic7hcsy0v4l95ng5iqqlzmm1g8d7p3g944rwzs70g7zp";
+ };
+
+ PATH = "${coreutils}/bin";
+ installPhase = ''
+ mkdir -p $out/bin
+ cp $src\/*/minion $out/bin/minion
+ '';
+
+ passthru.variations = map mkv variations;
+ };
+
+ mkv = var: stdenv.mkDerivation (default_info // var);
+
+ variations = [
{
version = "2";
- src = fetch.zip {
+ src = fetchzip {
url = https://github.com/conjure-cp/conjure/releases/download/v2.3.0/conjure-v2.3.0-linux-solvers.zip;
sha256 = "09ajj7zbb4rk9srk3q9gmfkvaymwsd8ai3ddkkinp8y8z018abk0";
};
}
];
- PATH = "${coreutils}/bin";
-
- install = ''
- mkdir -p $out/bin
- cp $src\/*/minion $out/bin/minion
- '';
-}
+in stdenv.mkDerivation default_info