aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/config_nix.org
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 /org/config_nix.org
parentdub nix (diff)
nix use overlays when convenient
Diffstat (limited to 'org/config_nix.org')
-rw-r--r--org/config_nix.org72
1 files changed, 63 insertions, 9 deletions
diff --git a/org/config_nix.org b/org/config_nix.org
index e5e0739..ee9b157 100644
--- a/org/config_nix.org
+++ b/org/config_nix.org
@@ -42,6 +42,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
@@ -54,9 +66,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;
@@ -76,7 +89,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;
@@ -95,7 +108,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;
@@ -114,7 +127,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;
@@ -133,7 +146,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;
@@ -149,13 +162,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;
@@ -164,9 +178,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;
@@ -177,7 +219,7 @@
inherit devEnv;
packages = [
dub
- dmd
+ #dmd
ldc
gnumake
sqlite
@@ -910,3 +952,15 @@ postInstall:
echo "$${out}/share/cgi-bin"; \
echo `ls -la $${out}/bin/spine`
#+END_SRC
+
+** empty sha56 hash
+
+#+NAME: blank_hash
+#+BEGIN_SRC nix
+sha256-0000000000000000000000000000000000000000000=
+#+END_SRC
+
+#+NAME: assumed_hash
+#+BEGIN_SRC nix
+sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+#+END_SRC