-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
48 lines (44 loc) · 1.31 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
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = {
self,
nixpkgs,
}: let
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [
self.overlay
];
});
in {
overlay = final: prev: {
sqlelf = prev.callPackage ./derivation.nix {};
};
formatter = forAllSystems (system: (nixpkgsFor.${system}).alejandra);
packages = forAllSystems (system: {
default = (nixpkgsFor.${system}).sqlelf;
});
devShells = forAllSystems (system:
with nixpkgsFor.${system}; {
default = mkShellNoCC {
venvDir = "./.venv";
# needed for tests
TEST_BINARY = "${coreutils}/bin/ls";
packages = [
python3Packages.pip
# This execute some shell code to initialize a venv in $venvDir before
# dropping into the shell
python3Packages.venvShellHook
];
# bring all the dependencies needed to build sqlelf
inputsFrom = [sqlelf];
postVenvCreation = ''
pip install --editable ".[dev]"
'';
};
});
};
}