From e2aa713c19e1f5c2545f5116a496432f79aed0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amy=20de=20Buitl=C3=A9ir?= Date: Mon, 15 Sep 2025 14:49:11 +0100 Subject: [PATCH] temp --- index.html | 61 +++++--- .../devshell/haskell-pkg/tempwork/Main.hs | 6 - .../devshell/haskell-pkg/tempwork/flake.lock | 142 ------------------ .../devshell/haskell-pkg/tempwork/flake.nix | 22 --- .../recipes/devshell/nix-non-flake/main.adoc0 | 4 +- .../nix-non-flake/tempwork/flake.lock | 77 ++++++++++ .../devshell/nix-non-flake/tempwork/flake.nix | 27 ++++ 7 files changed, 143 insertions(+), 196 deletions(-) delete mode 100644 source/recipes/devshell/haskell-pkg/tempwork/Main.hs delete mode 100644 source/recipes/devshell/haskell-pkg/tempwork/flake.lock delete mode 100644 source/recipes/devshell/haskell-pkg/tempwork/flake.nix create mode 100644 source/recipes/devshell/nix-non-flake/tempwork/flake.lock create mode 100644 source/recipes/devshell/nix-non-flake/tempwork/flake.nix diff --git a/index.html b/index.html index 5d66de8..2556cd8 100644 --- a/index.html +++ b/index.html @@ -1900,7 +1900,7 @@ location of the executable, if we’re curious.

$ which hello-flake
-/nix/store/qskl8ajlgnl654fhgsmv74yv8x9r3kzg-hello-flake/bin/hello-flake
+/nix/store/y0i81pxnbrg8jpvqp886b4lrzh7wb0ni-hello-flake/bin/hello-flake
@@ -1910,7 +1910,7 @@ directly available.

$ exit
-$ hello-flake     # Won't work outside development shell
+$ hello-flake     # Fails outside development shell
 bash: line 24: hello-flake: command not found
@@ -1921,7 +1921,7 @@ that the package remains in the store for future use.

-
$ /nix/store/qskl8ajlgnl654fhgsmv74yv8x9r3kzg-hello-flake/bin/hello-flake
+
$ /nix/store/y0i81pxnbrg8jpvqp886b4lrzh7wb0ni-hello-flake/bin/hello-flake
 Hello from your flake!
@@ -2825,7 +2825,7 @@ Here’s the modified hello-flake file.

-
$ ./hello-flake     # Won't work
+
$ ./hello-flake     # Fails
 ./hello-flake: line 3: cowsay: command not found
@@ -2974,7 +2974,7 @@ $ exit
-
$ nix run     # Won't work
+
$ nix run     # Fails
 warning: Git tree '/home/amy/codeberg/nix-book/source/modify-hello-flake/hello-flake' is dirty
 /nix/store/rnjqkk7a8sz6wrm1qb1hxssy7qlgaa85-hello-flake/bin/hello-flake: line 3: cowsay: command not found
@@ -3172,7 +3172,7 @@ don’t need to git push the changes until we’re ready to
$ git commit hello-flake flake.nix -m 'added bovine feature'
-[main a10700e] added bovine feature
+[main cb77c4d] added bovine feature
  2 files changed, 13 insertions(+), 1 deletion(-)
 $ nix run
  ________________________
@@ -3381,7 +3381,7 @@ You can come back to this section later to learn more.

$ nix shell nixpkgs#ghc
-$ runghc Main.hs     # Won't work
+$ runghc Main.hs     # Fails
 
 Main.hs:1:1: error: [GHC-87110]
     Could not find module ‘Network.HostName’.
@@ -3400,7 +3400,7 @@ Let’s exit that shell and try again, this time adding the hostname
 
$ exit
 $ nix shell nixpkgs#ghc nixpkgs#hostname
-$ runghc Main.hs     # Won't work
+$ runghc Main.hs     # Fails
 
 Main.hs:1:1: error: [GHC-87110]
     Could not find module ‘Network.HostName’.
@@ -3423,7 +3423,7 @@ The package we want is in the package set called haskellPackages<
 
$ exit
 $ nix shell nixpkgs#ghc nixpkgs#haskellPackages.hostname
-$ runghc Main.hs     # Won't work
+$ runghc Main.hs     # Fails
 
 Main.hs:1:1: error: [GHC-87110]
     Could not find module ‘Network.HostName’.
