From bcbfb7ed048e39f3d69f8b9687b39678bfde47bf Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 23 Jun 2023 10:19:35 -0400 Subject: flake.nix (local filesystem) spine overlays --- flake.lock | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 40 ++++++++++++++++++++-------------------- org/config_nix.org | 44 ++++++++++++++++++++++++-------------------- 3 files changed, 97 insertions(+), 41 deletions(-) diff --git a/flake.lock b/flake.lock index 7c79c37..866fca9 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,23 @@ { "nodes": { + "d-overlay": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1686518136, + "narHash": "sha256-HWqgvb6sgx9i/IivQLd57JGE+ZKLs2o9BFttTesJd6Y=", + "type": "git", + "url": "file:///home/ralph/grotto/repo/git.repo/projects/doc-reform/packages/nix-flakes/dlang/dlang-nix-flakes" + }, + "original": { + "type": "git", + "url": "file:///home/ralph/grotto/repo/git.repo/projects/doc-reform/packages/nix-flakes/dlang/dlang-nix-flakes" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -18,6 +36,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1687171271, + "narHash": "sha256-BJlq+ozK2B1sJDQXS3tzJM5a+oVZmi1q0FlBK/Xqv7M=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "abfb11bd1aec8ced1c9bb9adfe68018230f4fb3c", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1687488839, @@ -36,7 +72,8 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", + "d-overlay": "d-overlay", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs" } }, @@ -54,6 +91,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index fb13f2a..336fb0e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,23 +1,23 @@ { 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.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 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; - #}; + 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, + d-overlay, } @ inputs: let pname = "spine_search"; version = "0.12.0"; - shell = ./shell.nix; # ./default.nix; - devEnv = ./.envrc; # ./shell.nix; # ./default.nix; - supportedSystems = ["x86_64-linux"]; # [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; + shell = ./shell.nix; + devEnv = ./.envrc; + supportedSystems = ["x86_64-linux"]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); # nixpkgs instantiated for supported system types checkPhase = '' @@ -28,8 +28,8 @@ 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 + dub = prev.callPackage ./nix-overlays/dub { }; + #gdc = prev.callPackage ./nix-overlays/gdc { }; # empty }); pkgsForSystem = system: import nixpkgs { overlays = [ @@ -60,7 +60,7 @@ inherit shell; inherit devEnv; buildInputs = [sqlite]; - nativeBuildInputs = [dub ldc gnumake]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ]; + nativeBuildInputs = [dub ldc gnumake]; buildPhase = '' runHook preBuild for DC_ in dmd ldmd2 ldc2 gdc gdmd; do @@ -169,26 +169,26 @@ name = "spine base dev shell"; inherit shell; inherit devEnv; + #nativeBuildInputs = [ ldc dub gnumake ]; #buildInputs = [ sqlite ]; - #nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; packages = [ sqlite - dub - #dmd ldc + #dmd + dub gnumake ]; inherit shellHook; }; - #dsh-d-overlay = d-overlay.devShells.${system}.default; + dsh-d-overlay = d-overlay.devShells.${system}.default; dsh-sqlite = mkShell { name = "spine dev shell for latex & pdf output"; inherit shell; inherit devEnv; packages = [ - dub - #dmd ldc + #dmd + dub gnumake sqlite ]; @@ -198,7 +198,7 @@ name = "nixpkgs - ldc - dub"; inherit shell; inherit devEnv; - #nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; + #nativeBuildInputs = [ ldc dub gnumake ]; #buildInputs = [ sqlite ]; packages = with pkgs; [ ldc diff --git a/org/config_nix.org b/org/config_nix.org index 17427cf..fbec722 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -18,29 +18,33 @@ * nix :nix: ** flake.nix :flake: +# "github:nixos/nixpkgs"; "github:NixOS/nixpkgs/nixpkgs-unstable"; "nixpkgs/nixos-unstable"; "nixpkgs/nixos-21.11"; +# [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; +# [ dub dmd ]; [ dub ldc ]; [ dub gdc ]; + #+HEADER: :tangle ../flake.nix #+HEADER: :noweb yes #+BEGIN_SRC nix { 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.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 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; - #}; + 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, + d-overlay, } @ inputs: let pname = "spine_search"; version = "<>"; - shell = ./shell.nix; # ./default.nix; - devEnv = ./.envrc; # ./shell.nix; # ./default.nix; - supportedSystems = ["x86_64-linux"]; # [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; + shell = ./shell.nix; + devEnv = ./.envrc; + supportedSystems = ["x86_64-linux"]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); # nixpkgs instantiated for supported system types checkPhase = '' @@ -51,8 +55,8 @@ 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 + dub = prev.callPackage ./nix-overlays/dub { }; + #gdc = prev.callPackage ./nix-overlays/gdc { }; # empty }); pkgsForSystem = system: import nixpkgs { overlays = [ @@ -83,7 +87,7 @@ inherit shell; inherit devEnv; buildInputs = [sqlite]; - nativeBuildInputs = [dub ldc gnumake]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ]; + nativeBuildInputs = [dub ldc gnumake]; buildPhase = '' runHook preBuild for DC_ in dmd ldmd2 ldc2 gdc gdmd; do @@ -192,26 +196,26 @@ name = "spine base dev shell"; inherit shell; inherit devEnv; + #nativeBuildInputs = [ ldc dub gnumake ]; #buildInputs = [ sqlite ]; - #nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; packages = [ sqlite - dub - #dmd ldc + #dmd + dub gnumake ]; inherit shellHook; }; - #dsh-d-overlay = d-overlay.devShells.${system}.default; + dsh-d-overlay = d-overlay.devShells.${system}.default; dsh-sqlite = mkShell { name = "spine dev shell for latex & pdf output"; inherit shell; inherit devEnv; packages = [ - dub - #dmd ldc + #dmd + dub gnumake sqlite ]; @@ -221,7 +225,7 @@ name = "nixpkgs - ldc - dub"; inherit shell; inherit devEnv; - #nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; + #nativeBuildInputs = [ ldc dub gnumake ]; #buildInputs = [ sqlite ]; packages = with pkgs; [ ldc -- cgit v1.2.3