formatting & test cuda support
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
{ pkgs, nixpkgs-unstable, config, lib, ... }:
|
||||
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
nixpkgs-unstable,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
service = "ollama";
|
||||
cfg = config.homelab.${service};
|
||||
sec = config.sops.secrets;
|
||||
homelab = config.homelab;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options.homelab.${service} = {
|
||||
enable = lib.mkEnableOption "enables ${service}";
|
||||
|
||||
@@ -43,7 +46,6 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
# declare ${service} group
|
||||
users.groups.${service} = {gid = lib.mkForce cfg.ids;};
|
||||
|
||||
@@ -69,13 +71,12 @@ in
|
||||
host = "0.0.0.0";
|
||||
port = cfg.port;
|
||||
openFirewall = true;
|
||||
acceleration = "vulkan";
|
||||
acceleration = "cuda";
|
||||
syncModels = true;
|
||||
loadModels = [
|
||||
"deepseek-r1:7b"
|
||||
"deepseek-r1:14b"
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
# override umask to make permissions work out
|
||||
@@ -94,14 +95,13 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
# add to glance
|
||||
homelab.glance.links.services = [{
|
||||
title = service;
|
||||
url = "https://git.${homelab.base_domain}";
|
||||
error-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
check-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
icon = "di:${service}"; }];
|
||||
# homelab.glance.links.services = [{
|
||||
# title = service;
|
||||
# url = "https://git.${homelab.base_domain}";
|
||||
# error-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
# check-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
# icon = "di:${service}"; }];
|
||||
|
||||
# manage secrets with sops
|
||||
# sops.secrets = {
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
{ pkgs, nixpkgs-unstable, config, lib, ... }:
|
||||
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
nixpkgs-unstable,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
service = "open-webui";
|
||||
cfg = config.homelab.${service};
|
||||
sec = config.sops.secrets;
|
||||
homelab = config.homelab;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options.homelab.${service} = {
|
||||
enable = lib.mkEnableOption "enables ${service}";
|
||||
|
||||
@@ -43,7 +46,6 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
# declare ${service} group
|
||||
users.groups.${service} = {gid = lib.mkForce cfg.ids;};
|
||||
|
||||
@@ -87,14 +89,16 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
# add to glance
|
||||
homelab.glance.links.services = [{
|
||||
homelab.glance.links.services = [
|
||||
{
|
||||
title = service;
|
||||
url = "https://git.${homelab.base_domain}";
|
||||
url = "https://ai.${homelab.base_domain}";
|
||||
error-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
check-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
icon = "di:${service}"; }];
|
||||
icon = "di:${service}";
|
||||
}
|
||||
];
|
||||
|
||||
# manage secrets with sops
|
||||
# sops.secrets = {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
|
||||
let
|
||||
cfg = config.homelab;
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.homelab;
|
||||
in {
|
||||
options.homelab = {
|
||||
enable = lib.mkEnableOption "enable homelab services and configuration";
|
||||
media_user = lib.mkOption {
|
||||
@@ -41,10 +42,10 @@ in
|
||||
|
||||
# the order determines the order in glance :3
|
||||
imports = [
|
||||
./ai
|
||||
./mediastack
|
||||
./services
|
||||
./system
|
||||
./network
|
||||
./ai
|
||||
];
|
||||
}
|
||||
|
||||
@@ -28,8 +28,14 @@ in {
|
||||
#interface = "enp89s0";
|
||||
bind-interfaces = true;
|
||||
address = [
|
||||
"/snowbelle.lan/10.10.0.10"
|
||||
"/.snowbelle.lan/10.10.0.10"
|
||||
"/lumiose.lan/10.10.0.11"
|
||||
"/.lumiose.lan/10.10.0.11"
|
||||
"/bebe.lan/10.10.0.1"
|
||||
];
|
||||
server = [ # upstream dns
|
||||
server = [
|
||||
# upstream dns
|
||||
"10.10.0.1"
|
||||
];
|
||||
};
|
||||
@@ -37,13 +43,11 @@ in {
|
||||
|
||||
systemd.services.dnsmasq.serviceConfig = {
|
||||
RestartSec = "5s";
|
||||
StartLimitIntervalSec = 60;
|
||||
StartLimitBurst = 10;
|
||||
};
|
||||
|
||||
# open firewall
|
||||
networking.firewall.allowedTCPPorts = [cfg.port];
|
||||
networking.firewall.allowedUDPPorts = [cfg.port];
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user