From 08fea349f364f5cd840bcdc1f171e38d45e547b5 Mon Sep 17 00:00:00 2001 From: Douglas Burke Date: Tue, 26 Dec 2023 13:09:59 -0500 Subject: [PATCH] bump for ihaskell version I can not get this to build with text 2.1 and ihaskell 0.11 because of conflicts with other packages, so it is not clear if this is a useful change at this time. --- hvega/flake.lock | 6 ++-- hvega/flake.nix | 4 +++ ihaskell-hvega/CHANGELOG.md | 3 +- ihaskell-hvega/flake.lock | 25 +++++++++++++++ ihaskell-hvega/flake.nix | 47 +++++++++++++++++++++++++++++ ihaskell-hvega/ihaskell-hvega.cabal | 2 +- 6 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 ihaskell-hvega/flake.lock create mode 100644 ihaskell-hvega/flake.nix diff --git a/hvega/flake.lock b/hvega/flake.lock index a928af0a..c278c7ef 100644 --- a/hvega/flake.lock +++ b/hvega/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1693145325, - "narHash": "sha256-Gat9xskErH1zOcLjYMhSDBo0JTBZKfGS0xJlIRnj6Rc=", + "lastModified": 1703499205, + "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cddebdb60de376c1bdb7a4e6ee3d98355453fe56", + "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", "type": "github" }, "original": { diff --git a/hvega/flake.nix b/hvega/flake.nix index 14c79d63..a88ff649 100644 --- a/hvega/flake.nix +++ b/hvega/flake.nix @@ -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 ' ''; }); diff --git a/ihaskell-hvega/CHANGELOG.md b/ihaskell-hvega/CHANGELOG.md index ab48a0c4..9b7033a5 100644 --- a/ihaskell-hvega/CHANGELOG.md +++ b/ihaskell-hvega/CHANGELOG.md @@ -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 diff --git a/ihaskell-hvega/flake.lock b/ihaskell-hvega/flake.lock new file mode 100644 index 00000000..c278c7ef --- /dev/null +++ b/ihaskell-hvega/flake.lock @@ -0,0 +1,25 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1703499205, + "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/ihaskell-hvega/flake.nix b/ihaskell-hvega/flake.nix new file mode 100644 index 00000000..8490cef1 --- /dev/null +++ b/ihaskell-hvega/flake.nix @@ -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 ' + ''; + }); + }; +} diff --git a/ihaskell-hvega/ihaskell-hvega.cabal b/ihaskell-hvega/ihaskell-hvega.cabal index f4f286fb..104dba6e 100644 --- a/ihaskell-hvega/ihaskell-hvega.cabal +++ b/ihaskell-hvega/ihaskell-hvega.cabal @@ -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