diff --git a/source/recipes/ad-hoc/main.adoc0 b/source/recipes/ad-hoc/main.adoc0 index ca1a0e6..fda4d73 100644 --- a/source/recipes/ad-hoc/main.adoc0 +++ b/source/recipes/ad-hoc/main.adoc0 @@ -1,6 +1,6 @@ -= Ad hoc environments with access to... += Ad hoc environments -== A top level package from the Nixpkgs/NixOS repo +== Access a top level package from the Nixpkgs/NixOS repo .... $# ../../../start-shell nix shell nixpkgs#cowsay <>. 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 36f8dcd..0000000 --- a/source/recipes/devshell/haskell-pkg/tempwork/flake.lock +++ /dev/null @@ -1,60 +0,0 @@ -{ - "nodes": { - "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" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1757096966, - "narHash": "sha256-nJpPWCFbc5/u0VIoSHT350FEwPS5pwiRfyZBbZA3Kgg=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "6eb784fb955ab56952e6eeb01f3e64a79933e2b5", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "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 da098df..0000000 --- a/source/recipes/devshell/haskell-pkg/tempwork/flake.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { inherit system; }; - customGhc = pkgs.haskellPackages.ghcWithPackages (p: with p; [ containers ]); - in - { - devShells = rec { - default = pkgs.mkShell { - buildInputs = [ customGhc ]; - }; - }; - } - ); -} diff --git a/source/recipes/devshell/main.adoc b/source/recipes/devshell/main.adoc index 8fd0dfc..8344492 100644 --- a/source/recipes/devshell/main.adoc +++ b/source/recipes/devshell/main.adoc @@ -1,4 +1,4 @@ -= Development shells with access to... += Development shells include::nixpkg/main-generated.adoc[leveloffset=+1] diff --git a/source/recipes/main.adoc b/source/recipes/main.adoc index 8874b76..2195ec5 100644 --- a/source/recipes/main.adoc +++ b/source/recipes/main.adoc @@ -22,14 +22,8 @@ include::devshell/main.adoc[leveloffset=+1] include::nix-shell/main-generated.adoc[leveloffset=+1] -include::remote-git/main.adoc[leveloffset=+1] - -include::haskell-nixpkg/main.adoc[leveloffset=+1] - include::haskell-local/main.adoc[leveloffset=+1] include::haskell-local-deps/main.adoc[leveloffset=+1] -include::python-nixpkg/main.adoc[leveloffset=+1] - include::env-var/main.adoc[leveloffset=+1] diff --git a/source/recipes/python-nixpkg/shebang/main.adoc0 b/source/recipes/python-nixpkg/shebang/main.adoc0 deleted file mode 100644 index 3e6ae31..0000000 --- a/source/recipes/python-nixpkg/shebang/main.adoc0 +++ /dev/null @@ -1,12 +0,0 @@ -= In a Python script - -[source,python,linenums] -.Script -.... -include::my-script.sh[] -.... - -.Output -.... -$# ./my-script.sh -.... diff --git a/source/recipes/python-nixpkg/shell/Main.py b/source/recipes/python-nixpkg/shell/Main.py deleted file mode 100644 index 9a82d6d..0000000 --- a/source/recipes/python-nixpkg/shell/Main.py +++ /dev/null @@ -1,8 +0,0 @@ -from html_sanitizer import Sanitizer -sanitizer = Sanitizer() # default configuration - -original='some text' -print('original: ', original) - -sanitized=sanitizer.sanitize(original) -print('sanitized: ', sanitized) diff --git a/source/recipes/python-nixpkg/shell/main.adoc0 b/source/recipes/python-nixpkg/shell/main.adoc0 deleted file mode 100644 index a1cbc7c..0000000 --- a/source/recipes/python-nixpkg/shell/main.adoc0 +++ /dev/null @@ -1,24 +0,0 @@ -= In `shell.nix` - -[source,nix,linenums] -.shell.nix -.... -include::shell.nix[] -.... - -Here's a short Python program that uses it. - -[source,python,linenums] -.Main.hs -.... -include::Main.py[] -.... - -Here's a demonstration using the program. - -.... -$# echo '$ nix-shell' -$# nix-shell --run bash < {}); -let - customPython = python3.withPackages (ps: with ps; [ html_sanitizer ]); -in -mkShell { - buildInputs = [ - customPython - ]; -} diff --git a/source/recipes/shebang/haskell-nixpkg/main.adoc0 b/source/recipes/shebang/haskell-nixpkg/main.adoc0 index 66953bb..c839fa2 100644 --- a/source/recipes/shebang/haskell-nixpkg/main.adoc0 +++ b/source/recipes/shebang/haskell-nixpkg/main.adoc0 @@ -1,16 +1,10 @@ -= Access to a Haskell library package in the nixpkgs repo (without a `.cabal` file) += 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. -include::shell/main-generated.adoc[leveloffset=+1] - -include::shebang/main-generated.adoc[leveloffset=+1] - -= In a Haskell script - [source,haskell,linenums] .Script .... diff --git a/source/recipes/shebang/main.adoc b/source/recipes/shebang/main.adoc index 55c3aaf..c1d2ea6 100644 --- a/source/recipes/shebang/main.adoc +++ b/source/recipes/shebang/main.adoc @@ -1,4 +1,4 @@ -= Scripts with access to... += Scripts You can use `nix shell` to run scripts in arbitrary languages, providing the necessary dependencies. @@ -14,3 +14,5 @@ include::nixpkg/main-generated.adoc[leveloffset=+1] include::flake/main-generated.adoc[leveloffset=+1] include::haskell-nixpkg/main-generated.adoc[leveloffset=+1] + +include::python-nixpkg/main-generated.adoc[leveloffset=+1] diff --git a/source/recipes/python-nixpkg/main.adoc b/source/recipes/shebang/python-nixpkg/main.adoc0 similarity index 54% rename from source/recipes/python-nixpkg/main.adoc rename to source/recipes/shebang/python-nixpkg/main.adoc0 index 3a820f5..8bdac51 100644 --- a/source/recipes/python-nixpkg/main.adoc +++ b/source/recipes/shebang/python-nixpkg/main.adoc0 @@ -1,11 +1,17 @@ -= Access to a Python library package in the nixpkgs repo (without using a Python builder) += Access a Python library package in the nixpkgs repo (without using a Python builder) Occasionally you might want to run a short Python program that depends on a Python library, but you don't want to bother configuring a builder. Example: Access the `html_sanitizer` package from the `python3nnPackages` set in the nixpkgs repo. -// TODO include::shell/main-generated.adoc[leveloffset=+1] - -include::shebang/main-generated.adoc[leveloffset=+1] +[source,python,linenums] +.Script +.... +include::my-script.sh[] +.... +.Output +.... +$# ./my-script.sh +.... diff --git a/source/recipes/python-nixpkg/shebang/my-script.sh b/source/recipes/shebang/python-nixpkg/my-script.sh similarity index 100% rename from source/recipes/python-nixpkg/shebang/my-script.sh rename to source/recipes/shebang/python-nixpkg/my-script.sh diff --git a/source/recipes/shebang/run-nixpkg-old.sh b/source/recipes/shebang/run-nixpkg-old.sh deleted file mode 100755 index 6e008be..0000000 --- a/source/recipes/shebang/run-nixpkg-old.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env nix-shell -#! nix-shell -i bash -p "[hello cowsay]" -hello -cowsay "Pretty cool, huh?" diff --git a/source/recipes/shebang/run-non-flake.sh b/source/recipes/shebang/run-non-flake.sh deleted file mode 100755 index 244c406..0000000 --- a/source/recipes/shebang/run-non-flake.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env nix -#! nix shell git+https://codeberg.org/mhwombat/hello-flake --command bash -hello-flake