From 85a2a2922673bfe44461e26b68cb1da0de5bb8c7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 20 Sep 2021 20:02:10 -0400 Subject: nix related config, direnv else minor --- .envrc | 4 + .envrc-local_ | 52 +++---- default.nix | 16 +-- dub.json | 5 +- dub.selections.json | 5 - org/config_dub.org | 20 +-- org/config_nix.org | 175 +++++++++++++----------- shell.nix | 66 ++++----- sundry/spine_search_cgi/.envrc | 4 + sundry/spine_search_cgi/.envrc-local_ | 50 +++---- sundry/spine_search_cgi/dub.json | 5 +- sundry/spine_search_cgi/shell.nix | 16 ++- sundry/spine_search_cgi/views/configuration.txt | 2 +- views/configuration.txt | 6 +- 14 files changed, 213 insertions(+), 213 deletions(-) delete mode 100644 dub.selections.json diff --git a/.envrc b/.envrc index 6bb4547..03af170 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,8 @@ NIX_ENFORCE_PURITY=0 +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 .envrc-local ]; then # source an additional user-specific .envrc in ./.envrc-local source .envrc-local fi diff --git a/.envrc-local_ b/.envrc-local_ index 9c4a881..318d7a7 100644 --- a/.envrc-local_ +++ b/.envrc-local_ @@ -1,10 +1,10 @@ export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos #export NIX_PATH=/nixpkgs-ra/nixpkgs # reload when these files change -watch_file flake.nix +# watch_file flake.nix # watch_file flake.lock ## load the flake devShell -eval "$(nix print-dev-env)" +# 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 @@ -12,16 +12,16 @@ export SpineBIN=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform/resul export SpineDOC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples export SpinePOD=$SpineDOC/markup/pod export SpineOUTversioned=/srv/www/spine/$SpineVER -export SpineOUTstatic=/srv/www/spine/static +export SpineOUT=/srv/www/spine echo '-*- mode: org -*- * nixpkgs path? - eval "$(nix print-dev-env)" -' > nix_note_.org + # eval "$(nix print-dev-env)" +' > nixNote_.org -echo " == `nix-instantiate --find-file nixpkgs`" >> nix_note_.org +echo " == `nix-instantiate --find-file nixpkgs`" >> nixNote_.org echo ' * nix build and show derivation @@ -45,12 +45,12 @@ nix search --json 2>/dev/null |jq * version and build info -#+BEGIN_SRC sh' >> nix_note_.org +#+BEGIN_SRC sh' >> nixNote_.org -echo 'spine version (git) == $SpineVER' >> nix_note_.org -echo "spine version (git) == $SpineVER" >> nix_note_.org -echo 'nix-instantiate == `nix-instantiate`' >> nix_note_.org -echo "nix-instantiate == `nix-instantiate`" >> nix_note_.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 @@ -61,9 +61,9 @@ SpineSRC=$SpineSRC SpineDOC=$SpineDOC SpinePOD=$SpinePOD SpineOUTversioned=$SpineOUTversioned -SpineOUTstatic=$SpineOUTstatic +SpineOUT=$SpineOUT #+END_SRC -" >> nix_note_.org +" >> nixNote_.org echo '* spine run instruction examples ** parallelized tasks @@ -149,12 +149,12 @@ $SpineBIN/spine --show-config $SpinePOD $SpineBIN/spine --show-config --output="$SpineOUTversioned" $SpinePOD #+END_SRC -** cgi operations (output to $SpineOUTstatic /var/www) +** cgi operations (output to $SpineOUT /var/www) #+BEGIN_SRC sh -$SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUT" $SpinePOD/* -$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUT $SpinePOD/* $SpineBIN/spine -v --show-config --config=$SpinePOD/.dr @@ -167,26 +167,26 @@ $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local *** generate html linked to search form #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --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-create --sqlite-db-filename="spine.search.db" --output="$SpineOUTstatic" -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --output="$SpineOUTstatic" +$SpineBIN/spine -v --sqlite-db-create --sqlite-db-filename="spine.search.db" --output="$SpineOUT/" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --output="$SpineOUT/" #+END_SRC *** populate sqlite db #+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUT $SpinePOD/* #+END_SRC *** generate html (linked to search form), sql output, curate COMPOSITE #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --output="$SpineOUT" $SpinePOD/* #+END_SRC *** make search form @@ -198,12 +198,12 @@ $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local *** latex #+BEGIN_SRC sh -$SpineBIN/spine --latex --serial --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine --latex --serial --output="$SpineOUT" $SpinePOD/* ls $SpineOutstatic/latex/*.tex #+END_SRC -' >> nix_note_.org +' >> nixNote_.org -cat nix_note_.org +#cat nixNote_.org -echo "emacs nix_note_.org" -echo "cat nix_note_.org" +#echo "emacs nixNote_.org" +#echo "cat nixNote_.org" diff --git a/default.nix b/default.nix index 5cc3592..8ecf67a 100755 --- a/default.nix +++ b/default.nix @@ -83,16 +83,12 @@ mkDubDerivation rec { name = "spine-${version}"; version = "0.11.3"; src = ./.; - buildInputs = [ - pkgs.sqlite ( - with pkgs; [ - nixFlakes - rund - dub - ldc - sqlite - ] - ) + buildInputs = with pkgs; [ + nixFlakes + rund + dub + ldc + sqlite ]; # buildPhase = [ ]; installPhase = '' diff --git a/dub.json b/dub.json index dd817a5..b632c39 100644 --- a/dub.json +++ b/dub.json @@ -95,8 +95,5 @@ "name": "dmd", "targetName": "spine-dmd" } - ], - "subConfigurations": { - "d2sqlite3": "with-lib" - } + ] } diff --git a/dub.selections.json b/dub.selections.json deleted file mode 100644 index 322586b..0000000 --- a/dub.selections.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "fileVersion": 1, - "versions": { - } -} diff --git a/org/config_dub.org b/org/config_dub.org index 406fa51..bb0091f 100644 --- a/org/config_dub.org +++ b/org/config_dub.org @@ -142,10 +142,7 @@ "name": "dmd", "targetName": "spine-dmd" } - ], - "subConfigurations": { - "d2sqlite3": "with-lib" - } + ] } #+END_SRC @@ -257,10 +254,7 @@ "name": "dmd", "targetName": "spine-dmd" } - ], - "subConfigurations": { - "d2sqlite3": "with-lib" - } + ] } #+END_SRC @@ -314,10 +308,7 @@ "name": "dmd", "targetName": "spine-dmd" } - ], - "subConfigurations": { - "d2sqlite3": "with-lib" - } + ] } #+END_SRC @@ -621,10 +612,7 @@ configuration "build" { "name": "dmd", "targetName": "spine-search-dmd.cgi" } - ], - "subConfigurations": { - "d2sqlite3": "with-lib" - } + ] } #+END_SRC diff --git a/org/config_nix.org b/org/config_nix.org index 35feaef..ab01b55 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -74,6 +74,10 @@ nix show-derivation /nix/store/q7n14bm8j5vzm62qaraczdb4bpyf59vv-spine-0.11.1.drv #+HEADER: :tangle ../.envrc #+BEGIN_SRC sh NIX_ENFORCE_PURITY=0 +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 .envrc-local ]; then # source an additional user-specific .envrc in ./.envrc-local source .envrc-local fi @@ -85,7 +89,7 @@ fi #+BEGIN_SRC sh if type lorri &>/dev/null; then echo "direnv: using lorri from PATH ($(type -p lorri))" - eval "$(lorri direnv)" + # eval "$(lorri direnv)" else # fallback prevent bootstrapping problems by using direnv's builtin nix support use nix NIX_ENFORCE_PURITY=0 @@ -137,10 +141,10 @@ fi export NIX_PATH=<> #export NIX_PATH=<> # reload when these files change -watch_file flake.nix +# watch_file flake.nix # watch_file flake.lock ## load the flake devShell -eval "$(nix print-dev-env)" +# 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=<> @@ -148,16 +152,16 @@ export SpineBIN=<> export SpineDOC=<> export SpinePOD=$SpineDOC/markup/pod export SpineOUTversioned=<> -export SpineOUTstatic=<> +export SpineOUT=<> echo '-*- mode: org -*- ,* nixpkgs path? - eval "$(nix print-dev-env)" -' > nix_note_.org + # eval "$(nix print-dev-env)" +' > nixNote_.org -echo " == `nix-instantiate --find-file nixpkgs`" >> nix_note_.org +echo " == `nix-instantiate --find-file nixpkgs`" >> nixNote_.org echo ' ,* nix build and show derivation @@ -181,12 +185,12 @@ nix search --json 2>/dev/null |jq ,* version and build info -,#+BEGIN_SRC sh' >> nix_note_.org +,#+BEGIN_SRC sh' >> nixNote_.org -echo 'spine version (git) == $SpineVER' >> nix_note_.org -echo "spine version (git) == $SpineVER" >> nix_note_.org -echo 'nix-instantiate == `nix-instantiate`' >> nix_note_.org -echo "nix-instantiate == `nix-instantiate`" >> nix_note_.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 @@ -197,9 +201,9 @@ SpineSRC=$SpineSRC SpineDOC=$SpineDOC SpinePOD=$SpinePOD SpineOUTversioned=$SpineOUTversioned -SpineOUTstatic=$SpineOUTstatic +SpineOUT=$SpineOUT ,#+END_SRC -" >> nix_note_.org +" >> nixNote_.org echo '* spine run instruction examples ,** parallelized tasks @@ -285,12 +289,12 @@ $SpineBIN/spine --show-config $SpinePOD $SpineBIN/spine --show-config --output="$SpineOUTversioned" $SpinePOD ,#+END_SRC -,** cgi operations (output to $SpineOUTstatic /var/www) +,** cgi operations (output to $SpineOUT /var/www) ,#+BEGIN_SRC sh -$SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine --very-verbose --sqlite-db-create --output="$SpineOUT" $SpinePOD/* -$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUT $SpinePOD/* $SpineBIN/spine -v --show-config --config=$SpinePOD/.dr @@ -303,26 +307,26 @@ $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local ,*** generate html linked to search form ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --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-create --sqlite-db-filename="<>" --output="$SpineOUTstatic" -$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --output="$SpineOUTstatic" +$SpineBIN/spine -v --sqlite-db-create --sqlite-db-filename="<>" --output="$SpineOUT/" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --output="$SpineOUT/" ,#+END_SRC ,*** populate sqlite db ,#+BEGIN_SRC sh -$SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --output=$SpineOUT $SpinePOD/* ,#+END_SRC ,*** generate html (linked to search form), sql output, curate COMPOSITE ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --output="$SpineOUT" $SpinePOD/* ,#+END_SRC ,*** make search form @@ -334,15 +338,15 @@ $SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local ,*** latex ,#+BEGIN_SRC sh -$SpineBIN/spine --latex --serial --output="$SpineOUTstatic" $SpinePOD/* +$SpineBIN/spine --latex --serial --output="$SpineOUT" $SpinePOD/* ls $SpineOutstatic/latex/*.tex ,#+END_SRC -' >> nix_note_.org +' >> nixNote_.org -cat nix_note_.org +#cat nixNote_.org -echo "emacs nix_note_.org" -echo "cat nix_note_.org" +#echo "emacs nixNote_.org" +#echo "cat nixNote_.org" #+END_SRC *** flake :flake: @@ -505,19 +509,19 @@ nix flake update #+BEGIN_SRC nix { pkgs ? import {} }: pkgs.mkShell { - buildInputs = with pkgs; [( - with pkgs; [ - <> - <> - # <> - # <> - # <> - ] - )]; + buildInputs = with pkgs; [ + <> + <> + <> + # <> + # <> + # <> + ]; shellHook = '' if [[ -e ".envrc" ]]; then source .envrc fi + eval "$(starship init bash)" ''; } #+END_SRC @@ -546,11 +550,20 @@ ldc #meson #+END_SRC +***** packages candy + +#+NAME: shell_packages_candy +#+BEGIN_SRC nix +# candy +starship +#+END_SRC + ***** packages search sqlite related -#+NAME: shell_packages_search_sqlite_related +#+NAME: shell_packages_search_related_sqlite #+BEGIN_SRC nix # search_sqlite_related +# search related sqlite #+END_SRC @@ -712,16 +725,12 @@ mkDubDerivation rec { name = "spine-${version}"; version = "<>"; src = ./.; - buildInputs = [ - pkgs.sqlite ( - with pkgs; [ - nixFlakes - rund - dub - ldc - sqlite - ] - ) + buildInputs = with pkgs; [ + nixFlakes + rund + dub + ldc + sqlite ]; # buildPhase = [ ]; installPhase = '' @@ -859,6 +868,10 @@ git #+HEADER: :tangle "../sundry/spine_search_cgi/.envrc" #+BEGIN_SRC sh NIX_ENFORCE_PURITY=0 +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 .envrc-local ]; then # source an additional user-specific .envrc in ./.envrc-local source .envrc-local fi @@ -871,10 +884,10 @@ fi export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos #export NIX_PATH=nixpkgs=/nixpkgs-ra/nixpkgs # reload when these files change -watch_file flake.nix +# watch_file flake.nix # watch_file flake.lock ## load the flake devShell -eval "$(nix print-dev-env)" +# 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=<> @@ -882,17 +895,17 @@ export SpineBIN=<> export SpineDOC=<> export SpinePOD=$SpineDOC/markup/pod #export SpineOUTversioned=<> -export SpineOUTstatic=<> +export SpineOUT=<> export SpineCgiBIN=<> echo '-*- mode: org -*- ,* nixpkgs path? - eval "$(nix print-dev-env)" -' > nix_note_.org + # eval "$(nix print-dev-env)" +' > nixNote_.org -echo " == `nix-instantiate --find-file nixpkgs`" >> nix_note_.org +echo " == `nix-instantiate --find-file nixpkgs`" >> nixNote_.org echo ' ,* nix build and show derivation @@ -916,12 +929,12 @@ nix search --json 2>/dev/null |jq ,* version and build info -,#+BEGIN_SRC sh' >> nix_note_.org +,#+BEGIN_SRC sh' >> nixNote_.org -echo 'spine version (git) == $SpineVER' >> nix_note_.org -echo "spine version (git) == $SpineVER" >> nix_note_.org -echo 'nix-instantiate == `nix-instantiate`' >> nix_note_.org -echo "nix-instantiate == `nix-instantiate`" >> nix_note_.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 @@ -933,10 +946,10 @@ SpineBIN=$SpineBIN SpineDOC=$SpineDOC SpinePOD=$SpinePOD #SpineOUTversioned=$SpineOUTversioned -SpineOUTstatic=$SpineOUTstatic +SpineOUT=$SpineOUT SpineCgiBIN=$SpineCgiBIN ,#+END_SRC -" >> nix_note_.org +" >> nixNote_.org echo '* cgi form spine_search nix build and copy to spine-search @@ -945,7 +958,7 @@ nix-build && sudo cp -vi result/share/cgi-bin/spine_search $SpineCgiBIN/. ,#+END_SRC ,* spine run instruction examples -,** cgi operations (output to $SpineOUTstatic) +,** cgi operations (output to $SpineOUT) ,*** configuration ,#+BEGIN_SRC sh @@ -955,46 +968,46 @@ $SpineBIN/spine -v --show-config --config=$SpinePOD/.dr ,*** generate html (linked to search form & curate) ,#+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>"--output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>"--output=$SpineOUT $SpinePOD/* ,#+END_SRC ,*** generate sql output ,#+BEGIN_SRC sh -SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --output=$SpineOUTstatic $SpinePOD/* +SpineBIN/spine -v --sqlite-update --sqlite-db-filename="<>" --output=$SpineOUT $SpinePOD/* ,#+END_SRC ,*** generate curate ,#+BEGIN_SRC sh -$SpineBIN/spine -v --curate --output=$SpineOUTstatic $SpinePOD/* -$SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* +$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="<>" --output="$SpineOUTstatic" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="<>" --output="$SpineOUT" ,#+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="<>" --cgi-sqlite-search-filename="<>" --sqlite-update --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-search --html-link-curate --curate --sqlite-db-filename="<>" --cgi-sqlite-search-filename="<>" --sqlite-update --output=$SpineOUT $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=$SpineOUTstatic $SpinePOD/* +#$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUT $SpinePOD/* ,#+END_SRC -' >> nix_note_.org +' >> nixNote_.org -cat nix_note_.org +#cat nixNote_.org -echo "emacs nix_note_.org" -echo "cat nix_note_.org" +#echo "emacs nixNote_.org" +#echo "cat nixNote_.org" #+END_SRC *** flake :flake: @@ -1041,21 +1054,17 @@ nix flake update pkgs.mkShell { buildInputs = with pkgs; [( with pkgs; [ - nixFlakes - rund - dub - ldc - sqlite - nix-prefetch-git - validatePkgConfig - jq - git + <> + <> + <> + <> ] )]; shellHook = '' if [[ -e ".envrc" ]]; then source .envrc fi + eval "$(starship init bash)" ''; } #+END_SRC @@ -1255,7 +1264,7 @@ nixpkgs=<> #+NAME: project_path_local_out_static #+BEGIN_SRC nix -/srv/www/spine/static +/srv/www/spine #+END_SRC #+NAME: project_path_local_out_static_ @@ -1334,7 +1343,7 @@ pkgs.mkShell { nix-shell --run 'which xetex' echo 'for texfile in *.tex; do echo "* --> " ~ $texfile && xelatex -interaction=batchmode $texfile; rm *.aux *.log *.toc *.out; done' -$SpineBIN/spine --latex --serial --output="$SpineOUTstatic" $SpinePOD/* && for texfile in $SpineOUTstatic/latex/*.tex; do xelatex -interaction=nonstopmode $texfile; done 2>&1 | tee _err.xelatex_.org; ls $SpineOUTstatic/latex/*.{tex,pdf} +$SpineBIN/spine --latex --serial --output="$SpineOUT" $SpinePOD/* && for texfile in $SpineOUT/latex/*.tex; do xelatex -interaction=nonstopmode $texfile; done 2>&1 | tee _err.xelatex_.org; ls $SpineOUT/latex/*.{tex,pdf} /run/current-system/sw/share/X11/fonts/ diff --git a/shell.nix b/shell.nix index ce4ced7..48b87d1 100755 --- a/shell.nix +++ b/shell.nix @@ -1,41 +1,43 @@ #!/usr/bin/env -S nix-shell --pure { pkgs ? import {} }: pkgs.mkShell { - buildInputs = with pkgs; [( - with pkgs; [ - # nix_related - nixFlakes - nix-prefetch-git - validatePkgConfig - jq - git - # d_build_related - rund - dub - ldc - #meson - # # search_sqlite_related - # sqlite - # # pdf_latex_related - # source-sans-pro - # source-serif-pro - # source-code-pro - # texlive.combined.scheme-full - # # xml_and_epub_related - # libxml2 - # html-tidy - # xmlstarlet - # epubcheck - # ebook_tools - # epr - # sigil - # calibre # (ebook-viewer) - # foliate - ] - )]; + buildInputs = with pkgs; [ + # nix_related + nixFlakes + nix-prefetch-git + validatePkgConfig + jq + git + # d_build_related + rund + dub + ldc + #meson + # candy + starship + # # search_sqlite_related + # # search related + # sqlite + # # pdf_latex_related + # source-sans-pro + # source-serif-pro + # source-code-pro + # texlive.combined.scheme-full + # # xml_and_epub_related + # libxml2 + # html-tidy + # xmlstarlet + # epubcheck + # ebook_tools + # epr + # sigil + # calibre # (ebook-viewer) + # foliate + ]; shellHook = '' if [[ -e ".envrc" ]]; then source .envrc fi + eval "$(starship init bash)" ''; } diff --git a/sundry/spine_search_cgi/.envrc b/sundry/spine_search_cgi/.envrc index 6bb4547..03af170 100644 --- a/sundry/spine_search_cgi/.envrc +++ b/sundry/spine_search_cgi/.envrc @@ -1,4 +1,8 @@ NIX_ENFORCE_PURITY=0 +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 .envrc-local ]; then # source an additional user-specific .envrc in ./.envrc-local source .envrc-local fi diff --git a/sundry/spine_search_cgi/.envrc-local_ b/sundry/spine_search_cgi/.envrc-local_ index d14a371..e79a418 100644 --- a/sundry/spine_search_cgi/.envrc-local_ +++ b/sundry/spine_search_cgi/.envrc-local_ @@ -1,10 +1,10 @@ export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos #export NIX_PATH=nixpkgs=/nixpkgs-ra/nixpkgs # reload when these files change -watch_file flake.nix +# watch_file flake.nix # watch_file flake.lock ## load the flake devShell -eval "$(nix print-dev-env)" +# 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 @@ -12,17 +12,17 @@ export SpineBIN=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform/resul export SpineDOC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples export SpinePOD=$SpineDOC/markup/pod #export SpineOUTversioned=/srv/www/spine/$SpineVER -export SpineOUTstatic=/srv/www/spine/static +export SpineOUT=/srv/www/spine export SpineCgiBIN=/var/www/cgi/cgi-bin echo '-*- mode: org -*- * nixpkgs path? - eval "$(nix print-dev-env)" -' > nix_note_.org + # eval "$(nix print-dev-env)" +' > nixNote_.org -echo " == `nix-instantiate --find-file nixpkgs`" >> nix_note_.org +echo " == `nix-instantiate --find-file nixpkgs`" >> nixNote_.org echo ' * nix build and show derivation @@ -46,12 +46,12 @@ nix search --json 2>/dev/null |jq * version and build info -#+BEGIN_SRC sh' >> nix_note_.org +#+BEGIN_SRC sh' >> nixNote_.org -echo 'spine version (git) == $SpineVER' >> nix_note_.org -echo "spine version (git) == $SpineVER" >> nix_note_.org -echo 'nix-instantiate == `nix-instantiate`' >> nix_note_.org -echo "nix-instantiate == `nix-instantiate`" >> nix_note_.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 @@ -63,10 +63,10 @@ SpineBIN=$SpineBIN SpineDOC=$SpineDOC SpinePOD=$SpinePOD #SpineOUTversioned=$SpineOUTversioned -SpineOUTstatic=$SpineOUTstatic +SpineOUT=$SpineOUT SpineCgiBIN=$SpineCgiBIN #+END_SRC -" >> nix_note_.org +" >> nixNote_.org echo '* cgi form spine_search nix build and copy to spine-search @@ -75,7 +75,7 @@ nix-build && sudo cp -vi result/share/cgi-bin/spine_search $SpineCgiBIN/. #+END_SRC * spine run instruction examples -** cgi operations (output to $SpineOUTstatic) +** cgi operations (output to $SpineOUT) *** configuration #+BEGIN_SRC sh @@ -85,43 +85,43 @@ $SpineBIN/spine -v --show-config --config=$SpinePOD/.dr *** 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=$SpineOUTstatic $SpinePOD/* +$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" --output=$SpineOUTstatic $SpinePOD/* +SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUT $SpinePOD/* #+END_SRC *** generate curate #+BEGIN_SRC sh -$SpineBIN/spine -v --curate --output=$SpineOUTstatic $SpinePOD/* -$SpineBIN/spine -v --html --html-link-curate --curate --output=$SpineOUTstatic $SpinePOD/* +$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" --output="$SpineOUTstatic" +$SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" --output="$SpineOUT" #+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 --output=$SpineOUTstatic $SpinePOD/* +$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 --output=$SpineOUT $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=$SpineOUTstatic $SpinePOD/* +#$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUT $SpinePOD/* #+END_SRC -' >> nix_note_.org +' >> nixNote_.org -cat nix_note_.org +#cat nixNote_.org -echo "emacs nix_note_.org" -echo "cat nix_note_.org" +#echo "emacs nixNote_.org" +#echo "cat nixNote_.org" diff --git a/sundry/spine_search_cgi/dub.json b/sundry/spine_search_cgi/dub.json index 1668969..12e77e5 100644 --- a/sundry/spine_search_cgi/dub.json +++ b/sundry/spine_search_cgi/dub.json @@ -81,8 +81,5 @@ "name": "dmd", "targetName": "spine-search-dmd.cgi" } - ], - "subConfigurations": { - "d2sqlite3": "with-lib" - } + ] } diff --git a/sundry/spine_search_cgi/shell.nix b/sundry/spine_search_cgi/shell.nix index 7f37eee..5926e62 100755 --- a/sundry/spine_search_cgi/shell.nix +++ b/sundry/spine_search_cgi/shell.nix @@ -3,20 +3,28 @@ pkgs.mkShell { buildInputs = with pkgs; [( with pkgs; [ + # nix_related nixFlakes - rund - dub - ldc - sqlite nix-prefetch-git validatePkgConfig jq git + # d_build_related + rund + dub + ldc + #meson + # search_sqlite_related + # search related + sqlite + # candy + starship ] )]; shellHook = '' if [[ -e ".envrc" ]]; then source .envrc fi + eval "$(starship init bash)" ''; } diff --git a/sundry/spine_search_cgi/views/configuration.txt b/sundry/spine_search_cgi/views/configuration.txt index 1486315..e810d68 100644 --- a/sundry/spine_search_cgi/views/configuration.txt +++ b/sundry/spine_search_cgi/views/configuration.txt @@ -3,7 +3,7 @@ struct Cfg { string http_host = "localhost"; string www_url_doc_root = "http://localhost"; string www_doc_root = "/srv/www/spine/static"; - string cgi_bin_subpath = "/cgi-bin"; + string cgi_bin_subpath = ""; string cgi_filename = "spine_search"; // "spine-search" string cgi_search_form_title = "≅ SiSU Spine search"; string db_sqlite_path = "/var/www/sqlite"; diff --git a/views/configuration.txt b/views/configuration.txt index f7e2f5f..2a98b07 100644 --- a/views/configuration.txt +++ b/views/configuration.txt @@ -5,12 +5,12 @@ struct Cfg { string www_doc_root = "/srv/www/spine/static"; string www_host_doc_root = "localhost"; string cgi_bin_root = "/var/www/cgi/cgi-bin"; - string cgi_bin_subpath = "/cgi-bin"; + string cgi_bin_subpath = ""; string cgi_filename = "spine_search"; - string cgi_url_root = "http://localhost/cgi-bin"; + string cgi_url_root = "http://localhost/"; string cgi_port = ""; string cgi_user = ""; - string cgi_url_action = "http://localhost/cgi-bin/spine_search"; + string cgi_url_action = "http://localhost/spine_search"; string cgi_search_form_title = "≅ SiSU Spine search"; string db_sqlite_path = "/var/www/sqlite"; string db_sqlite_filename = "spine.search.db"; -- cgit v1.2.3