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 --- org/config_dub.org | 20 ++---- org/config_nix.org | 175 ++++++++++++++++++++++++++++------------------------- 2 files changed, 96 insertions(+), 99 deletions(-) (limited to 'org') 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/ -- cgit v1.2.3