aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2023-06-04 18:18:21 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2023-06-04 19:21:34 -0400
commit446c0feadf7ca4a3289a5a0c9e0bbe0e74801f12 (patch)
tree50ce50da1ed20937182fe82fd7b27ff680648dae /flake.nix
parentdub nix (diff)
nix use overlays when convenient
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix60
1 files changed, 51 insertions, 9 deletions
diff --git a/flake.nix b/flake.nix
index 7e89065..4f487f0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -19,6 +19,18 @@
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/bin
@@ -31,9 +43,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;
@@ -53,7 +66,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;
@@ -72,7 +85,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;
@@ -91,7 +104,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;
@@ -110,7 +123,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;
@@ -126,13 +139,14 @@
};
});
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"`
'';
in
- with pkgs; {
+ with pkgs-ovl; {
devShell = mkShell {
name = "spine base dev shell";
inherit shell;
@@ -141,9 +155,37 @@
#nativeBuildInputs = [ dub dmd ldc gdc gnumake ];
packages = [
sqlite
- dub
+ ldc
#dmd
+ dub
+ gnumake
+ ];
+ inherit shellHook;
+ };
+ devShell-dmd = mkShell {
+ name = "spine base dev shell";
+ inherit shell;
+ inherit devEnv;
+ #buildInputs = [ sqlite ];
+ #nativeBuildInputs = [ dub dmd ldc gdc gnumake ];
+ packages = [
+ sqlite
+ dmd
+ dub
+ gnumake
+ ];
+ inherit shellHook;
+ };
+ devShell-ldc = mkShell {
+ name = "spine base dev shell";
+ inherit shell;
+ inherit devEnv;
+ #buildInputs = [ sqlite ];
+ #nativeBuildInputs = [ dub dmd ldc gdc gnumake ];
+ packages = [
+ sqlite
ldc
+ dub
gnumake
];
inherit shellHook;
@@ -154,7 +196,7 @@
inherit devEnv;
packages = [
dub
- dmd
+ #dmd
ldc
gnumake
sqlite