forked from chrishayuk/larql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
73 lines (66 loc) · 2.2 KB
/
Copy pathflake.nix
File metadata and controls
73 lines (66 loc) · 2.2 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
#
# flake.nix - LARQL Nix packaging
#
# Quick Start:
# nix build # Build larql-cli binary
# nix develop # Development shell
# nix flake show # List all outputs
#
# Demo (models fetched via git-lfs, vindexes built at nix-build time):
# nix run .#demo-list # List available models
# nix run .#demo # Walk default model (gemma4-4b)
# nix run .#demo-<key> # Walk a specific model
# nix run .#demo-info # Show GGUF metadata for local models
# nix build .#vindex-<key> # Build a vindex from a model
#
# OCI Containers (Linux only):
# nix build .#container # larql-server image
# nix build .#container-cli # larql CLI image
# docker load < result
#
# See also: ./nix/README.md
#
{
description = "LARQL - query engine for transformer model weights";
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
nixDir = ./nix;
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
# Import modular package definition
larql = import (nixDir + "/package.nix") { inherit pkgs lib; src = self; };
# Import OCI container images (Linux only)
containers = lib.optionalAttrs pkgs.stdenv.isLinux (
import (nixDir + "/container.nix") { inherit pkgs lib larql; }
);
# Import demo (model fetch + vindex extraction + apps)
demo = import (nixDir + "/demo.nix") { inherit pkgs lib larql; };
in
{
packages = {
default = larql;
inherit larql;
} // lib.optionalAttrs pkgs.stdenv.isLinux {
container = containers.server;
container-cli = containers.cli;
}
# Demo packages (model + vindex)
// demo.packages;
# Demo and utility apps
apps = demo.apps;
# Import modular development shell
devShells.default = import (nixDir + "/shell.nix") { inherit pkgs lib larql; };
}
);
}