From ba9da295a0efefc0537d7554b2f4488ae94ece2d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 4 Feb 2021 22:12:27 -0500 Subject: shell_spine.nix added --- default.nix | 1 - nix/shell/shell_spine.nix | 18 ++++++++++++++++++ org/spine_build_scaffold.org | 30 ++++++++++++++++++++++++++++-- shell.nix | 4 +++- 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100755 nix/shell/shell_spine.nix diff --git a/default.nix b/default.nix index 0c100a2..7e4f233 100755 --- a/default.nix +++ b/default.nix @@ -1,4 +1,3 @@ -#!/usr/bin/env -S nix-build { pkgs ? import {} }: with import ./nix/mkDub.nix { inherit pkgs; }; mkDubDerivation rec { diff --git a/nix/shell/shell_spine.nix b/nix/shell/shell_spine.nix new file mode 100755 index 0000000..0c0deb6 --- /dev/null +++ b/nix/shell/shell_spine.nix @@ -0,0 +1,18 @@ +{ pkgs ? import {} }: +pkgs.mkShell { + buildInputs = with pkgs; [ + (import ../pkglst/shell-pkgs.nix { inherit pkgs; }) + ]; + buildPhase = "nix build -f default.nix"; + shellHook = '' + if [[ -e ".envrc" ]]; then + source .envrc + fi + nix-build + RUN="./result/bin/spine --very-verbose --theme-light --html --epub --sqlite-discrete --output=/tmp/www ./data/pod/sisu-markup" + $RUN + echo "built spine ... @ ./result/bin/spine" + echo "& (tested with) run:" + echo " $RUN" + ''; +} diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org index d92c753..c99d486 100644 --- a/org/spine_build_scaffold.org +++ b/org/spine_build_scaffold.org @@ -1962,7 +1962,7 @@ nix flake update --recreate-lock-file nix build -f default.nix ./result/bin/spine -#+BEGIN_SRC nix :tangle ../shell.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-shell" +#+BEGIN_SRC nix :tangle ../shell.nix :tangle-mode (identity #o755) :-shebang "#!/usr/bin/env -S nix-shell" { pkgs ? import {} }: pkgs.mkShell { buildInputs = with pkgs; [ @@ -1971,11 +1971,37 @@ pkgs.mkShell { buildPhase = "nix build -f default.nix"; shellHook = '' echo "built spine @ ./result/bin/spine" + if [[ -e ".envrc" ]]; then + source .envrc + fi #nix-instantiate | nix show-derivation | jq ''; } #+END_SRC +nix-shell nix/shell/shell_spine.nix --pure + +#+BEGIN_SRC nix :tangle ../nix/shell/shell_spine.nix :tangle-mode (identity #o755) :-shebang "#!/usr/bin/env -S nix-shell" +{ pkgs ? import {} }: +pkgs.mkShell { + buildInputs = with pkgs; [ + (import ../pkglst/shell-pkgs.nix { inherit pkgs; }) + ]; + buildPhase = "nix build -f default.nix"; + shellHook = '' + if [[ -e ".envrc" ]]; then + source .envrc + fi + nix-build + RUN="./result/bin/spine --very-verbose --theme-light --html --epub --sqlite-discrete --output=/tmp/www ./data/pod/sisu-markup" + $RUN + echo "built spine ... @ ./result/bin/spine" + echo "& (tested with) run:" + echo " $RUN" + ''; +} +#+END_SRC + - combining shell.nix & default.nix to build package: #+BEGIN_SRC nix :NO-tangle ../shell.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-shell" @@ -2068,7 +2094,7 @@ mkDubDerivation rec { nix build -f project.nix nix build -f spine.nix -#+BEGIN_SRC nix :tangle ../default.nix :tangle-mode (identity #o755) :shebang "#!/usr/bin/env -S nix-build" +#+BEGIN_SRC nix :tangle ../default.nix :tangle-mode (identity #o755) :-shebang "#!/usr/bin/env -S nix-build" { pkgs ? import {} }: with import ./nix/mkDub.nix { inherit pkgs; }; mkDubDerivation rec { diff --git a/shell.nix b/shell.nix index 17ccd5b..c2e52a6 100755 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,3 @@ -#!/usr/bin/env -S nix-shell { pkgs ? import {} }: pkgs.mkShell { buildInputs = with pkgs; [ @@ -7,6 +6,9 @@ pkgs.mkShell { buildPhase = "nix build -f default.nix"; shellHook = '' echo "built spine @ ./result/bin/spine" + if [[ -e ".envrc" ]]; then + source .envrc + fi #nix-instantiate | nix show-derivation | jq ''; } -- cgit v1.2.3