From 5e2da971defc5428f4e1284cbb31ae0bad27edda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amy=20de=20Buitl=C3=A9ir?= Date: Thu, 4 Sep 2025 20:40:25 +0100 Subject: [PATCH] initial commit --- source/recipes/devshell/flake/flake.nix | 21 ++++++++++ source/recipes/devshell/nixpkg/main.adoc0 | 31 ++++++++++++++ source/recipes/nix-shell/main.adoc0 | 20 +++++++++ source/recipes/run/main.adoc0 | 50 +++++++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 source/recipes/devshell/flake/flake.nix create mode 100644 source/recipes/devshell/nixpkg/main.adoc0 create mode 100644 source/recipes/nix-shell/main.adoc0 create mode 100644 source/recipes/run/main.adoc0 diff --git a/source/recipes/devshell/flake/flake.nix b/source/recipes/devshell/flake/flake.nix new file mode 100644 index 0000000..0db427b --- /dev/null +++ b/source/recipes/devshell/flake/flake.nix @@ -0,0 +1,21 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + hello-flake.url = "git+https://codeberg.org/mhwombat/hello-flake"; + }; + + outputs = { self, nixpkgs, flake-utils, hello-flake }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + devShells = rec { + default = pkgs.mkShell { + buildInputs = [ hello-flake.packages.${system}.hello ]; + }; + }; + } + ); +} diff --git a/source/recipes/devshell/nixpkg/main.adoc0 b/source/recipes/devshell/nixpkg/main.adoc0 new file mode 100644 index 0000000..a556a0b --- /dev/null +++ b/source/recipes/devshell/nixpkg/main.adoc0 @@ -0,0 +1,31 @@ += A top level package from the Nixpkgs/NixOS repo + +//// +$ mkdir tempwork +$ cd tempwork +$ cp ../flake.nix flake.nix +$ git add flake.nix +$ nix develop +$ git add flake.lock +$ git commit -a -m temp +//// + +[source,nix,linenums,highlight=15] +.flake.nix +.... +$# cat flake.nix +.... + +Here's a demonstration using the shell. + +.... +$ cowsay "Moo!" +$# ../../../../../start-shell nix develop <