-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
54 lines (47 loc) · 1.61 KB
/
Copy pathflake.nix
File metadata and controls
54 lines (47 loc) · 1.61 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
{
description = "tiny-llm-gate — a memory-conscious OpenAI-compatible LLM gateway";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
version =
if self ? shortRev then "0.3.3-${self.shortRev}"
else if self ? dirtyShortRev then "0.3.3-${self.dirtyShortRev}"
else "0.3.3-dev";
in
{
packages.default = pkgs.buildGoModule {
pname = "tiny-llm-gate";
inherit version;
src = ./.;
vendorHash = "sha256-g+yaVIx4jxpAQ/+WrGKxhVeliYx7nLQe/zsGpxV4Fn4=";
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
# Keep the binary small and statically linked.
env.CGO_ENABLED = "0";
meta = with pkgs.lib; {
description = "Memory-conscious OpenAI-compatible LLM gateway";
homepage = "https://github.com/nSimonFR/tiny-llm-gate";
license = licenses.mit;
mainProgram = "tiny-llm-gate";
};
};
devShells.default = pkgs.mkShell {
packages = [ pkgs.go pkgs.gopls pkgs.gotools ];
};
apps.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/tiny-llm-gate";
};
}) // {
nixosModules.default = import ./nixos-module.nix;
nixosModules.tiny-llm-gate = import ./nixos-module.nix;
};
}