formatting & test cuda support

This commit is contained in:
2026-05-03 12:03:57 -05:00
parent 4d552be249
commit f97d97a570
4 changed files with 70 additions and 61 deletions
+15 -15
View File
@@ -1,12 +1,15 @@
{ pkgs, nixpkgs-unstable, config, lib, ... }: {
pkgs,
let nixpkgs-unstable,
config,
lib,
...
}: let
service = "ollama"; service = "ollama";
cfg = config.homelab.${service}; cfg = config.homelab.${service};
sec = config.sops.secrets; sec = config.sops.secrets;
homelab = config.homelab; homelab = config.homelab;
in in {
{
options.homelab.${service} = { options.homelab.${service} = {
enable = lib.mkEnableOption "enables ${service}"; enable = lib.mkEnableOption "enables ${service}";
@@ -43,7 +46,6 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# declare ${service} group # declare ${service} group
users.groups.${service} = {gid = lib.mkForce cfg.ids;}; users.groups.${service} = {gid = lib.mkForce cfg.ids;};
@@ -69,13 +71,12 @@ in
host = "0.0.0.0"; host = "0.0.0.0";
port = cfg.port; port = cfg.port;
openFirewall = true; openFirewall = true;
acceleration = "vulkan"; acceleration = "cuda";
syncModels = true; syncModels = true;
loadModels = [ loadModels = [
"deepseek-r1:7b" "deepseek-r1:7b"
"deepseek-r1:14b" "deepseek-r1:14b"
]; ];
}; };
# override umask to make permissions work out # override umask to make permissions work out
@@ -94,14 +95,13 @@ in
''; '';
}; };
# add to glance # add to glance
homelab.glance.links.services = [{ # homelab.glance.links.services = [{
title = service; # title = service;
url = "https://git.${homelab.base_domain}"; # url = "https://git.${homelab.base_domain}";
error-url = "http://${homelab.host_ip}:${toString cfg.port}"; # error-url = "http://${homelab.host_ip}:${toString cfg.port}";
check-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 # manage secrets with sops
# sops.secrets = { # sops.secrets = {
+14 -10
View File
@@ -1,12 +1,15 @@
{ pkgs, nixpkgs-unstable, config, lib, ... }: {
pkgs,
let nixpkgs-unstable,
config,
lib,
...
}: let
service = "open-webui"; service = "open-webui";
cfg = config.homelab.${service}; cfg = config.homelab.${service};
sec = config.sops.secrets; sec = config.sops.secrets;
homelab = config.homelab; homelab = config.homelab;
in in {
{
options.homelab.${service} = { options.homelab.${service} = {
enable = lib.mkEnableOption "enables ${service}"; enable = lib.mkEnableOption "enables ${service}";
@@ -43,7 +46,6 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# declare ${service} group # declare ${service} group
users.groups.${service} = {gid = lib.mkForce cfg.ids;}; users.groups.${service} = {gid = lib.mkForce cfg.ids;};
@@ -87,14 +89,16 @@ in
''; '';
}; };
# add to glance # add to glance
homelab.glance.links.services = [{ homelab.glance.links.services = [
{
title = service; title = service;
url = "https://git.${homelab.base_domain}"; url = "https://ai.${homelab.base_domain}";
error-url = "http://${homelab.host_ip}:${toString cfg.port}"; error-url = "http://${homelab.host_ip}:${toString cfg.port}";
check-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 # manage secrets with sops
# sops.secrets = { # sops.secrets = {
+8 -7
View File
@@ -1,10 +1,11 @@
{ pkgs, config, lib, ... }:
let
cfg = config.homelab;
in
{ {
pkgs,
config,
lib,
...
}: let
cfg = config.homelab;
in {
options.homelab = { options.homelab = {
enable = lib.mkEnableOption "enable homelab services and configuration"; enable = lib.mkEnableOption "enable homelab services and configuration";
media_user = lib.mkOption { media_user = lib.mkOption {
@@ -41,10 +42,10 @@ in
# the order determines the order in glance :3 # the order determines the order in glance :3
imports = [ imports = [
./ai
./mediastack ./mediastack
./services ./services
./system ./system
./network ./network
./ai
]; ];
} }
+7 -3
View File
@@ -28,8 +28,14 @@ in {
#interface = "enp89s0"; #interface = "enp89s0";
bind-interfaces = true; bind-interfaces = true;
address = [ 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" "10.10.0.1"
]; ];
}; };
@@ -37,13 +43,11 @@ in {
systemd.services.dnsmasq.serviceConfig = { systemd.services.dnsmasq.serviceConfig = {
RestartSec = "5s"; RestartSec = "5s";
StartLimitIntervalSec = 60;
StartLimitBurst = 10; StartLimitBurst = 10;
}; };
# open firewall # open firewall
networking.firewall.allowedTCPPorts = [cfg.port]; networking.firewall.allowedTCPPorts = [cfg.port];
networking.firewall.allowedUDPPorts = [cfg.port]; networking.firewall.allowedUDPPorts = [cfg.port];
}; };
} }