From bc5b1b8bb3d45d9c04ccc46bb8732f859e4b896c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 29 Aug 2021 19:04:09 -0400 Subject: config nix --- sundry/spine_search_cgi/.envrc-local_ | 18 ++++++++------- sundry/spine_search_cgi/flake.lock | 42 +++++++++++++++++++++++++++++++++++ sundry/spine_search_cgi/flake.nix | 22 ++++++++++++++++++ 3 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 sundry/spine_search_cgi/flake.lock create mode 100644 sundry/spine_search_cgi/flake.nix (limited to 'sundry/spine_search_cgi') diff --git a/sundry/spine_search_cgi/.envrc-local_ b/sundry/spine_search_cgi/.envrc-local_ index cff7bd4..17e48ee 100644 --- a/sundry/spine_search_cgi/.envrc-local_ +++ b/sundry/spine_search_cgi/.envrc-local_ @@ -10,6 +10,7 @@ export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1 export SpineSRC=/grotto-ra/repo/git.repo/projects/project-spine/doc-reform 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 #export SpineOUTversioned=/srv/www/spine/$SpineVER export SpineOUTstatic=/srv/www/spine/static export SpineCgiBIN=/var/www/cgi/cgi-bin @@ -60,6 +61,7 @@ echo "#+END_SRC SpineSRC=$SpineSRC SpineBIN=$SpineBIN SpineDOC=$SpineDOC +SpinePOD=$SpinePOD #SpineOUTversioned=$SpineOUTversioned SpineOUTstatic=$SpineOUTstatic SpineCgiBIN=$SpineCgiBIN @@ -77,26 +79,26 @@ nix-build && sudo cp -vi result/share/cgi-bin/spine_search $SpineCgiBIN/. *** configuration #+BEGIN_SRC sh -$SpineBIN/spine -v --show-config --config=$SpineDOC/markup/pod/.dr +$SpineBIN/spine -v --show-config --config=$SpinePOD/.dr #+END_SRC *** generate html (linked to search form & harvest) #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search"--output=$SpineOUTstatic $SpineDOC/markup/pod/* +$SpineBIN/spine -v --html --html-link-search --html-link-harvest --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search"--output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** generate sql output #+BEGIN_SRC sh -SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUTstatic $SpineDOC/markup/pod/* +SpineBIN/spine -v --sqlite-update --sqlite-db-filename="spine.search.db" --output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** generate harvest #+BEGIN_SRC sh -$SpineBIN/spine -v --harvest --output=$SpineOUTstatic $SpineDOC/markup/pod/* -$SpineBIN/spine -v --html --html-link-harvest --harvest --output=$SpineOUTstatic $SpineDOC/markup/pod/* +$SpineBIN/spine -v --harvest --output=$SpineOUTstatic $SpinePOD/* +$SpineBIN/spine -v --html --html-link-harvest --harvest --output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** create or re-create sql db (--sqlite-db-create or --sqlite-db-recreate) @@ -108,14 +110,14 @@ $SpineBIN/spine -v --sqlite-db-recreate --sqlite-db-filename="spine.search.db" - *** generate html (linked to search form), sql output, harvest #+BEGIN_SRC sh -$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-update --output=$SpineOUTstatic $SpineDOC/markup/pod/* +$SpineBIN/spine -v --html --html-link-search --html-link-harvest --harvest --sqlite-db-filename="spine.search.db" --cgi-sqlite-search-filename="spine_search" --sqlite-update --output=$SpineOUTstatic $SpinePOD/* #+END_SRC *** make search form #+BEGIN_SRC sh -$SpineBIN/spine -v --cgi-search-form-codegen --config=$SpineDOC/markup/pod/.dr/config_local_site -#$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUTstatic $SpineDOC/markup/pod/* +$SpineBIN/spine -v --cgi-search-form-codegen --config=$SpinePOD/.dr/config_local_site +#$SpineBIN/spine -v --cgi-search-form-codegen --output=$SpineOUTstatic $SpinePOD/* #+END_SRC ' >> nix_note_.org diff --git a/sundry/spine_search_cgi/flake.lock b/sundry/spine_search_cgi/flake.lock new file mode 100644 index 0000000..c7da1d0 --- /dev/null +++ b/sundry/spine_search_cgi/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1629481132, + "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "997f7efcb746a9c140ce1f13c72263189225f482", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1630527283, + "narHash": "sha256-DD8FDMxndAgGD/yUHuwQypvgcqKSCB+gdwo+mXhc28c=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "837d765221201227fa62bf7a77e94577e8dc00f7", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/sundry/spine_search_cgi/flake.nix b/sundry/spine_search_cgi/flake.nix new file mode 100644 index 0000000..fe54c94 --- /dev/null +++ b/sundry/spine_search_cgi/flake.nix @@ -0,0 +1,22 @@ +{ + description = "a sisu like document parser search form"; + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:nixos/nixpkgs"; + }; + outputs = { self, nixpkgs, flake-utils }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + packages.x86_64-linux.spine = pkgs.stdenv.mkDerivation { + name = "spine_search"; + inherit self; + src = self; + shell = ./shell.nix; + installPhase = '' + install -m755 -D spine_search $out/share/cgi-bin/spine_search + ''; + }; + defaultPackage.x86_64-linux = self.packages.x86_64-linux.spine; + }; +} -- cgit v1.2.3