-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from DougBurke/ihaskell-flake
bump for ihaskell version and add a flake
- Loading branch information
Showing
6 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
# inspired by: https://serokell.io/blog/practical-nix-flakes#packaging-existing-applications | ||
description = "Allow vega visualizations to auto-display in IHaskell"; | ||
inputs.nixpkgs.url = "nixpkgs"; | ||
outputs = { self, nixpkgs }: | ||
let | ||
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; | ||
# supportedSystems = [ "x86_64-linux" ]; | ||
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); | ||
nixpkgsFor = forAllSystems (system: import nixpkgs { | ||
inherit system; | ||
overlays = [ self.overlay ]; | ||
}); | ||
in | ||
{ | ||
overlay = (final: prev: { | ||
ihaskell-hvega = final.haskellPackages.callCabal2nix "ihaskell-hvega" ./. {}; | ||
hvega = final.haskellPackages.callCabal2nix "../hvega" ./. {}; | ||
}); | ||
packages = forAllSystems (system: { | ||
# do we need to set/override both? | ||
hvega = nixpkgsFor.${system}.hvega; | ||
ihaskell-hvega = nixpkgsFor.${system}.ihaskell-hvega; | ||
}); | ||
defaultPackage = forAllSystems (system: self.packages.${system}.ihaskell-hvega); | ||
checks = self.packages; | ||
devShell = forAllSystems (system: let haskellPackages = nixpkgsFor.${system}.haskellPackages; | ||
in haskellPackages.shellFor { | ||
packages = p: [self.packages.${system}.ihaskell-hvega]; | ||
withHoogle = true; | ||
buildInputs = with haskellPackages; [ | ||
haskell-language-server | ||
hlint | ||
cabal-install | ||
]; | ||
# Change the prompt to show that you are in a devShell | ||
shellHook = '' | ||
echo -e "*** \e[1;32mWelcome to ihaskell-hvega\e[0m ***" | ||
ghc --version | ||
cabal --version | ||
hlint --version | ||
echo -e "" | ||
export PS1='ihaskell-hvega:\A \e[1;34m\w\e[0m ' | ||
''; | ||
}); | ||
}; | ||
} |
This file contains 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