-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
110 lines (96 loc) · 2.94 KB
/
flake.nix
File metadata and controls
110 lines (96 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
description = "Nix packages and development shells for bitcoinkernel and its language bindings";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Import our packages
bitcoinkernelPkgs = import ./pkgs { inherit pkgs; };
# Import our shells
shells = import ./shells { inherit pkgs; };
in
{
# Expose all packages
packages = {
inherit (bitcoinkernelPkgs)
bitcoinkernel
bitcoinkernel-jdk
go-bitcoinkernel
rust-bitcoinkernel
py-bitcoinkernel
bitcoinkernel-dotnet;
# Default package
default = bitcoinkernelPkgs.bitcoinkernel;
};
# Development shells for each language
devShells = {
inherit (shells)
cpp
java
go
rust
python
dotnet;
# Default shell
default = shells.default;
};
# Expose the package set for overlays
overlays.default = final: prev: {
bitcoinkernel = bitcoinkernelPkgs;
};
# NixOS module (future enhancement)
# nixosModules.default = import ./modules;
# Apps for convenient CLI access
apps = {
# Example: nix run .#build-java
build-java = {
type = "app";
program = "${pkgs.writeShellScript "build-java" ''
echo "Building bitcoinkernel-jdk..."
nix build .#bitcoinkernel-jdk
''}";
};
};
# Formatter for Nix files
formatter = pkgs.nixpkgs-fmt;
# Checks for CI/CD
checks = {
# We can add build checks here
# build-bitcoinkernel = bitcoinkernelPkgs.bitcoinkernel;
};
}
) // {
# Non-system specific outputs
# Overlay for use in other flakes
overlay = final: prev: {
bitcoinkernel = prev.callPackage ./pkgs { };
};
# Templates for new projects
templates = {
java = {
path = ./templates/java;
description = "Template for Java project using bitcoinkernel-jdk";
};
go = {
path = ./templates/go;
description = "Template for Go project using go-bitcoinkernel";
};
rust = {
path = ./templates/rust;
description = "Template for Rust project using rust-bitcoinkernel";
};
python = {
path = ./templates/python;
description = "Template for Python project using py-bitcoinkernel";
};
dotnet = {
path = ./templates/dotnet;
description = "Template for .NET project using bitcoinkernel-dotnet";
};
};
};
}