From f0dbee6a6204dc92b2418723393aa3cb298245af Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 24 Jan 2023 12:33:53 -0500 Subject: nix & build housekeeping, alternative D compilers --- .envrc | 24 +++++++++++++- .envrc-local_ | 11 ------- flake.lock | 13 +++++--- flake.nix | 3 ++ makefile | 16 ++++++++++ org/config_make.org | 16 ++++++++++ org/config_nix.org | 92 +++++++++++++++-------------------------------------- 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 '' -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 '' -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 = "<>"; - inputs.nixpkgs.url = "<>"; - inputs.spine.url = "<>"; - inputs.spine.flake = true; - inputs.spine-tarball.url = "<>"; - inputs.spine-tarball.flake = true; - outputs = { <>, spine, spine-tarball }: { - <> - <> - <> - <> - }; -} -#+END_SRC - *** flake :flake: **** notes? -- cgit v1.2.3