Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump for ihaskell version and add a flake #208

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hvega/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions hvega/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
# Change the prompt to show that you are in a devShell
shellHook = ''
echo -e "*** \e[1;32mWelcome to hvega\e[0m ***"
ghc --version
cabal --version
hlint --version
echo -e ""
export PS1='hvega:\A \e[1;34m\w\e[0m '
'';
});
Expand Down
3 changes: 2 additions & 1 deletion ihaskell-hvega/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ For the latest version of this document, please see

## 0.5.0.5

Support text 2.1 (still not using this, so does it even work?).
Support text 2.1 and IHaskell 0.11 (I am still not using IHaskell
so there's no guarantee this will work).

## 0.5.0.4

Expand Down
25 changes: 25 additions & 0 deletions ihaskell-hvega/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions ihaskell-hvega/flake.nix
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 '
'';
});
};
}
2 changes: 1 addition & 1 deletion ihaskell-hvega/ihaskell-hvega.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ library
build-depends: base >= 4.7 && < 5
, aeson >= 0.11 && < 2.3
, hvega < 0.13
, ihaskell >= 0.10 && < 0.11
, ihaskell >= 0.10 && < 0.12
, text >= 1.2 && < 2.2

default-language: Haskell2010
Expand Down
Loading