aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2019-07-27 11:16:17 +0200
committerYann Herklotz <git@yannherklotz.com>2019-07-27 11:16:17 +0200
commitd57842487d86d710bdbf83b9c2bbe1fa8c1dd6e2 (patch)
treee49085644295d968108b169502b33bdd4c95aee5
parent7e5621f79dfbeb2e5112bef931c4cfc858a2f19e (diff)
downloadverismith-d57842487d86d710bdbf83b9c2bbe1fa8c1dd6e2.tar.gz
verismith-d57842487d86d710bdbf83b9c2bbe1fa8c1dd6e2.zip
Make the nix build more concise
-rw-r--r--.travis.yml2
-rw-r--r--default.nix48
-rw-r--r--release.nix33
-rw-r--r--shell.nix26
4 files changed, 13 insertions, 96 deletions
diff --git a/.travis.yml b/.travis.yml
index f6f139c..d8cc8ef 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1 @@
language: nix
-
-script: nix-build release.nix
diff --git a/default.nix b/default.nix
index 027ff1b..69de51c 100644
--- a/default.nix
+++ b/default.nix
@@ -1,36 +1,12 @@
-{ mkDerivation, alex, array, base, binary, blaze-html, bytestring
-, Cabal, cabal-doctest, criterion, cryptonite, deepseq, DRBG
-, exceptions, fgl, fgl-visualize, filepath, gitrev, hedgehog
-, hedgehog-fn, lens, lifted-base, memory, monad-control
-, optparse-applicative, parsec, prettyprinter, random
-, recursion-schemes, shakespeare, shelly, statistics, stdenv, tasty
-, tasty-hedgehog, tasty-hunit, template-haskell, text, time
-, tomland, transformers, transformers-base, unordered-containers
-, vector
-}:
-mkDerivation {
- pname = "verifuzz";
- version = "0.3.1.0";
- src = ./.;
- isLibrary = true;
- isExecutable = true;
- setupHaskellDepends = [ base Cabal cabal-doctest ];
- libraryHaskellDepends = [
- array base binary blaze-html bytestring cryptonite deepseq DRBG
- exceptions fgl fgl-visualize filepath gitrev hedgehog lens
- lifted-base memory monad-control optparse-applicative parsec
- prettyprinter random recursion-schemes shakespeare shelly
- statistics template-haskell text time tomland transformers
- transformers-base unordered-containers vector
- ];
- libraryToolDepends = [ alex ];
- executableHaskellDepends = [ base ];
- testHaskellDepends = [
- base fgl hedgehog hedgehog-fn lens parsec shakespeare tasty
- tasty-hedgehog tasty-hunit text
- ];
- benchmarkHaskellDepends = [ base criterion lens ];
- homepage = "https://github.com/ymherklotz/VeriFuzz#readme";
- description = "Random verilog generation and simulator testing";
- license = stdenv.lib.licenses.bsd3;
-}
+{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc865", doBenchmark ? false } :
+let
+ haskellPackages = nixpkgs.pkgs.haskellPackages.override {
+ overrides = haskellPackagesNew: haskellPackagesOld: rec {
+ hedgehog-fn = haskellPackagesNew.callPackage ./nix/hedgehog-fn.nix {};
+ tomland = nixpkgs.pkgs.haskell.lib.dontCheck (haskellPackagesNew.callPackage ./nix/tomland.nix {});
+ parser-combinators = haskellPackagesNew.callPackage ./nix/parser-combinators.nix {};
+ tasty-hedgehog = haskellPackagesNew.callPackage ./nix/tasty-hedgehog.nix {};
+ };
+ };
+in
+ haskellPackages.callCabal2nix "verifuzz" (./.) {}
diff --git a/release.nix b/release.nix
deleted file mode 100644
index a1e7605..0000000
--- a/release.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-let
- composeExtensionsList =
- pkgs.lib.fold pkgs.lib.composeExtensions (_: _: {});
- makeOverrides =
- function: names: haskellPackagesNew: haskellPackagesOld:
- let
- toPackage = name: {
- inherit name;
- value = function haskellPackagesOld.${name};
- };
-
- in
- builtins.listToAttrs (map toPackage names);
- config = {
- packageOverrides = pkgs: rec {
- haskellPackages = pkgs.haskellPackages.override {
- overrides = composeExtensionsList [
- (haskellPackagesNew: haskellPackagesOld: rec {
- hedgehog-fn = haskellPackagesNew.callPackage ./nix/hedgehog-fn.nix {};
- tomland = haskellPackagesNew.callPackage ./nix/tomland.nix {};
- parser-combinators = haskellPackagesNew.callPackage ./nix/parser-combinators.nix {};
- tasty-hedgehog = haskellPackagesNew.callPackage ./nix/tasty-hedgehog.nix {};
- })
- (makeOverrides pkgs.haskell.lib.dontCheck ["tomland"])
- ];
- };
- };
- };
- pkgs = import <nixpkgs> { inherit config; };
-
-in
-{ verifuzz = pkgs.haskellPackages.callPackage ./. { };
-}
diff --git a/shell.nix b/shell.nix
index 733234f..910b922 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,25 +1 @@
-{ compiler ? "default", doBenchmark ? false }:
-
-let
- config = {
- packageOverrides = pkgs: rec {
- haskellPackages = pkgs.haskellPackages.override {
- overrides = haskellPackagesNew: haskellPackagesOld: rec {
- hedgehog-fn = haskellPackagesNew.callPackage ./nix/hedgehog-fn.nix {};
- tomland = haskellPackagesNew.callPackage ./nix/tomland.nix {};
- parser-combinators = haskellPackagesNew.callPackage ./nix/parser-combinators.nix {};
- };
- };
- };
- };
- pkgs = import <nixpkgs> { inherit config; };
-
- haskellPackages = if compiler == "default"
- then pkgs.haskellPackages
- else pkgs.haskell.packages.${compiler};
-
- variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
-
- drv = variant (haskellPackages.callPackage (import ./.) {});
-in
- if pkgs.lib.inNixShell then drv.env else drv
+(import ./. {}).env