Last active
May 25, 2020 16:26
-
-
Save sushi-shi/01162ae816637a1a3ee40649f8b96277 to your computer and use it in GitHub Desktop.
Reproducible nix-shell w/ lorri
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cradle: | |
cabal: | |
component: "exe:sheep-torrent" | |
dependencies: | |
- shell.nix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? let | |
pinpkgs = builtins.fetchGit { | |
name = "nixos-unstable-21-05-2020"; | |
url = "https://github.com/nixos/nixpkgs-channels/"; | |
ref = "refs/heads/nixos-unstable"; | |
rev = "0f5ce2fac0c726036ca69a5524c59a49e2973dd4"; | |
}; | |
in | |
import pinpkgs {} | |
}: | |
let | |
inherit (nixpkgs) pkgs; | |
haskellPackages = pkgs.haskellPackages.override { | |
overrides = self: super: rec { | |
sheep-torrent = let | |
cabal = builtins.filterSource # Rebuild only when .cabal changes | |
(path: _: baseNameOf path == "sheep-torrent.cabal") (./.); | |
in self.callCabal2nix "sheep-torrent" cabal {}; | |
stylish-haskell = | |
self.callCabal2nix "stylish-haskell" (pkgs.fetchFromGitHub { | |
owner = "jaspervdj"; | |
repo = "stylish-haskell"; | |
rev = "3621bf3aa5312fef61220e1760d9988307209c6a"; | |
sha256 = "0rnzghsk3r28j3lcjb0s2mx1kdjrad0ynmsbx9b91158bq3vq09q"; | |
}) {}; | |
pio = let # Rebuild only when sources of a local library change | |
pio-path = pkgs.nix-gitignore.gitignoreSource [] ../pio; | |
in self.callCabal2nix "pio" pio-path {}; | |
}; | |
}; | |
tools = with haskellPackages; [ | |
pkgs.nodejs | |
pkgs.nix-prefetch-git | |
pkgs.cabal2nix | |
hlint stylish-haskell | |
ghcid ghcide hie-bios | |
cabal-install | |
graphmod | |
]; | |
in | |
haskellPackages.shellFor { | |
buildInputs = tools; | |
withHoogle = true; | |
packages = p: [ p.sheep-torrent ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment