-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
93 lines (93 loc) · 2.86 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
inputs = {
nix-go = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:matthewdargan/nix-go";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
parts.url = "github:hercules-ci/flake-parts";
pre-commit-hooks = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:cachix/pre-commit-hooks.nix";
};
process-compose.url = "github:Platonic-Systems/process-compose-flake";
services-flake.url = "github:juspay/services-flake";
};
outputs = inputs:
inputs.parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.pre-commit-hooks.flakeModule
inputs.process-compose.flakeModule
];
perSystem = {
config,
inputs',
lib,
pkgs,
...
}: {
devShells.default = pkgs.mkShell {
packages = [
inputs'.nix-go.packages.go
inputs'.nix-go.packages.golangci-lint
pkgs.ollama
pkgs.pgcli
];
shellHook = "${config.pre-commit.installationScript}";
};
packages.nba-chatbot = inputs'.nix-go.legacyPackages.buildGoModule {
meta = with lib; {
description = "NBA RAG Chatbot";
homepage = "https://github.com/matthewdargan/nba-chatbot";
license = licenses.bsd3;
maintainers = with maintainers; [matthewdargan];
};
pname = "nba-chatbot";
src = ./.;
vendorHash = "sha256-99WPOXeNbQK2ijur18ydYw1aViRwXdfGeP/qvzOHDW0=";
version = "0.5.5";
};
pre-commit = {
check.enable = false;
settings = {
hooks = {
alejandra.enable = true;
deadnix.enable = true;
golangci-lint = {
enable = true;
package = inputs'.nix-go.packages.golangci-lint;
};
gotest = {
enable = true;
package = inputs'.nix-go.packages.go;
};
statix.enable = true;
};
src = ./.;
};
};
process-compose."services" = {
imports = [inputs.services-flake.processComposeModules.default];
services = {
ollama."ol1" = {
enable = true;
acceleration = "rocm";
environment."HSA_OVERRIDE_GFX_VERSION" = "11.0.0";
models = ["llama3:8b" "mxbai-embed-large"];
};
postgres."pg1" = {
enable = true;
initialDatabases = [
{
name = "chatbot";
schemas = [./sql/create-player.sql];
}
];
package = pkgs.postgresql_16.withPackages (p: [p.pgvector]);
};
};
};
};
systems = ["aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux"];
};
}