mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat(access): a llama
This commit is contained in:
parent
e3b6048e32
commit
7bf1ce71de
14 changed files with 323 additions and 6 deletions
30
modules/system/exports/ollama.nix
Normal file
30
modules/system/exports/ollama.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
gensokyo-zone,
|
||||
...
|
||||
}: let
|
||||
inherit (gensokyo-zone.lib) mkAlmostOptionDefault;
|
||||
inherit (lib.modules) mkIf;
|
||||
in {
|
||||
config.exports.services.ollama = {config, ...}: {
|
||||
displayName = mkAlmostOptionDefault "Ollama";
|
||||
id = mkAlmostOptionDefault "ollama";
|
||||
nixos = {
|
||||
serviceAttr = "ollama";
|
||||
assertions = mkIf config.enable [
|
||||
(nixosConfig: {
|
||||
assertion = config.ports.default.port == nixosConfig.services.ollama.port;
|
||||
message = "port mismatch";
|
||||
})
|
||||
];
|
||||
};
|
||||
defaults.port.listen = mkAlmostOptionDefault "lan";
|
||||
ports = {
|
||||
default = {
|
||||
port = mkAlmostOptionDefault 11434;
|
||||
protocol = "http";
|
||||
status.enable = mkAlmostOptionDefault true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
else config.name;
|
||||
};
|
||||
listen = mkOption {
|
||||
type = enum ["wan" "lan" "int" "localhost"];
|
||||
type = enum ["wan" "lan" "int" "tail" "localhost"];
|
||||
};
|
||||
protocol = mkOption {
|
||||
type = nullOr (enum ["http" "https"]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue