Skip to content

Instantly share code, notes, and snippets.

@techtangents
Created February 21, 2018 03:18
Show Gist options
  • Save techtangents/814a4c98d380f28e69c331cb968ff65c to your computer and use it in GitHub Desktop.
Save techtangents/814a4c98d380f28e69c331cb968ff65c to your computer and use it in GitHub Desktop.
{ mkDerivation, aeson, aeson-pretty, base, blaze-html, bytestring
, data-default, either, free, lens, optparse-applicative
, QuickCheck, semigroups, stdenv, system-filepath, tasty
, tasty-hunit, tasty-quickcheck, text, text1, time, url
, xml-conduit, xml-conduit-decode
}:
mkDerivation {
pname = "brazil";
version = "0.1.0.0";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson aeson-pretty base blaze-html bytestring data-default either
free lens optparse-applicative semigroups text text1 time url
xml-conduit xml-conduit-decode
];
executableHaskellDepends = [
aeson aeson-pretty base blaze-html bytestring data-default either
free lens optparse-applicative semigroups text text1 url
xml-conduit xml-conduit-decode
];
testHaskellDepends = [
base data-default lens QuickCheck semigroups system-filepath tasty
tasty-hunit tasty-quickcheck text text1 url xml-conduit
xml-conduit-decode
];
license = stdenv.lib.licenses.unfree;
}
{}:
let
nixpkgs = import ./nixpin.nix { };
sources = {
text1 = nixpkgs.fetchFromGitHub {
owner = "qfpl";
repo = "tex1";
rev = "1b383775f706f2a0d38b793a34c9eb5fea2e77d1";
sha256 = "01h44a9hkb5ki8b4yds8q5qbjy6mypjhfkgvrhwhxjq541wfx6lw"; # this sha is wrong
fetchSubmodules = true;
};
};
modifiedHaskellPackages = nixpkgs.haskellPackages.override {
overrides = self: super: {
xml-conduit-decode = nixpkgs.haskell.lib.dontCheck super.xml-conduit-decode;
text1 = import sources.text1 { inherit nixpkgs; };
};
};
_brazil = modifiedHaskellPackages.callPackage ./brazil.nix { };
in {
brazil = _brazil;
}
import (fetchTarball {
url = "https://github.com/NixOS/nixpkgs-channels/archive/8b1cf100cd8badad6e1b6d4650b904b88aa870db.tar.gz";
# Wait till new nix version is released.
#sha256 = "16lypr390jcl18d174z6ih732phbpqp40pjq06gsisnm04b6bl1z";
}
)
let
nixpkgs = import ./nixpin.nix {};
brazil' = (import ./. {}).brazil;
brazil = nixpkgs.haskell.lib.addBuildDepends brazil' (with nixpkgs.haskellPackages;
[ cabal-install cabal2nix hindent hasktags hlint apply-refact ghcid ]
);
in brazil.env
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nix curl jq
#
# Updates the nixpin.nix to the latest channel release
# From https://gist.github.com/zimbatm/de5350245874361762b6a4dfe5366530
set -euo pipefail
cd "$(dirname "$0")" || exit 1
branch=nixos-unstable
owner=NixOS
repo=nixpkgs-channels
rev=$(curl -sfL https://api.github.com/repos/$owner/$repo/git/refs/heads/$branch | jq -r .object.sha)
url=https://github.com/$owner/$repo/archive/$rev.tar.gz
release_sha256=$(nix-prefetch-url "$url")
cat <<NIXPKGS | tee nixpin.nix
import (fetchTarball {
url = "$url";
# Wait till new nix version is released.
#sha256 = "$release_sha256";
}
)
NIXPKGS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment