From 934b830f804c1acae1e5f2f55207a1f428244f1f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 31 Jul 2022 15:44:56 -0400 Subject: org nix adjust --- sundry/spine_search_cgi/.envrc | 4 +- sundry/spine_search_cgi/.envrc-local_ | 119 ++-------------------------------- sundry/spine_search_cgi/shell.nix | 4 +- 3 files changed, 10 insertions(+), 117 deletions(-) (limited to 'sundry') diff --git a/sundry/spine_search_cgi/.envrc b/sundry/spine_search_cgi/.envrc index c0adda9..6d8376c 100644 --- a/sundry/spine_search_cgi/.envrc +++ b/sundry/spine_search_cgi/.envrc @@ -3,6 +3,6 @@ if ! has nix_direnv_version || ! nix_direnv_version 1.4.0; then # https://github.com/nix-community/nix-direnv source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/1.4.0/direnvrc" "sha256-4XfVDjv75eHMWN4G725VW7BoOV4Vl3vAabK4YXIfPyE=" fi -if [ -e .env/local ]; then - source_env_if_exists .env/local || source .env/local +if [ -f .envrc-local ]; then + source_env_if_exists .envrc-local || source .envrc-local fi diff --git a/sundry/spine_search_cgi/.envrc-local_ b/sundry/spine_search_cgi/.envrc-local_ index 440b597..92f4fea 100644 --- a/sundry/spine_search_cgi/.envrc-local_ +++ b/sundry/spine_search_cgi/.envrc-local_ @@ -7,7 +7,8 @@ export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos # eval "$(nix print-dev-env)" # echo $NIX_BUILD_TOP export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g') -export SpineSRC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform +export SpinePROJ=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform +export SpineSRC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform/src export SpineBIN=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform/result/bin export SpineDOC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples export SpinePOD=$SpineDOC/markup/pod @@ -15,116 +16,6 @@ export SpinePOD=$SpineDOC/markup/pod export SpineOUT=/srv/www/spine export SpineDBpath=/var/www/sqlite export SpineCgiBIN=/var/www/cgi/cgi-bin - -echo '-*- mode: org -*- - -* nixpkgs path? - - # eval "$(nix print-dev-env)" -' > nixNote_.org - -echo " == `nix-instantiate --find-file nixpkgs`" >> nixNote_.org - -echo ' -* nix build and show derivation - -#+BEGIN_SRC sh -nix-shell --pure - -nix-build -nix build -f default.nix -nix shell -f default.nix -nix-instantiate | nix-build -nix build `nix-instantiate` - -nix develop - -nix-instantiate | nix show-derivation | jq -nix-instantiate | nix show-derivation --recursive | jq - -nix search --json 2>/dev/null |jq -#+END_SRC - -* version and build info - -#+BEGIN_SRC sh' >> nixNote_.org - -echo 'spine version (git) == $SpineVER' >> nixNote_.org -echo "spine version (git) == $SpineVER" >> nixNote_.org -echo 'nix-instantiate == `nix-instantiate`' >> nixNote_.org -echo "nix-instantiate == `nix-instantiate`" >> nixNote_.org - -echo "#+END_SRC - -* initialised shell variables - -#+BEGIN_SRC sh -SpineSRC=$SpineSRC -SpineBIN=$SpineBIN -SpineDOC=$SpineDOC -SpinePOD=$SpinePOD -#SpineOUTversioned=$SpineOUTversioned -SpineOUT=$SpineOUT -SpineCgiBIN=$SpineCgiBIN -#+END_SRC -" >> nixNote_.org - -echo '* cgi form spine_search nix build and copy to spine-search - -#+BEGIN_SRC sh -nix-build && sudo cp -vi result/share/cgi-bin/spine_search $SpineCgiBIN/. -#+END_SRC - -* spine run instruction examples -** cgi operations (output to $SpineOUT) -*** configuration - -#+BEGIN_SRC sh -$SpineBIN/spine -v --show-config --config=$SpinePOD/.dr -#+END_SRC - -*** generate html (linked to search form & curate) - -#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search"--output=$SpineOUT $SpinePOD/* -#+END_SRC - -*** generate sql output - -#+BEGIN_SRC sh -SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --sqlite-db-path="$SpineDBpath" -#+END_SRC - -*** generate curate - -#+BEGIN_SRC sh -$SpineBIN/spine -v --curate --output=$SpineOUT $SpinePOD/* -$SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUT $SpinePOD/* -#+END_SRC - -*** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) - -#+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --sqlite-db-path="$SpineDBpath" -#+END_SRC - -*** generate html (linked to search form), sql output, curate - -#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-update --sqlite-db-path="$SpineDBpath" --output="$SpineOUT" $SpinePOD/* -#if names and paths are configured in resource configuration file, e.g. $SpinePOD/.rc/config_local_site -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update $SpinePOD/* -#+END_SRC - -*** make search form - -#+BEGIN_SRC sh -$SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local_site -#$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUT $SpinePOD/* -#+END_SRC -' >> nixNote_.org - -#cat nixNote_.org - -#echo "emacs nixNote_.org" -#echo "cat nixNote_.org" +if [ -e .env/echo-nixNote ]; then # source an additional user-specific .envrc in ./.envrc-local + source .env/echo-nixNote +fi diff --git a/sundry/spine_search_cgi/shell.nix b/sundry/spine_search_cgi/shell.nix index b45dcdd..64a4e02 100755 --- a/sundry/spine_search_cgi/shell.nix +++ b/sundry/spine_search_cgi/shell.nix @@ -4,11 +4,13 @@ with pkgs; mkShell { buildInputs = [ ### nix_related + direnv nixFlakes nix-prefetch-git validatePkgConfig jq git + #ps ### d_build_related ## package manager dub @@ -32,7 +34,7 @@ mkShell { starship ]; shellHook = '' - if [[ -e ".envrc" ]]; then + if [[ -f ".envrc" ]]; then source .envrc fi eval "$(starship init bash)" -- cgit v1.2.3