-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
44 lines (44 loc) · 1.35 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
flake-utils.url = "github:numtide/flake-utils";
clj-nix.url = "github:jlesquembre/clj-nix";
clj-nix.inputs.nixpkgs.follows = "nixpkgs";
clj-nix.inputs.flake-utils.follows = "flake-utils";
};
outputs = {self, clj-nix, nixpkgs, flake-utils}: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
cljpkgs = clj-nix.packages."${system}";
in {
legacyPackages = pkgs;
packages = rec {
default = jq-cli;
jq-cli = let
buildInitClasses = [
"com.fasterxml.jackson"
"net.thisptr.jackson.jq"
];
in cljpkgs.mkGraalBin {
cljDrv = jq-cli-java;
extraNativeImageBuildArgs = map (class: "--initialize-at-build-time=${class}") buildInitClasses ++ [ ];
};
jq-cli-java = cljpkgs.mkCljBin {
projectSrc = ./.;
name = "lt.jocas/clj-jq";
version = builtins.readFile ./resources/CLJ_JQ_VERSION;
main-ns = "jq.cli";
jdkRunner = pkgs.graalvm17-ce;
buildCommand = "clojure -T:build uber";
};
};
devShells = {
default = pkgs.mkShell {
buildInputs = with pkgs; [ clojure gnumake graalvm17-ce ] ++ [ cljpkgs.deps-lock ];
shellHook = ''
PS1='[clj-jq] '"$PS1"
'';
};
};
});
}