-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
140 lines (125 loc) · 3.77 KB
/
Copy pathflake.nix
File metadata and controls
140 lines (125 loc) · 3.77 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
{
description = "Library for building GNU Make like tool for database scripts";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
yappt.url = "github:padhia/yappt";
yappt.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
make4db-api.url = "github:padhia/make4db-api";
make4db-api.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
make4db-duckdb.url = "github:padhia/make4db-duckdb";
make4db-duckdb.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
make4db-api.follows = "make4db-api";
};
make4db-postgres.url = "github:padhia/make4db-postgres";
make4db-postgres.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
make4db-api.follows = "make4db-api";
};
make4db-snowflake.url = "github:padhia/make4db-snowflake";
make4db-snowflake.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
make4db-api.follows = "make4db-api";
snowflake.follows = "snowflake";
sfconn.follows = "sfconn";
yappt.follows = "yappt";
};
snowflake.url = "github:padhia/snowflake";
snowflake.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
sfconn.url = "github:padhia/sfconn";
sfconn.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
snowflake.follows = "snowflake";
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
yappt,
make4db-api,
make4db-duckdb,
make4db-postgres,
make4db-snowflake,
...
}:
let
inherit (nixpkgs.lib) composeManyExtensions;
overlays.default =
let
pkgOverlay = final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(py-final: py-prev: {
make4db = py-final.callPackage ./make4db.nix { };
})
];
make4db-duckdb = final.python3.withPackages (
ps: with ps; [ make4db ] ++ make4db.optional-dependencies.duckdb
);
make4db-postgres = final.python3.withPackages (
ps: with ps; [ make4db ] ++ make4db.optional-dependencies.postgres
);
make4db-snowflake = final.python3.withPackages (
ps: with ps; [ make4db ] ++ make4db.optional-dependencies.snowflake
);
};
in
composeManyExtensions [
make4db-api.overlays.default
make4db-duckdb.overlays.default
make4db-postgres.overlays.default
make4db-snowflake.overlays.default
yappt.overlays.default
pkgOverlay
];
eachSystem =
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ self.overlays.default ];
};
pyPkgs = pkgs.python3Packages;
in
{
devShells.default = pkgs.mkShell {
name = "m4db";
venvDir = "./.venv";
buildInputs = [
pkgs.ruff
pkgs.uv
pyPkgs.python
pyPkgs.venvShellHook
pyPkgs.pytest
pyPkgs.sqlparse
pyPkgs.make4db-api
pyPkgs.yappt
pyPkgs.jinja2
];
};
packages = {
inherit (pkgs) make4db-duckdb make4db-postgres make4db-snowflake;
};
};
in
{
inherit overlays;
inherit (flake-utils.lib.eachDefaultSystem eachSystem) devShells packages;
};
}