From 78fd4cc737f2bb968a947401cba2c918a119e7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amy=20de=20Buitl=C3=A9ir?= Date: Sun, 11 Jun 2023 20:42:36 +0100 Subject: [PATCH] initial commit --- .../shell-recipes/0100-shell-with-nixpkgs.nix | 7 +++++++ .../0150-shell-with-git-nix-pkg.nix | 10 ++++++++++ .../shell-recipes/0200-shell-with-flake.nix | 11 +++++++++++ .../0250-shell-with-flake-rev.nix | 9 +++++++++ .../0300-shell-haskell-local.nix | 14 ++++++++++++++ .../0350-shell-haskell-local-deps.nix | 19 +++++++++++++++++++ .../shell-recipes/0400-shell-with-env-var.nix | 6 ++++++ 7 files changed, 76 insertions(+) create mode 100644 source/shell-recipes/0100-shell-with-nixpkgs.nix create mode 100644 source/shell-recipes/0150-shell-with-git-nix-pkg.nix create mode 100644 source/shell-recipes/0200-shell-with-flake.nix create mode 100644 source/shell-recipes/0250-shell-with-flake-rev.nix create mode 100644 source/shell-recipes/0300-shell-haskell-local.nix create mode 100644 source/shell-recipes/0350-shell-haskell-local-deps.nix create mode 100644 source/shell-recipes/0400-shell-with-env-var.nix diff --git a/source/shell-recipes/0100-shell-with-nixpkgs.nix b/source/shell-recipes/0100-shell-with-nixpkgs.nix new file mode 100644 index 0000000..5cd6a7b --- /dev/null +++ b/source/shell-recipes/0100-shell-with-nixpkgs.nix @@ -0,0 +1,7 @@ +with (import {}); +mkShell { + buildInputs = [ + hello + cowsay + ]; +} diff --git a/source/shell-recipes/0150-shell-with-git-nix-pkg.nix b/source/shell-recipes/0150-shell-with-git-nix-pkg.nix new file mode 100644 index 0000000..8dc9012 --- /dev/null +++ b/source/shell-recipes/0150-shell-with-git-nix-pkg.nix @@ -0,0 +1,10 @@ +with (import {}); +let + hello = import (builtins.fetchGit { + url = "https://codeberg.org/mhwombat/hello-nix"; + rev = "aa2c87f8b89578b069b09fdb2be30a0c9d8a77d8"; + }); +in +mkShell { + buildInputs = [ hello ]; +} diff --git a/source/shell-recipes/0200-shell-with-flake.nix b/source/shell-recipes/0200-shell-with-flake.nix new file mode 100644 index 0000000..cd47453 --- /dev/null +++ b/source/shell-recipes/0200-shell-with-flake.nix @@ -0,0 +1,11 @@ +with (import {}); +let + hello = (builtins.getFlake git+https://codeberg.org/mhwombat/hello-flake).packages.${builtins.currentSystem}.default; + # For older flakes, you might need an expression like this... + # hello = (builtins.getFlake git+https://codeberg.org/mhwombat/hello-flake).defaultPackage.${builtins.currentSystem}; +in +mkShell { + buildInputs = [ + hello + ]; +} diff --git a/source/shell-recipes/0250-shell-with-flake-rev.nix b/source/shell-recipes/0250-shell-with-flake-rev.nix new file mode 100644 index 0000000..68ea4b9 --- /dev/null +++ b/source/shell-recipes/0250-shell-with-flake-rev.nix @@ -0,0 +1,9 @@ +with (import {}); +let + hello = (builtins.getFlake git+https://codeberg.org/mhwombat/hello-flake?ref=main&rev=3aa43dbe7be878dde7b2bdcbe992fe1705da3150).packages.${builtins.currentSystem}.default; +in +mkShell { + buildInputs = [ + hello + ]; +} diff --git a/source/shell-recipes/0300-shell-haskell-local.nix b/source/shell-recipes/0300-shell-haskell-local.nix new file mode 100644 index 0000000..abe3d85 --- /dev/null +++ b/source/shell-recipes/0300-shell-haskell-local.nix @@ -0,0 +1,14 @@ +with (import {}); +let + pandoc-linear-table = haskellPackages.callCabal2nix "pandoc-linear-table" /home/amy/github/pandoc-linear-table {}; + pandoc-logic-proof = haskellPackages.callCabal2nix "pandoc-logic-proof" /home/amy/github/pandoc-logic-proof {}; + pandoc-columns = haskellPackages.callCabal2nix "pandoc-columns" /home/amy/github/pandoc-columns {}; +in +mkShell { + buildInputs = [ + pandoc + pandoc-linear-table + pandoc-logic-proof + pandoc-columns + ]; +} diff --git a/source/shell-recipes/0350-shell-haskell-local-deps.nix b/source/shell-recipes/0350-shell-haskell-local-deps.nix new file mode 100644 index 0000000..24b1905 --- /dev/null +++ b/source/shell-recipes/0350-shell-haskell-local-deps.nix @@ -0,0 +1,19 @@ +with (import {}); +let + pandoc-linear-table = haskellPackages.callCabal2nix "pandoc-linear-table" /home/amy/github/pandoc-linear-table {}; + pandoc-logic-proof = haskellPackages.callCabal2nix "pandoc-logic-proof" /home/amy/github/pandoc-logic-proof {}; + pandoc-columns = haskellPackages.callCabal2nix "pandoc-columns" /home/amy/github/pandoc-columns {}; + pandoc-maths-web = haskellPackages.callCabal2nix "pandoc-maths-web" /home/amy/github/pandoc-maths-web + { + inherit pandoc-linear-table pandoc-logic-proof pandoc-columns; + }; +in +mkShell { + buildInputs = [ + pandoc + pandoc-linear-table + pandoc-logic-proof + pandoc-columns + pandoc-maths-web + ]; +} diff --git a/source/shell-recipes/0400-shell-with-env-var.nix b/source/shell-recipes/0400-shell-with-env-var.nix new file mode 100644 index 0000000..4abf974 --- /dev/null +++ b/source/shell-recipes/0400-shell-with-env-var.nix @@ -0,0 +1,6 @@ +with (import {}); +mkShell { + shellHook = '' + export FOO="bar" + ''; +}