aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2023-01-24 12:33:53 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2023-01-26 08:29:03 -0500
commitf0dbee6a6204dc92b2418723393aa3cb298245af (patch)
tree59040609ec5d089a410498972900cf546950bff5
parent2023, year rollover, old habit (diff)
nix & build housekeeping, alternative D compilers
-rw-r--r--.envrc24
-rw-r--r--.envrc-local_11
-rw-r--r--flake.lock13
-rw-r--r--flake.nix3
-rw-r--r--makefile16
-rw-r--r--org/config_make.org16
-rw-r--r--org/config_nix.org92
7 files changed, 92 insertions, 83 deletions
diff --git a/.envrc b/.envrc
index 82f6ad1..05a7c3f 100644
--- a/.envrc
+++ b/.envrc
@@ -1,5 +1,5 @@
-# nix_direnv_watch_file provided-filename
use flake .
+#use flake .#default
NIX_ENFORCE_PURITY=1
NixDirEnvVersion="2.2.0"
if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
@@ -7,6 +7,28 @@ if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
# source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-0000000000000000000000000000000000000000000="
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc="
fi
+watch_file flake.lock
+watch_file flake.nix
+nix flake update && nix flake check --show-trace && nix flake show
if [ -f .envrc-local ]; then
source_env_if_exists .envrc-local || source .envrc-local
fi
+echo "
+
+- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
+
+- nix build .#default --print-build-logs
+- nix build .#spine-dmd --print-build-logs
+- nix build .#spine-ldc --print-build-logs
+- nix build .#spine-gdc --print-build-logs
+
+nix-shell '<nixpkgs>' -A nix --pure
+
+nix run .#default --print-build-logs
+
+nix develop --build .#default --print-build-logs
+
+nix shell .#default --print-build-logs --command spine -v
+nix shell .#default --print-build-logs --command spine --very-verbose --epub --html --html-link-search --html-link-curate --curate --output=\"\$SpineOUT\" ./markup/pod
+nix shell .#default --print-build-logs --command spine --very-verbose --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename=\"spine.search.db\" --cgi-sqlite-search-filename=\"spine_search\" --sqlite-db-path=\"\$SpineDBpath\" --output=\"\$SpineOUT\" ./markup/pod
+"
diff --git a/.envrc-local_ b/.envrc-local_
index af41175..4a9aa66 100644
--- a/.envrc-local_
+++ b/.envrc-local_
@@ -1,8 +1,3 @@
-# reload when these files change
-watch_file flake.lock
-#watch_file flake.nix
-nix flake update; nix flake check; nix flake show
-#use flake .#default
PATH_add result/bin
#path_add PATH result/bin
#export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos
@@ -26,9 +21,3 @@ export SpineCGIform='spine_search'
export SpineSQLdb='spine.search.db'
#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
-echo "
-nix build -v .#default --print-build-logs
-nix run .#default --print-build-logs
-nix shell .#default --print-build-logs --command spine -v
-nix develop --build .#default --print-build-logs
-"
diff --git a/flake.lock b/flake.lock
index 5490336..1abb1d3 100644
--- a/flake.lock
+++ b/flake.lock
@@ -32,11 +32,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1672756850,
- "narHash": "sha256-Smbq3+fitwA13qsTMeaaurv09/KVbZfW7m7lINwzDGA=",
+ "lastModified": 1674487464,
+ "narHash": "sha256-Jgq50e4S4JVCYpWLqrabBzDp/1mfaxHCh8/OOorHTy0=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "298add347c2bbce14020fcb54051f517c391196b",
+ "rev": "3954218cf613eba8e0dcefa9abe337d26bc48fd0",
"type": "github"
},
"original": {
@@ -61,8 +61,11 @@
]
},
"locked": {
- "lastModified": 1672602471,
- "narHash": "sha256-91+g1dVEskCBZg1M+rhESGp6OgRLN4DYqoosKlqiPoE=",
+ "lastModified": 1674658431,
+ "narHash": "sha256-nLZ8zbv+YCxupB67bZvjZlbFL92Fbtj0qCt4T+jdEdA=",
+ "ref": "refs/heads/main",
+ "rev": "d15d729ee55a77effcf75c3730ad3648275e880d",
+ "revCount": 571,
"type": "git",
"url": "file:///home/ralph/grotto/repo/git.repo/projects/doc-reform/code/software/spine"
},
diff --git a/flake.nix b/flake.nix
index 0eedba1..0a02c3c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,6 +18,9 @@
let pkgs = nixpkgsFor.${system};
in {
default = spine.packages.${system}.default;
+ spine-dmd = spine.packages.${system}.spine-dmd;
+ spine-ldc = spine.packages.${system}.spine-ldc;
+ spine-gdc = spine.packages.${system}.spine-gdc;
#vendorSha256 = "sha256-0Q00000000000000000000000000000000000000000=";
});
devShells = forAllSystems (system:
diff --git a/makefile b/makefile
index 70e6929..0071c03 100644
--- a/makefile
+++ b/makefile
@@ -41,6 +41,22 @@ deps := "`ls -gx './src/ext_depends'`"
dirs_loc := "`ls -gx '.'`"
#dirs := "`ls -gx ${gwd}`"
+nix-devshell:
+ echo -ne "\n- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell\n\n- nix build .#default --print-build-logs\n- nix build .#spine-dmd --print-build-logs\n- nix build .#spine-ldc --print-build-logs\n- nix build .#spine-gdc --print-build-logs\n\n"; \
+ nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
+
+nix-build-default:
+ nix build .#default --print-build-logs
+
+nix-build-dmd:
+ nix build .#spine-dmd --print-build-logs
+
+nix-build-ldc:
+ nix build .#spine-ldc --print-build-logs
+
+nix-build-gdc:
+ nix build .#spine-gdc --print-build-logs
+
commands:
rg --color=always -B1 "^[a-z]\w+:" makefile | less
diff --git a/org/config_make.org b/org/config_make.org
index 2a7f5bd..ae41c51 100644
--- a/org/config_make.org
+++ b/org/config_make.org
@@ -62,6 +62,22 @@ deps := "`ls -gx './src/ext_depends'`"
dirs_loc := "`ls -gx '.'`"
#dirs := "`ls -gx ${gwd}`"
+nix-devshell:
+ echo -ne "\n- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell\n\n- nix build .#default --print-build-logs\n- nix build .#spine-dmd --print-build-logs\n- nix build .#spine-ldc --print-build-logs\n- nix build .#spine-gdc --print-build-logs\n\n"; \
+ nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
+
+nix-build-default:
+ nix build .#default --print-build-logs
+
+nix-build-dmd:
+ nix build .#spine-dmd --print-build-logs
+
+nix-build-ldc:
+ nix build .#spine-ldc --print-build-logs
+
+nix-build-gdc:
+ nix build .#spine-gdc --print-build-logs
+
commands:
rg --color=always -B1 "^[a-z]\w+:" makefile | less
diff --git a/org/config_nix.org b/org/config_nix.org
index 54fc862..937a7f2 100644
--- a/org/config_nix.org
+++ b/org/config_nix.org
@@ -35,8 +35,8 @@
#+HEADER: :tangle ../.envrc
#+BEGIN_SRC sh
-# nix_direnv_watch_file provided-filename
use flake .
+#use flake .#default
NIX_ENFORCE_PURITY=1
NixDirEnvVersion="2.2.0"
if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
@@ -44,9 +44,31 @@ if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
# source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-0000000000000000000000000000000000000000000="
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc="
fi
+watch_file flake.lock
+watch_file flake.nix
+nix flake update && nix flake check --show-trace && nix flake show
if [ -f .envrc-local ]; then
source_env_if_exists .envrc-local || source .envrc-local
fi
+echo "
+
+- nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell
+
+- nix build .#default --print-build-logs
+- nix build .#spine-dmd --print-build-logs
+- nix build .#spine-ldc --print-build-logs
+- nix build .#spine-gdc --print-build-logs
+
+nix-shell '<nixpkgs>' -A nix --pure
+
+nix run .#default --print-build-logs
+
+nix develop --build .#default --print-build-logs
+
+nix shell .#default --print-build-logs --command spine -v
+nix shell .#default --print-build-logs --command spine --very-verbose --epub --html --html-link-search --html-link-curate --curate --output=\"\$SpineOUT\" ./markup/pod
+nix shell .#default --print-build-logs --command spine --very-verbose --html --html-link-search --html-link-curate --curate --sqlite-update --sqlite-db-filename=\"spine.search.db\" --cgi-sqlite-search-filename=\"spine_search\" --sqlite-db-path=\"\$SpineDBpath\" --output=\"\$SpineOUT\" ./markup/pod
+"
#+END_SRC
**** .envrc-local CHECK MODIFY
@@ -56,11 +78,6 @@ fi
#+HEADER: :tangle ../.envrc-local_
#+HEADER: :noweb yes
#+BEGIN_SRC sh
-# reload when these files change
-watch_file flake.lock
-#watch_file flake.nix
-nix flake update; nix flake check; nix flake show
-#use flake .#default
PATH_add result/bin
#path_add PATH result/bin
#export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos
@@ -84,12 +101,6 @@ export SpineCGIform='spine_search'
export SpineSQLdb='spine.search.db'
#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
-echo "
-nix build -v .#default --print-build-logs
-nix run .#default --print-build-logs
-nix shell .#default --print-build-logs --command spine -v
-nix develop --build .#default --print-build-logs
-"
#+END_SRC
*** flake :flake:
@@ -119,6 +130,9 @@ nix develop --build .#default --print-build-logs
let pkgs = nixpkgsFor.${system};
in {
default = spine.packages.${system}.default;
+ spine-dmd = spine.packages.${system}.spine-dmd;
+ spine-ldc = spine.packages.${system}.spine-ldc;
+ spine-gdc = spine.packages.${system}.spine-gdc;
#vendorSha256 = "sha256-0Q00000000000000000000000000000000000000000=";
});
devShells = forAllSystems (system:
@@ -130,60 +144,6 @@ nix develop --build .#default --print-build-logs
}
#+END_SRC
-***** flake single system
-
-#+HEADER: :tangle-NO ../flake-1_.nix
-#+BEGIN_SRC nix
-{
- inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- inputs.flake-utils.url = "github:numtide/flake-utils";
- inputs.spine.url = "git+file:///home/ralph/grotto/repo/git.repo/projects/doc-reform/code/software/spine";
- outputs = { nixpkgs, flake-utils, ... }:
- flake-utils.lib.eachDefaultSystem (system:
- let pkgs = import nixpkgs { inherit system; };
- in with pkgs; {
- devShell = mkShell { buildInputs = [ git dub dmd ldc sqlite ]; };
- default = spine.packages.x86_64-linux.default;
- });
-}
-#+END_SRC
-
-#+HEADER: :tangle-NO ../flake-2_.nix
-#+HEADER: :noweb yes
-#+BEGIN_SRC nix
-{
- inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- inputs.flake-utils.url = "github:numtide/flake-utils";
- inputs.spine.url = "git+file:///home/ralph/grotto/repo/git.repo/projects/doc-reform/code/software/spine";
- outputs = { nixpkgs, flake-utils, ... }:
- flake-utils.lib.eachDefaultSystem (system:
- with import nixpkgs { inherit system; }; {
- devShell = mkShell { buildInputs = [ git dub dmd ldc sqlite ]; };
- default = spine.packages.x86_64-linux.default;
- });
-}
-#+END_SRC
-
-#+HEADER: :tangle-NO ../flake-3_.nix
-#+HEADER: :noweb yes
-#+BEGIN_SRC nix
-{
- description = "a sisu like parser & document generator";
- #version = "<<spine_version_set>>";
- inputs.nixpkgs.url = "<<nixpkgs_url>>";
- inputs.spine.url = "<<spine_git_file_path_url>>";
- inputs.spine.flake = true;
- inputs.spine-tarball.url = "<<spine_tarball_path_url>>";
- inputs.spine-tarball.flake = true;
- outputs = { <<flake_outputs>>, spine, spine-tarball }: {
- <<flake_output_spine>>
- <<flake_output_spine_tarball>>
- <<flake_output_spine_markup_samples>>
- <<flake_output_default>>
- };
-}
-#+END_SRC
-
*** flake :flake:
**** notes?