Skip to content

Instantly share code, notes, and snippets.

@dalaing
Created July 31, 2016 03:32
Show Gist options
  • Save dalaing/fcb90c21856cc4d1d6a9395d9f480ebc to your computer and use it in GitHub Desktop.
Save dalaing/fcb90c21856cc4d1d6a9395d9f480ebc to your computer and use it in GitHub Desktop.
Multi-project nix files
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
let
inherit (nixpkgs) pkgs;
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
drv = haskellPackages.callPackage ./. {};
in
if pkgs.lib.inNixShell then drv.env else drv
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
let
inherit (nixpkgs) pkgs;
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
modifiedHaskellPackages = haskellPackages.override {
overrides = self: super: {
language-input = self.callPackage ../language-input {};
language-output = self.callPackage ./. {};
};
};
drv = modifiedHaskellPackages.language-output;
in
if pkgs.lib.inNixShell then drv.env else drv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment