Skip to content

Instantly share code, notes, and snippets.

@nmattia
Created March 4, 2017 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmattia/3752d1b678ca5b54fa68102c17964558 to your computer and use it in GitHub Desktop.
Save nmattia/3752d1b678ca5b54fa68102c17964558 to your computer and use it in GitHub Desktop.
shell.nix for crack.sh
{anyPkgs ? import <nixpkgs> { }}:
let
pkgs = import (anyPkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
rev = "deec3c1dae62e8345451cd8c4ad41134ab95e88d";
sha256 = "1l951xzklxfi2c161mcrps9dfsq76sj8fgq8d60y093bry66d3yc";
}) {};
ghc = pkgs.haskell.compiler.ghc7103;
# tweak haskellSrc2nix to disable (failing) tests
haskellSrc2nix = { name, src }:
pkgs.stdenv.mkDerivation
{ name = "cabal2nix-${name}";
buildInputs = [ pkgs.cabal2nix ];
phases = ["installPhase"];
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE = pkgs.lib.optionalString pkgs.stdenv.isLinux "${pkgs.glibcLocales}/lib/locale/locale-archive";
installPhase = ''
export HOME="$TMP"
mkdir -p "$out"
cabal2nix --no-check --compiler=${ghc.name} --system=${pkgs.stdenv.system} "${src}" > "$out/default.nix"
'';
};
callCabal2nixNoCheck = name: src: pkgs.haskellPackages.callPackage (haskellSrc2nix { inherit src name; });
snipcheck = callCabal2nixNoCheck "snipcheck"
( pkgs.fetchFromGitHub
{ owner = "nmattia";
repo = "snipcheck";
rev = "ed2d586986fab3d781a388c314d18b01527b2d51";
sha256 = "15hsgv9wz3l6q9533azf62ly5y5cscsi18w2nm5bfzh6pilzfdrb";
}
) { };
stutter = callCabal2nixNoCheck "stutter"
( pkgs.fetchFromGitHub
{ owner = "nmattia";
repo = "stutter";
rev = "bf280eee30939a0699b0ee077fc38a738509d4e6";
sha256 = "0mg38xqd7b2j5zh7hyjzlyw7mc0bbsp7yf6jypml8ha53p321m6s";
}
) { inherit snipcheck; } ;
in
pkgs.stdenv.mkDerivation {
name="hello";
buildInputs = [ stutter pkgs.cryptsetup pkgs.parallel ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment