-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
42 lines (36 loc) · 1.25 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
{
description = "OpenAlex BioBrick";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
dev-shell.url = "github:biobricks-ai/dev-shell";
};
outputs = { self, nixpkgs, flake-utils, dev-shell }:
flake-utils.lib.eachDefaultSystem (system:
with import nixpkgs { inherit system; };
let
pg2sqlite = stdenv.mkDerivation rec {
pname = "pg2sqlite";
version = "1.0.3";
src = fetchurl {
url =
"https://github.com/caiiiycuk/postgresql-to-sqlite/releases/download/v${version}/${pname}-${version}.jar";
sha256 = "sha256-s7ELwadymvZj3oBUH++OtiwswR5wf1j6izUN4Vz4OE8=";
};
buildInputs = [ makeWrapper jre ];
dontBuild = true;
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
cp $src $out/pg2sqlite-${version}.jar
makeWrapper ${jre}/bin/java $out/bin/pg2sqlite \
--add-flags "-jar $out/pg2sqlite-${version}.jar"
'';
};
in {
devShells.default = mkShell {
inputsFrom = [ dev-shell.devShells.${system}.default ];
packages = [ duckdb pg2sqlite ];
};
});
}