From 84c9fcabba07ec0c1784f3dd9573d7d182988b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amy=20de=20Buitl=C3=A9ir?= Date: Sat, 13 Sep 2025 20:20:18 +0100 Subject: [PATCH] temp --- index.html | 8 ++--- .../recipes/devshell/haskell-flake/flake.nix | 1 + .../recipes/devshell/haskell-flake/main.adoc0 | 32 ++++++++++++++++--- .../recipes/devshell/haskell-pkg/main.adoc0 | 2 +- .../devshell/haskell-pkg/tempwork/Main.hs | 11 +++++++ 5 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 source/recipes/devshell/haskell-pkg/tempwork/Main.hs diff --git a/index.html b/index.html index afe3a4a..8bf306a 100644 --- a/index.html +++ b/index.html @@ -4842,10 +4842,8 @@ Hello from your flake!

10.4.3. Access a Haskell library package in the nixpkgs repo (without a .cabal file)

Occasionally you might want to run a short Haskell program that depends on a Haskell library, -but you don’t want to bother writing a cabal file.

-
-
-

Example: Access the containers package from the haskellPackages set in the nixpkgs repo.

+but you don’t want to bother writing a cabal file. +In this example, we will access the containers package from the haskellPackages set in the nixpkgs repo.

flake.nix
@@ -5575,7 +5573,7 @@ Hello from your flake!
diff --git a/source/recipes/devshell/haskell-flake/flake.nix b/source/recipes/devshell/haskell-flake/flake.nix index 0b86c0f..b093b2a 100644 --- a/source/recipes/devshell/haskell-flake/flake.nix +++ b/source/recipes/devshell/haskell-flake/flake.nix @@ -10,6 +10,7 @@ pandoc-columns.url = "/home/amy/github/pandoc-columns"; pandoc-query.url = "/home/amy/codeberg/pandoc-query"; }; + outputs = inputs@{ self, nixpkgs, flake-parts, pandoc-linear-table, pandoc-logic-proof, pandoc-columns, pandoc-query, ... }: flake-parts.lib.mkFlake { inherit inputs; } { systems = nixpkgs.lib.systems.flakeExposed; diff --git a/source/recipes/devshell/haskell-flake/main.adoc0 b/source/recipes/devshell/haskell-flake/main.adoc0 index a4c0e5a..b519c57 100644 --- a/source/recipes/devshell/haskell-flake/main.adoc0 +++ b/source/recipes/devshell/haskell-flake/main.adoc0 @@ -1,8 +1,21 @@ -= Access to a Haskell package on your local computer += Access to a Haskell package defined in a flake -Ex: Access three Haskell packages +//// +$ mkdir tempwork +$ cd tempwork +$ cp ../flake.nix . +$ git add flake.nix +$ nix develop +$ git add flake.lock +$ git commit -a -m temp +//// + + +In this example we will access three Haskell packages (`pandoc-linear-table`, `pandoc-logic-proof`, and `pandoc-columns`) -that are on my hard drive. +that are defined as flakes on my hard drive. +We are using `haskell-flake`, so the development environment is +set up automatically; no need to define `devShells`. [source,nix,linenums] .flake.nix @@ -10,4 +23,15 @@ that are on my hard drive. include::flake.nix[] .... -// TODO Add demo +Here's a demonstration using the shell. + +.... +$# ../../../../../start-shell nix develop <