@@ -3770,7 +3770,7 @@ warning: creating lock file '"/home/amy/codeberg/nix-book/source/new-flake/haske
 • Added input 'haskell-flake':
     'github:srid/haskell-flake/2acbf1c9bb7aac38b59dcc3c1bd78911cf37e42c?narHash=sha256-jwZT6Ns4BXlrFHaXjZgZwfhSaw8nTCTKZ8fCDylrONM%3D' (2025-09-14)
 • Added input 'nixpkgs':
-    'github:nixos/nixpkgs/6d7ec06d6868ac6d94c371458fc2391ded9ff13d?narHash=sha256-fEvTiU4s9lWgW7mYEU/1QUPirgkn%2BodUBTaindgiziY%3D' (2025-09-13)
+    'github:nixos/nixpkgs/88cef159e47c0dc56f151593e044453a39a6e547?narHash=sha256-kYhNxLlYyJcUouNRazBufVfBInMWMyF%2B44xG/xar2yE%3D' (2025-09-14)
 warning: Git tree '/home/amy/codeberg/nix-book/source/new-flake/haskell-flake/hello-haskell' is dirty
@@ -3788,6 +3788,11 @@ The important thing for now is that the build succeeded.

$ nix run
 warning: Git tree '/home/amy/codeberg/nix-book/source/new-flake/haskell-flake/hello-haskell' is dirty
+these 2 derivations will be built:
+  /nix/store/b67dd3m503q30yiwfgav3xzz88bb91h4-hello-flake-haskell-source-1.0.0.drv
+  /nix/store/bgjyjh7282728b2qff37ldygg80zk4m1-hello-flake-haskell-1.0.0.drv
+building '/nix/store/b67dd3m503q30yiwfgav3xzz88bb91h4-hello-flake-haskell-source-1.0.0.drv'...
+building '/nix/store/bgjyjh7282728b2qff37ldygg80zk4m1-hello-flake-haskell-1.0.0.drv'...
 Hello from Haskell inside a Nix flake!
 Your hostname is: wombat11k
@@ -3807,7 +3812,7 @@ We need to add this to the repo, and commit all important files.

$ git add flake.lock
 $ git commit -a -m 'initial commit'
-[master (root-commit) d35f8fd] initial commit
+[master (root-commit) c64c57a] initial commit
  5 files changed, 170 insertions(+)
  create mode 100644 LICENSE
  create mode 100644 Main.hs
@@ -4009,7 +4014,7 @@ First we’ll try building the package manually.
 
-
$ python -m build     # Won't work
+
$ python -m build     # Fails
 /nix/store/iyff8129iampdw13nlfqalzhxy8y1hi9-python3-3.13.6/bin/python: No module named build
@@ -4212,7 +4217,7 @@ something like this.

-
$ nix build     # Won't work
+
$ nix build     # Fails
 error: Path 'flake.nix' in the repository "/home/amy/codeberg/nix-book/source/new-flake/python-flake/hello-python" is not tracked by Git.
 
        To make it visible to Nix, run:
@@ -4236,7 +4241,7 @@ warning: creating lock file '"/home/amy/codeberg/nix-book/source/new-flake/pytho
 • Added input 'flake-utils/systems':
     'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D' (2023-04-09)
 • Added input 'nixpkgs':
-    'github:NixOS/nixpkgs/5ad881b15fb2b63c2f127533ca59f840fcc24c3f?narHash=sha256-P8XdKg87fR5PpCjIgMH%2B05PDwhdmlNrigsvChdHfyaw%3D' (2025-09-14)
+    'github:NixOS/nixpkgs/dd16e0b60390586a261a4e28fc180a91212fe010?narHash=sha256-yM1FFsRiyESij/lzbdBMCUoFOKMoShHu0CAexnBWzTM%3D' (2025-09-15)
 warning: Git tree '/home/amy/codeberg/nix-book/source/new-flake/python-flake/hello-python' is dirty
@@ -4254,6 +4259,9 @@ The important thing for now is that the build succeeded.

$ nix run
 warning: Git tree '/home/amy/codeberg/nix-book/source/new-flake/python-flake/hello-python' is dirty
+this derivation will be built:
+  /nix/store/kr0aywqsm9v8ds4mc909iaan2yaqmjq3-hello-flake-python.drv
+building '/nix/store/kr0aywqsm9v8ds4mc909iaan2yaqmjq3-hello-flake-python.drv'...
 Hello from inside a Python program built with a Nix flake!
