mirror of
https://github.com/haskell-nix/hnix.git
synced 2024-10-05 19:37:13 +03:00
Merge {build,shell,default}.nix into default.nix
cabal2nix generates all of them in one go.
This commit is contained in:
parent
a28a8397cd
commit
b821021cac
5
Makefile
5
Makefile
@ -1,7 +1,4 @@
|
||||
all: default.nix shell.nix
|
||||
all: default.nix
|
||||
|
||||
default.nix: hnix.cabal
|
||||
cabal2nix . > $@
|
||||
|
||||
shell.nix: hnix.cabal
|
||||
cabal2nix --shell . > $@
|
||||
|
@ -13,7 +13,7 @@ Tested with Nix v1.10.
|
||||
$ git clone https://github.com/jwiegley/hnix.git
|
||||
...
|
||||
$ cd hnix
|
||||
$ cabal2nix --shell . > shell.nix
|
||||
$ cabal2nix --shell . > default.nix
|
||||
$ nix-shell
|
||||
...
|
||||
$ cabal test
|
||||
|
@ -1,9 +0,0 @@
|
||||
{ nixpkgs ? import <nixpkgs> {}, compiler ? null }:
|
||||
let
|
||||
haskellPackages = if compiler == null
|
||||
# use the current default version
|
||||
then nixpkgs.pkgs.haskellPackages
|
||||
else nixpkgs.pkgs.haskell.packages.${compiler};
|
||||
in
|
||||
|
||||
haskellPackages.callPackage ./default.nix {}
|
70
default.nix
70
default.nix
@ -1,27 +1,43 @@
|
||||
{ mkDerivation, ansi-wl-pprint, base, containers, criterion
|
||||
, data-fix, deepseq, deriving-compat, parsers, regex-tdfa
|
||||
, regex-tdfa-text, semigroups, stdenv, tasty, tasty-hunit, tasty-th
|
||||
, text, transformers, trifecta, unordered-containers
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "hnix";
|
||||
version = "0.4.0";
|
||||
src = ./.;
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
libraryHaskellDepends = [
|
||||
ansi-wl-pprint base containers data-fix deepseq deriving-compat
|
||||
parsers regex-tdfa regex-tdfa-text semigroups text transformers
|
||||
trifecta unordered-containers
|
||||
];
|
||||
executableHaskellDepends = [
|
||||
ansi-wl-pprint base containers data-fix deepseq
|
||||
];
|
||||
testHaskellDepends = [
|
||||
base containers data-fix tasty tasty-hunit tasty-th text
|
||||
];
|
||||
benchmarkHaskellDepends = [ base containers criterion text ];
|
||||
homepage = "http://github.com/jwiegley/hnix";
|
||||
description = "Haskell implementation of the Nix language";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
}
|
||||
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
|
||||
|
||||
let
|
||||
|
||||
inherit (nixpkgs) pkgs;
|
||||
|
||||
f = { mkDerivation, ansi-wl-pprint, base, containers, criterion
|
||||
, data-fix, deepseq, deriving-compat, parsers, regex-tdfa
|
||||
, regex-tdfa-text, semigroups, stdenv, tasty, tasty-hunit, tasty-th
|
||||
, text, transformers, trifecta, unordered-containers
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "hnix";
|
||||
version = "0.4.0";
|
||||
src = ./.;
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
libraryHaskellDepends = [
|
||||
ansi-wl-pprint base containers data-fix deepseq deriving-compat
|
||||
parsers regex-tdfa regex-tdfa-text semigroups text transformers
|
||||
trifecta unordered-containers
|
||||
];
|
||||
executableHaskellDepends = [
|
||||
ansi-wl-pprint base containers data-fix deepseq
|
||||
];
|
||||
testHaskellDepends = [
|
||||
base containers data-fix tasty tasty-hunit tasty-th text
|
||||
];
|
||||
benchmarkHaskellDepends = [ base containers criterion text ];
|
||||
homepage = "http://github.com/jwiegley/hnix";
|
||||
description = "Haskell implementation of the Nix language";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
};
|
||||
|
||||
haskellPackages = if compiler == "default"
|
||||
then pkgs.haskellPackages
|
||||
else pkgs.haskell.packages.${compiler};
|
||||
|
||||
drv = haskellPackages.callPackage f {};
|
||||
|
||||
in
|
||||
|
||||
if pkgs.lib.inNixShell then drv.env else drv
|
||||
|
45
shell.nix
45
shell.nix
@ -1,45 +0,0 @@
|
||||
{ nixpkgs ? import <darwin> {}, compiler ? "default", doBenchmark ? false }:
|
||||
|
||||
let
|
||||
|
||||
inherit (nixpkgs) pkgs;
|
||||
|
||||
f = { mkDerivation, ansi-wl-pprint, base, containers, criterion
|
||||
, data-fix, deepseq, deriving-compat, parsers, regex-tdfa
|
||||
, regex-tdfa-text, semigroups, stdenv, tasty, tasty-hunit, tasty-th
|
||||
, text, transformers, trifecta, unordered-containers
|
||||
}:
|
||||
mkDerivation {
|
||||
pname = "hnix";
|
||||
version = "0.4.0";
|
||||
src = ./.;
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
libraryHaskellDepends = [
|
||||
ansi-wl-pprint base containers data-fix deepseq deriving-compat
|
||||
parsers regex-tdfa regex-tdfa-text semigroups text transformers
|
||||
trifecta unordered-containers
|
||||
];
|
||||
executableHaskellDepends = [
|
||||
ansi-wl-pprint base containers data-fix deepseq
|
||||
];
|
||||
testHaskellDepends = [
|
||||
base containers data-fix tasty tasty-hunit tasty-th text
|
||||
];
|
||||
benchmarkHaskellDepends = [ base containers criterion text ];
|
||||
homepage = "http://github.com/jwiegley/hnix";
|
||||
description = "Haskell implementation of the Nix language";
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
};
|
||||
|
||||
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 f {});
|
||||
|
||||
in
|
||||
|
||||
if pkgs.lib.inNixShell then drv.env else drv
|
Loading…
Reference in New Issue
Block a user