aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/config_nix.org
diff options
context:
space:
mode:
Diffstat (limited to 'org/config_nix.org')
-rw-r--r--org/config_nix.org103
1 files changed, 57 insertions, 46 deletions
diff --git a/org/config_nix.org b/org/config_nix.org
index 7bd1645..86c61ee 100644
--- a/org/config_nix.org
+++ b/org/config_nix.org
@@ -148,9 +148,10 @@ fi
#+BEGIN_SRC nix
echo ".envrc called .envrc-local"
PATH_add result/bin
-export NIX_PATH=<<nix_path_channel>>
-#export NIX_PATH=<<nixpkgs_path_local>>
-export DFLAGS="-O2 -inline"
+export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos
+#export NIX_PATH=nixpkgs=/nixpkgs/nixpkgs
+#export NIX_PATH=/nixpkgs/nixpkgs
+export DFLAGS="-O2 -inline -boundscheck=on -color=on"
# reload when these files change
# watch_file flake.nix
# watch_file flake.lock
@@ -159,20 +160,22 @@ export DFLAGS="-O2 -inline"
# echo $NIX_BUILD_TOP
export Date=`date "+%Y%m%d"`
export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g')
-export SpinePROJ=<<project_path_local_project>>
-export SpineSRC=<<project_path_local_src>>
-export SpineBIN=<<project_path_local_bin>>
-export SpineDOC=<<project_path_local_doc>>
+export SpinePROJ=~/grotto/repo/git.repo/projects/project-spine/doc-reform
+export SpineSRC=$SpinePROJ/src
+export SpineBIN=$SpinePROJ/result/bin
+export SpineDOC=~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples
export SpinePOD=$SpineDOC/markup/pod
-export SpineOUTversioned=<<project_path_local_out>>
-export SpineOUT=<<project_path_local_out_static>>
-export SpineDBpath=<<project_path_sqlite>>
+export SpineOUTversioned=/srv/www/spine/$SpineVER
+export SpineOUT=/srv/www/spine
+export SpineDBpath=/var/www/sqlite
+#export SpineDBpath=/srv/www/spine/sqlite
export SpineSearchActionLocal='http://localhost/spine_search'
export SpineSearchActionRemote='https://sisudoc.org/spine_search'
export SpineCGIform='spine_search'
export SpineSQLdb='spine.search.db'
export PROG_VER_GIT="`git describe --long --tags | sed -e 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g'`"
export PROG_VER_DECLARED="`cat ./views/version.txt | grep --color=never "enum" | sed 's/.\+(\([0-9]\+\),[ \t]\+\([0-9]\+\),[ \t]\+\([0-9]\+\)[ \t]*).\+/\1.\2.\3/g'`"
+#direnv allow
#+END_SRC
**** .env/echo-nixNote CHECK MODIFY
@@ -491,12 +494,10 @@ postInstall:
#+HEADER: :noweb yes
#+BEGIN_SRC nix
{
- description = "A sisu like parser and document generator";
- inputs = {
- flake-utils.url = "github:numtide/flake-utils";
- nixpkgs.url = "github:nixos/nixpkgs";
- #nixpkgs.url = "/nixpkgs-ra/nixpkgs";
- };
+ description = "a sisu like parser and document generator";
+ inputs.flake-utils.url = "github:numtide/flake-utils";
+ inputs.nixpkgs.url = "github:nixos/nixpkgs";
+ #inputs.nixpkgs.url = "/nixpkgs-ra/nixpkgs";
outputs = { self, nixpkgs, flake-utils }: {
packages.x86_64-linux.spine =
let
@@ -507,7 +508,7 @@ postInstall:
in pkgs.stdenv.mkDerivation {
pname = "spine";
version = "<<spine_version_set>>";
- description = "A sisu like parser and document generator";
+ description = "a sisu like parser and document generator";
inherit self;
src = self;
shell = ./shell.nix;
@@ -518,9 +519,7 @@ postInstall:
for DC_ in dmd ldmd2 gdmd; do
echo "- check for D compiler $DC_"
DC=$(type -P $DC_ || echo "")
- if [ ! "$DC" == "" ]; then
- break
- fi
+ if [ ! "$DC" == "" ]; then break; fi
done
if [ "$DC" == "" ]; then
exit "Error: could not find D compiler"
@@ -543,6 +542,8 @@ postInstall:
runHook postInstall
'';
postInstall = ''
+ echo `ls -la $out/bin/spine`
+ echo ""
echo "nix build or nix develop? (suggestions):"
echo '- nix build'
echo ' nix build .#spine --print-build-logs'
@@ -654,24 +655,21 @@ src = fetchTarball {
#+HEADER: :tangle ../shell.nix
#+HEADER: :tangle-mode (identity #o755)
-#+HEADER: :shebang "#!/usr/bin/env -S nix-shell --pure"
+#+HEADER: :shebang "#!/usr/bin/env -S nix-shell --pure\n#!nix-shell -i bash"
#+HEADER: :noweb yes
#+BEGIN_SRC nix
-#!nix-shell -i bash
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
mkShell {
buildInputs = [
- ### nix_related
direnv
nixVersions.unstable #nixFlakes
nix-prefetch-git
validatePkgConfig
- nix-tree jq
+ nix-tree jq nix-output-monitor
git
ps
### d_build_related
- ## package manager
dub
## compiler
ldc
@@ -718,27 +716,40 @@ mkShell {
echo ""
echo "nix flake show:"
nix flake show
- echo ""
- echo "nix build or nix develop? (suggestions):"
- echo '- nix build'
- echo ' nix build .#spine --print-build-logs'
- echo ' nix build --print-build-logs'
- echo '- nix run'
- echo ' nix run .#spine --print-build-logs'
- echo ' nix run default.nix --print-build-logs'
- echo '- nix shell'
- echo ' nix shell --print-build-logs --command spine -v'
- echo '- nix develop'
- echo ' nix develop --build .#spine --print-build-logs'
- echo ' nix develop --build -f derivation.nix -I .envrc --print-build-logs'
- echo ' nix develop ; eval "$buildPhase"'
- echo ""
- echo 'spine -v'
- echo "examine"
- echo ' nix-instantiate | nix show-derivation | jq'
- echo ' nix-build . --no-out-link | xargs -o nix-tree'
- echo ' nix-tree --derivation .#spine'
- echo ""
+ echo "
+ nix flake update
+ nix flake metadata
+ nix flake check
+ nix flake show
+
+ nix build or nix develop? (suggestions):
+
+ - nix build
+ nix build .#default --print-build-logs
+ nix build --print-build-logs
+ nix build .#default --print-build-logs |& nom
+
+ - nix run
+ nix run .#spine --print-build-logs
+ nix run default.nix --print-build-logs
+
+ - nix shell
+ nix shell --print-build-logs --command spine -v
+
+ - nix develop
+ nix develop --build .#default --print-build-logs
+ nix develop --build -f derivation.nix -I .envrc --print-build-logs
+ nix develop ; eval \$buildPhase
+
+ nix-build |& nom
+
+ spine -v
+
+ nix-instantiate | nix show-derivation | jq
+ nix-build . --no-out-link | xargs -o nix-tree
+ nix-tree --derivation .#spine
+
+ "
#echo "ldc `${pkgs.ldc}/bin/ldc2 -v`"
'';
}