diff options
Diffstat (limited to 'org/config_nix.org')
-rw-r--r-- | org/config_nix.org | 57 |
1 files changed, 46 insertions, 11 deletions
diff --git a/org/config_nix.org b/org/config_nix.org index 3f990dc..12c1c68 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -25,10 +25,16 @@ description = "a sisu like document parser search form"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; # "github:nixos/nixpkgs"; "github:NixOS/nixpkgs/nixpkgs-unstable"; "nixpkgs/nixos-unstable"; "nixpkgs/nixos-21.11"; inputs.flake-utils.url = "github:numtide/flake-utils"; + #inputs.d-overlay = { + # url = "git+file:///home/ralph/grotto/repo/git.repo/projects/doc-reform/packages/nix-flakes/dlang/dlang-nix-flakes"; + # inputs.nixpkgs.follows = "nixpkgs"; + # flake = true; + #}; outputs = { self, nixpkgs, flake-utils, + #d-overlay, } @ inputs: let pname = "spine_search"; version = "<<spine_version_set>>"; @@ -36,12 +42,24 @@ devEnv = ./.envrc; # ./shell.nix; # ./default.nix; supportedSystems = ["x86_64-linux"]; # [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); # nixpkgs instantiated for supported system types. + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); # nixpkgs instantiated for supported system types checkPhase = '' runHook preCheck dub test --combined --skip-registry=all runHook postCheck ''; + localOverlay = (final: prev: { + ldc = prev.callPackage ./nix-overlays/ldc { }; + dmd = prev.callPackage ./nix-overlays/dmd { }; + dub = prev.callPackage ./nix-overlays/dub { }; # -> ? + #gdc = prev.callPackage ./nix-overlays/gdc { }; # empty + }); + pkgsForSystem = system: import nixpkgs { + overlays = [ + localOverlay + ]; + inherit system; + }; installPhase = '' runHook preInstall mkdir -p $out/share/cgi-bin @@ -53,9 +71,10 @@ ''; in { packages = forAllSystems (system: let + pkgs-ovl = pkgsForSystem system; pkgs = nixpkgsFor.${system}; in - with pkgs; { + with pkgs-ovl; { default = stdenv.mkDerivation { inherit pname; inherit version; @@ -74,7 +93,7 @@ done if [ "$DC" == "" ]; then exit "Error: could not find D compiler"; fi echo "$DC_ used as D compiler to build $pname" - dub build --compiler=$DC --build=$DC_ --combined --skip-registry=all + dub build --cache=local --compiler=$DC --build=$DC_ --combined --skip-registry=all runHook postBuild ''; inherit checkPhase; @@ -93,7 +112,7 @@ nativeBuildInputs = [dub dmd gnumake]; buildPhase = '' runHook preBuild - dub build --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all + dub build --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all runHook postBuild ''; inherit checkPhase; @@ -112,7 +131,7 @@ nativeBuildInputs = [dub ldc gnumake]; buildPhase = '' runHook preBuild - dub build --compiler=$(type -P ldc2) --build=ldc2 --combined --skip-registry=all + dub build --cache=local --compiler=$(type -P ldc2) --build=ldc2 --combined --skip-registry=all runHook postBuild ''; inherit checkPhase; @@ -131,7 +150,7 @@ # nativeBuildInputs = [ dub gdc gnumake ]; # buildPhase = '' # runHook preBuild - # dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all + # dub build --cache=local --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all # runHook postBuild # ''; # inherit checkPhase; @@ -141,15 +160,16 @@ #vendorSha256 = "sha256-0Q00000000000000000000000000000000000000000="; }); devShells = forAllSystems (system: let + pkgs-ovl = pkgsForSystem system; pkgs = nixpkgsFor.${system}; shellHook = '' - export DFLAGS="-O2 -inline -boundscheck=on -color=on" + export DFLAGS="-O2 -boundscheck=on" export Date=`date "+%Y%m%d"` ## set local values in .envrc-local (or here if you must) ''; in - with pkgs; { - devShell = mkShell { + with pkgs-ovl; { + dsh-overlay = mkShell { name = "spine base dev shell"; inherit shell; inherit devEnv; @@ -158,13 +178,14 @@ packages = [ sqlite dub - dmd + #dmd ldc gnumake ]; inherit shellHook; }; - devShell-sqlite = mkShell { + #dsh-d-overlay = d-overlay.devShells.${system}.default; + dsh-sqlite = mkShell { name = "spine dev shell for latex & pdf output"; inherit shell; inherit devEnv; @@ -177,6 +198,20 @@ ]; inherit shellHook; }; + dsh-nixpkgs-ldc-dub = mkShell { + name = "nixpkgs - ldc - dub"; + inherit shell; + inherit devEnv; + #nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; + #buildInputs = [ sqlite ]; + packages = with pkgs; [ + ldc + dub + gnumake + sqlite + ]; + inherit shellHook; + }; default = import ./shell.nix {inherit pkgs;}; }); }; |