From 123e584cb52d07843db1fb460d5e3d3a24f24b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amy=20de=20Buitl=C3=A9ir?= Date: Fri, 5 Sep 2025 20:38:30 +0100 Subject: [PATCH] initial commit --- source/recipes/devshell/non-flake/main.adoc0 | 34 ++++++++++++++++++++ source/recipes/shebang/flake/main.adoc0 | 15 +++++++++ source/recipes/shebang/nixpkg/main.adoc0 | 12 +++++++ 3 files changed, 61 insertions(+) create mode 100644 source/recipes/devshell/non-flake/main.adoc0 create mode 100644 source/recipes/shebang/flake/main.adoc0 create mode 100644 source/recipes/shebang/nixpkg/main.adoc0 diff --git a/source/recipes/devshell/non-flake/main.adoc0 b/source/recipes/devshell/non-flake/main.adoc0 new file mode 100644 index 0000000..b48aad0 --- /dev/null +++ b/source/recipes/devshell/non-flake/main.adoc0 @@ -0,0 +1,34 @@ += A non-flake package (not in nixpkgs) + +//// +$ mkdir tempwork +$ cd tempwork +$ cp ../flake.nix flake.nix +$ git add flake.nix +$ nix develop +$ git add flake.lock +$ git commit -a -m temp +//// + +In this example, we will use a nix package defined in a remote git repo. +However, you can use any of the flake reference styles defined in <<#flakeref>>. + +[source,nix,linenums,highlight='5..7,17..20'] +.flake.nix +.... +$# cat flake.nix +.... + +Here's a demonstration using the shell. + +.... +$ hello-nix # this will fail +$# ../../../../../start-shell nix develop <>. + +[source,bash,linenums,highlight=1..2] +.Script +.... +$# cat run-flake.sh +.... + +.Output +.... +$# ./run-flake.sh +.... diff --git a/source/recipes/shebang/nixpkg/main.adoc0 b/source/recipes/shebang/nixpkg/main.adoc0 new file mode 100644 index 0000000..2083eb9 --- /dev/null +++ b/source/recipes/shebang/nixpkg/main.adoc0 @@ -0,0 +1,12 @@ += Access a top level package from the Nixpkgs/NixOS repo + +[source,bash,linenums,highlight=1..2] +.Script +.... +$# cat run-nixpkg.sh +.... + +.Output +.... +$# ./run-nixpkg.sh +....