diff --git a/index.html b/index.html index fe876d9..a2661c5 100644 --- a/index.html +++ b/index.html @@ -4865,20 +4865,20 @@ together with the high-level workflow described in inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; - }; - + }; + outputs = { self, nixpkgs, flake-utils, pandoc-columns }: - flake-utils.lib.eachDefaultSystem (system: - let + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; - customGhc = pkgs.haskellPackages.ghcWithPackages (p: with p; [ extra ]); - in - { + customGhc = pkgs.haskellPackages.ghcWithPackages (p: with p; [ p.extra ]); + in + { devShells = rec { default = pkgs.mkShell { - buildInputs = [ customGhc ]; - }; - }; + buildInputs = [ customGhc ]; + }; + }; } ); } @@ -4886,10 +4886,8 @@ together with the high-level workflow described in -

Line 5 adds pandoc-columns as an input to this flake. -Line 8 allows the output function to reference pandoc-columns. -Line 12 makes a custom GHC that knows about pandoc-columns, -and line 17 uses the custom GHC as a build input for this flake.

+

Line 12 makes a custom GHC that knows about extra, +and line 16 makes that custom GHC available in the development environment.

Here’s a short Haskell program that uses the new flake.

@@ -5635,7 +5633,7 @@ Hello from your flake!
diff --git a/source/recipes/devshell/haskell-pkg/main.adoc0 b/source/recipes/devshell/haskell-pkg/main.adoc0 index 63da42b..9b9d435 100644 --- a/source/recipes/devshell/haskell-pkg/main.adoc0 +++ b/source/recipes/devshell/haskell-pkg/main.adoc0 @@ -3,7 +3,7 @@ //// $ mkdir tempwork $ cd tempwork -$ cp Main.hs ../flake.nix . +$ cp ../Main.hs ../flake.nix . $ git add Main.hs flake.nix $ nix develop $ git add flake.lock diff --git a/source/recipes/devshell/haskell-pkg/tempwork/Main.hs b/source/recipes/devshell/haskell-pkg/tempwork/Main.hs new file mode 100644 index 0000000..4fe2929 --- /dev/null +++ b/source/recipes/devshell/haskell-pkg/tempwork/Main.hs @@ -0,0 +1,6 @@ +import Data.List.Extra + +main :: IO () +main = do + print $ lower "ABCDE" + print $ upper "XYZ" diff --git a/source/recipes/devshell/haskell-pkg/tempwork/flake.nix b/source/recipes/devshell/haskell-pkg/tempwork/flake.nix new file mode 100644 index 0000000..00ce7dc --- /dev/null +++ b/source/recipes/devshell/haskell-pkg/tempwork/flake.nix @@ -0,0 +1,21 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, pandoc-columns }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + customGhc = pkgs.haskellPackages.ghcWithPackages (p: with p; [ p.extra ]); + in + { + devShells = rec { + default = pkgs.mkShell { + buildInputs = [ customGhc ]; + }; + }; + } + ); +}