Skip to content

Commit

Permalink
nix: clean up the expression
Browse files Browse the repository at this point in the history
  • Loading branch information
pbogdan committed Jul 26, 2020
1 parent 21e2e22 commit 2d87e87
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 40 deletions.
45 changes: 19 additions & 26 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1,36 @@
{ sources ? (import ./nix/sources.nix)
, compiler ? "ghc883"
let
sources = import ./nix/sources.nix;
in
{ pkgs ? import sources.unstable { }
}:
let
overlay = self: super: {
haskell = super.haskell // {
packages = super.haskell.packages // {
"${compiler}" = super.haskell.packages.${compiler}.override {
overrides = hself: hsuper: with self.haskell.lib; {
ede = overrideCabal hsuper.ede (
drv: {
src = sources."ede-trifecta-2.1";
}
);
hspkgs = pkgs.haskellPackages.override {
overrides = hself: hsuper: with pkgs.haskell.lib; {
ede = overrideCabal hsuper.ede (
drv: {
src = pkgs.fetchFromGitHub {
owner = "brendanhay";
repo = "ede";
rev = "5e0373b8a8c83ff2078a938795e30ec8038d228c";
sha256 = "1lb0q289p6lrc65adlacdx8xy8hrvcywbf6np7rilqdvvnyvlbgs";
};
};
};
}
);
};
};

pkgs = (
import sources.unstable {
overlays = [
overlay
];
}
);

inherit (pkgs.haskellPackages)
inherit (hspkgs)
callCabal2nix
shellFor
;

inherit (pkgs.haskell.lib)
justStaticExecutables
;

inherit (pkgs)
lib
nix-gitignore
;

tag = callCabal2nix "tag" (nix-gitignore.gitignoreSource [] ./.) {};
tag = callCabal2nix "tag" (nix-gitignore.gitignoreSource [ ] ./.) { };
in
justStaticExecutables tag
12 changes: 0 additions & 12 deletions nix/sources.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
{
"ede-trifecta-2.1": {
"branch": "trifecta-2.1",
"description": "Templating language with similar syntax and features to Liquid or Jinja2.",
"homepage": "",
"owner": "pbogdan",
"repo": "ede",
"rev": "1114be9457b15aa8f40a30e058b766048fe3479a",
"sha256": "1km89ahwa4r2ly85kwzp6np807lf5n81bbbszk4yhqmx0qcxcmzg",
"type": "tarball",
"url": "https://github.com/pbogdan/ede/archive/1114be9457b15aa8f40a30e058b766048fe3479a.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"unstable": {
"branch": "nixos-unstable",
"description": "Nix Packages collection",
Expand Down
9 changes: 7 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
let
tag = (import ./default.nix {});
sources = import ./nix/sources.nix;
pkgs = (import sources.unstable {});
in
{ pkgs ? import sources.unstable { }
}:
let
tag = import ./default.nix {
inherit pkgs;
};
in
pkgs.haskellPackages.shellFor {
packages = _: [
Expand Down

0 comments on commit 2d87e87

Please sign in to comment.