diff options
Diffstat (limited to 'org/config_nix.org')
-rw-r--r-- | org/config_nix.org | 290 |
1 files changed, 78 insertions, 212 deletions
diff --git a/org/config_nix.org b/org/config_nix.org index 5950ee9..ab9f081 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -6,7 +6,7 @@ #+EMAIL: [[mailto:ralph.amissah@gmail.com][ralph.amissah@gmail.com]] #+COPYRIGHT: Copyright (C) 2015 - 2023 Ralph Amissah #+LANGUAGE: en -#+STARTUP: content hideblocks hidestars noindent entitiespretty +#+STARTUP: show4levels hideblocks hidestars noindent entitiespretty #+PROPERTY: header-args :exports code #+PROPERTY: header-args+ :noweb yes #+PROPERTY: header-args+ :results no @@ -81,37 +81,18 @@ nix show-derivation /nix/store/q7n14bm8j5vzm62qaraczdb4bpyf59vv-spine-0.11.1.drv use flake . #use flake .#default NIX_ENFORCE_PURITY=1 +# - https://github.com/nix-community/nix-direnv NixDirEnvVersion="2.2.1" if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then -# - https://github.com/nix-community/nix-direnv # 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-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" fi watch_file flake.lock watch_file flake.nix -#nix flake update && nix flake check --show-trace && nix flake show +watch_file makefile 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-search-ldc --print-build-logs -# - nix build .#spine-search-dmd --print-build-logs -# - nix build .#spine-search-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 @@ -174,8 +155,7 @@ postInstall: #+END_SRC *** flake :flake: -**** flake static :flake:static: -***** flake.nix +**** flake.nix #+HEADER: :tangle ../flake.nix #+HEADER: :noweb yes @@ -219,7 +199,7 @@ postInstall: inherit shell; inherit devEnv; buildInputs = [ sqlite ]; - nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ]; + nativeBuildInputs = [ dub ldc gnumake ]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ]; buildPhase = '' runHook preBuild for DC_ in dmd ldmd2 ldc2 gdc gdmd; do @@ -274,25 +254,25 @@ postInstall: inherit installPhase; inherit postInstall; }; - spine-search-gdc = stdenv.mkDerivation { - inherit pname; - inherit version; - meta.mainProgram = "spine_search-gdc"; - executable = true; - src = self; - inherit shell; - inherit devEnv; - buildInputs = [ sqlite ]; - nativeBuildInputs = [ dub gdc gnumake ]; - buildPhase = '' - runHook preBuild - dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all - runHook postBuild - ''; - inherit checkPhase; - inherit installPhase; - inherit postInstall; - }; + #spine-search-gdc = stdenv.mkDerivation { + # inherit pname; + # inherit version; + # meta.mainProgram = "spine_search-gdc"; + # executable = true; + # src = self; + # inherit shell; + # inherit devEnv; + # buildInputs = [ sqlite ]; + # nativeBuildInputs = [ dub gdc gnumake ]; + # buildPhase = '' + # runHook preBuild + # dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all + # runHook postBuild + # ''; + # inherit checkPhase; + # inherit installPhase; + # inherit postInstall; + #}; #vendorSha256 = "sha256-0Q00000000000000000000000000000000000000000="; }); devShells = forAllSystems (system: @@ -323,28 +303,29 @@ postInstall: #export spineSqlite="spine --very-verbose --sqlite-update --sqlite-db-path=\"$SpineDBpath\" --sqlite-db-filename=\"spine.search.db\" --output=\"\$SpineOUT\" $SpinePOD/*" ''; in with pkgs; { - devShell = mkShell rec { - name = "spine dev shell default"; + devShell = mkShell { + name = "spine base dev shell"; inherit shell; inherit devEnv; #buildInputs = [ sqlite ]; #nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; packages = [ sqlite - dub dmd ldc gdc gnumake + dub dmd ldc gnumake ]; inherit shellHook; }; - devShell-sqlite = mkShell rec { - name = "spine dev shell for latex & pdf output"; + devShell-sqlite = mkShell { + name = "spine dev shell for latex & pdf output"; inherit shell; inherit devEnv; - packages = [ + packages = [ + dub dmd ldc gnumake sqlite - dub dmd ldc gdc gnumake ]; inherit shellHook; }; + default = import ./shell.nix { inherit pkgs; }; }); }; } @@ -509,79 +490,55 @@ postInstall = '' with pkgs; mkShell { buildInputs = [ + # ❯❯❯ nix_related + #nix direnv + #cachix nixVersions.unstable #nixFlakes nix-prefetch-git validatePkgConfig - nix-tree jq nix-output-monitor + nix-output-monitor + nix-tree + jq git gnumake ps - ### d_build_related + # ❯❯❯ d_build_related + # ❯❯ package manager dub - ## compiler + # ❯❯ compiler ldc rund - ## linker + # ❯❯ linker #lld #mold - ## builder + # ❯❯ builder #ninja #meson - ### sqlite search related + # ❯❯❯ sqlite search related sqlite - ### tools + # ❯❯❯ tools #aria #wget #curl - ### candy - #starship ]; shellHook = '' - #if [[ -f ".envrc" ]]; then - # source .envrc - #fi nix flake update - echo "" - echo "nix flake metadata:" - nix flake metadata - echo "" - echo "nix flake check:" nix flake check - echo "" - echo "nix flake show:" nix flake show - 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 .#default --print-build-logs - nix run default.nix --print-build-logs - - - nix shell - nix shell --print-build-logs + echo ' + shell.nix echo ❯❯ - - 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 flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell" -c zsh - nix-build |& nom + ❯❯ nix develop + ❯❯ nix develop -c zsh - nix-instantiate | nix show-derivation | jq - nix-build . --no-out-link | xargs -o nix-tree - nix-tree --derivation .#spine_search + ❯❯ nix build + ❯❯ nix build ".#default" --print-build-logs + ❯❯ nix build ".#spine-search-dmd" --print-build-logs |& nom + ❯❯ nix build ".#spine-search-ldc" --print-build-logs |& nom - dub build --compiler=ldmd --build=release --combined --skip-registry=all - " + ❯❯ dub build --compiler=ldmd --build=release --combined --skip-registry=all + ' ''; } #+END_SRC @@ -638,13 +595,13 @@ echo "ldc `${pkgs.ldc}/bin/ldc2 -v`" # - nix build `nix-instantiate -I .envrc` # - nix build -f default.nix && ./result/bin/spine -v && noti -t "spine build" -m "see ./result/bin/spine" - # - nix build .#spine + # - nix build .#default # [ nix run ] # - nix run default.nix --print-build-logs # - nix run -I .envrc default.nix --print-build-logs - # - nix run .#spine + # - nix run .#default # - nix-shell -I .envrc --pure # - nix develop --build -f derivation.nix -I .envrc --print-build-logs @@ -710,100 +667,6 @@ echo "ldc `${pkgs.ldc}/bin/ldc2 -v`" ./result/bin/spine #+END_SRC -**** shell parts (packages) -***** packages nix related - -#+NAME: shell_packages_nix_related -#+BEGIN_SRC nix -### nix_related -direnv -nixVersions.unstable #nixFlakes -nix-prefetch-git -validatePkgConfig -jq -git -ps -#+END_SRC - -***** packages d build related - -#+NAME: shell_packages_d_build_related -#+BEGIN_SRC nix -### d_build_related -## package manager -dub -## compiler -ldc -rund -## linker -#lld -#mold -## builder -#ninja -#meson -#+END_SRC - -***** packages tools - -#+NAME: shell_packages_tool_download -#+BEGIN_SRC nix -### tools -#curl -#wget -aria -#+END_SRC - -***** packages candy - -#+NAME: shell_packages_candy -#+BEGIN_SRC nix -### candy -starship -#+END_SRC - -***** packages search sqlite related - -#+NAME: shell_packages_search_related_sqlite -#+BEGIN_SRC nix -### sqlite search related -sqlite -#+END_SRC - -***** packages pdf latex related - -#+NAME: shell_packages_pdf_latex_related -#+BEGIN_SRC nix -### pdf_latex_related -source-sans-pro -source-serif-pro -source-code-pro -texlive.combined.scheme-full -#+END_SRC - -***** packages xml epub related - -#+NAME: shell_packages_xml_and_epub_related -#+BEGIN_SRC nix -### xml_and_epub_related -libxml2 -html-tidy -xmlstarlet -epubcheck -ebook_tools -epr -sigil -calibre #(suite includes: ebook-viewer) -foliate -#+END_SRC - -***** packages i18n_translation related - -#+NAME: shell_packages_i18n_translation -#+BEGIN_SRC nix -### i18n translation related -perl534Packages.Po4a -#+END_SRC - *** default.nix :default: - default.nix -I nixpkgs=<provide local nix path> @@ -847,35 +710,34 @@ pkgs.callPackage ./derivation.nix {} *** devenv.nix :default:devenv: #+HEADER: :tangle ../devenv.nix -#+HEADER: :tangle-mode (identity #o755) +#+HEADER: :tangle-mode (identity #o644) #+BEGIN_SRC nix -{ pkgs ? import <nixpkgs> { }, name ? "user-env" }: with pkgs; +{ pkgs ? import <nixpkgs> { }, name ? "user-env" }: +with pkgs; buildEnv { inherit name; extraOutputsToInstall = [ "out" "man" "lib" ]; # to get all needed symlinks paths = [ + # ❯❯❯ nix_related #nix # if not on NixOS, this is needed direnv + #cachix nixVersions.unstable #nixFlakes nix-prefetch-git validatePkgConfig - nix-tree jq nix-output-monitor + nix-output-monitor + nix-tree + jq git + gnumake ps - ### d_build_related + # ❯❯❯ d_build_related + # ❯❯ package manager dub - ## compiler + # ❯❯ compiler dmd ldc - #gdc - #rund - ## linker - #lld - #mold - ## builder - #ninja - #meson - ### sqlite search related + # ❯❯❯ sqlite search related sqlite # this will create a script that will rebuild and upgrade your setup; using shell script syntax (writeScriptBin "nix-rebuild" '' @@ -885,11 +747,11 @@ buildEnv { nix profile upgrade '.*' '') # puts in your root the nixpkgs version - (writeTextFile { + (writeTextFile { name = "nixpkgs-version"; destination = "/nixpkgs-version"; text = lib.version; - }) + }) ]; } #+END_SRC @@ -1011,7 +873,7 @@ mkDubDerivation rec { homepage = "https://sisudoc.org"; description = "cgi sqlite search form for document object search"; longDescription = '' - a sisu like parser and document generator + a sisu like parser & document generator ''; homepage = "https://sisudoc.org"; license = licenses.agpl3Plus; @@ -1144,6 +1006,8 @@ ldc sqlite nix-prefetch-git validatePkgConfig +nix-output-monitor +nix-tree jq git #+END_SRC @@ -1285,6 +1149,8 @@ pkgs.mkShell { nixVersions.unstable #nixFlakes nix-prefetch-git validatePkgConfig + nix-output-monitor + nix-tree jq git fontconfig |