@@ -4272,7 +4280,7 @@ We need to add this to the repo, and commit all important files.

$ git add flake.lock
 $ git commit -a -m 'initial commit'
-[master (root-commit) 2af9bd5] initial commit
+[master (root-commit) deac9ed] initial commit
  4 files changed, 127 insertions(+)
  create mode 100644 flake.lock
  create mode 100644 flake.nix
@@ -4655,7 +4663,7 @@ sanitized:  <strong>some text</strong>
-
$ cowsay "Moo!"     # Won't work; dependency not available
+
$ cowsay "Moo!"     # Fails; dependency not available
 bash: line 17: cowsay: command not found
 $ nix develop
 $ cowsay "Moo!"     # Works in development environment
@@ -4780,7 +4788,7 @@ we see that this flake provides both a package and an app called hello
 
@@ -5461,7 +5474,7 @@ Hello from your flake!
diff --git a/source/recipes/devshell/haskell-pkg/tempwork/Main.hs b/source/recipes/devshell/haskell-pkg/tempwork/Main.hs deleted file mode 100644 index 96349a1..0000000 --- a/source/recipes/devshell/haskell-pkg/tempwork/Main.hs +++ /dev/null @@ -1,6 +0,0 @@ -import Text.Pandoc.Filters.Columns - -main :: IO () -main = do - putStrLn "Prove we have access to the pandoc-columns package" - print $ defaultColSpec diff --git a/source/recipes/devshell/haskell-pkg/tempwork/flake.lock b/source/recipes/devshell/haskell-pkg/tempwork/flake.lock deleted file mode 100644 index e3c998d..0000000 --- a/source/recipes/devshell/haskell-pkg/tempwork/flake.lock +++ /dev/null @@ -1,142 +0,0 @@ -{ - "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1756770412, - "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "4524271976b625a4a605beefd893f270620fd751", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "haskell-flake": { - "locked": { - "lastModified": 1756607542, - "narHash": "sha256-+99fEAk0HwjYgIW2tEOs7ayBDxnU9NAM5E29ZxgyX40=", - "owner": "srid", - "repo": "haskell-flake", - "rev": "73e3891fb135c679a1c30fae4b101e5b41b8ca61", - "type": "github" - }, - "original": { - "owner": "srid", - "repo": "haskell-flake", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1757942231, - "narHash": "sha256-yM1FFsRiyESij/lzbdBMCUoFOKMoShHu0CAexnBWzTM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "dd16e0b60390586a261a4e28fc180a91212fe010", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1754788789, - "narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "a73b9c743612e4244d865a2fdee11865283c04e6", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1756911493, - "narHash": "sha256-6n/n1GZQ/vi+LhFXMSyoseKdNfc2QQaSBXJdgamrbkE=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "c6a788f552b7b7af703b1a29802a7233c0067908", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "pandoc-columns": { - "inputs": { - "flake-parts": "flake-parts", - "haskell-flake": "haskell-flake", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1757244346, - "narHash": "sha256-Ewpv8f+CvF0du1egjRJoeOZhKsdoqPkb2ecrwTPI+os=", - "path": "/home/amy/github/pandoc-columns", - "type": "path" - }, - "original": { - "path": "/home/amy/github/pandoc-columns", - "type": "path" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "pandoc-columns": "pandoc-columns" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/source/recipes/devshell/haskell-pkg/tempwork/flake.nix b/source/recipes/devshell/haskell-pkg/tempwork/flake.nix deleted file mode 100644 index 35cc9c0..0000000 --- a/source/recipes/devshell/haskell-pkg/tempwork/flake.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - pandoc-columns.url = "/home/amy/github/pandoc-columns"; - }; - - 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; [ pandoc-columns ]); - in - { - devShells = rec { - default = pkgs.mkShell { - buildInputs = [ customGhc ]; - }; - }; - } - ); -} diff --git a/source/recipes/devshell/nix-non-flake/main.adoc0 b/source/recipes/devshell/nix-non-flake/main.adoc0 index 0a2e182..c793bb0 100644 --- a/source/recipes/devshell/nix-non-flake/main.adoc0 +++ b/source/recipes/devshell/nix-non-flake/main.adoc0 @@ -56,9 +56,9 @@ this is done in line 15. Here's a demonstration using the shell. .... -$ hello-nix # this will fail +$ hello-nix # Fails outside development shell $# ../../../../../start-shell nix develop <