-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
74 lines (66 loc) · 2.45 KB
/
flake.nix
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
{
description = "secp2565k1-jdk (Java API & implementations for secp256k1)";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { flake-parts, devshell , gitignore, ... }:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, lib, ... }: let
inherit (pkgs) stdenv;
in {
# define default devshell
# devShells.default = inputs'.devshell.legacyPackages.mkShell {
devShells.default = pkgs.mkShell {
# setup some environment variables
# env = with lib;
# mkMerge [
# [
# # Configure nix to use nixpkgs
# {
# name = "NIX_PATH";
# value = "nixpkgs=${toString pkgs.path}";
# }
# ]
# (mkIf stdenv.isLinux [
# {
# name = "JAVA_HOME";
# eval = "$DEVSHELL_DIR/lib/openjdk";
# }
# ])
# ];
inputsFrom = with pkgs ; [ secp256k1 ];
packages = with pkgs ; [
jdk23 # JDK 23 will be in $JAVA_HOME (and in javaToolchains)
# current jextract in nixpkgs is broken, see: https://github.com/NixOS/nixpkgs/issues/354591
# jextract # jextract (Nix package) contains a jlinked executable and bundles its own JDK
(gradle.override { # Gradle 8.x (Nix package) depends-on and directly uses JDK XX to launch Gradle itself
javaToolchains = [ jdk23 ]; # Put JDK 23 in Gradle's javaToolchain configuration
})
];
};
# define flake output packages
packages = let
# useful for filtering src trees based on gitignore
inherit (gitignore.lib) gitignoreSource;
# common properties across the derivations
version = "0.0.1";
src = gitignoreSource ./.;
in {
# TBD
};
};
};
}