move options

This commit is contained in:
2026-01-18 17:08:05 -06:00
parent d530844886
commit 96ab25c6ad
9 changed files with 4 additions and 583 deletions

View File

@@ -1,128 +0,0 @@
{ config, lib, nixpkgs-us, ... }: {
options = {
sysconfig.virtualization.ollama.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
};
config = lib.mkIf config.sysconfig.virtualization.ollama.enable {
networking = {
nat.internalInterfaces = [ "ve-ollama" ];
};
containers.ollama = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.24";
bindMounts = {
"/dev/nvidia0" = {
hostPath = "/dev/nvidia0";
isReadOnly = false;
};
"/dev/nvidiactl" = {
hostPath = "/dev/nvidiactl";
isReadOnly = false;
};
"/dev/nvidia-uvm" = {
hostPath = "/dev/nvidia-uvm";
isReadOnly = false;
};
"/dev/nvidia-modeset" = {
hostPath = "/dev/nvidia-modeset";
isReadOnly = false;
};
"/dev/nvidia-uvm-tools" = {
hostPath = "/dev/nvidia-uvm-tools";
isReadOnly = false;
};
"/etc/nvidia" = {
hostPath = "/etc/nvidia";
isReadOnly = false;
};
"/dev/dri" = {
hostPath = "/dev/dri";
isReadOnly = false;
};
"/dev/dri/renderD128" = {
hostPath = "/dev/dri/renderD128";
isReadOnly = false;
};
};
allowedDevices = [
{
node = "/dev/nvidia0";
modifier = "rw";
}
{
node = "/dev/nvidiactl";
modifier = "rw";
}
{
node = "/dev/nvidia-uvm";
modifier = "rw";
}
{
node = "/dev/nvidia-modeset";
modifier = "rw";
}
{
node = "/dev/nvidia-uvm-tools";
modifier = "rw";
}
/*
{
node = "/dev/dri";
modifier = "rw";
}
{
node = "/dev/dri/renderD128";
modifier = "rw";
}*/
];
config = {
services.ollama = {
enable = true;
acceleration = "cuda";
package = let
pkgs-us = import nixpkgs-us {
system = "x86_64-linux";
config.allowUnfree = true;
};
in pkgs-us.ollama-cuda;
environmentVariables = {
OLLAMA_CONTEXT_LENGTH = "24000";
};
host = "0.0.0.0";
loadModels = [ "llama3.1:8b" ];
openFirewall = true;
user = "ollama";
};
users.users.ollama.extraGroups = [ "video" "render" ];
systemd.services.ollama.serviceConfig = {
PrivateDevices = lib.mkForce false;
DevicePolicy = lib.mkForce "auto";
};
system.stateVersion = "25.05";
};
};
};
}

View File

@@ -1,204 +0,0 @@
{ config, lib, nixpkgs-us, ... }: {
options.sysconfig.virtualization.pihole.enable = lib.options.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.virtualization.pihole.enable {
/* sops.secrets."pihole/pass" = {};
sops.templates."pihole.env" = {
content = ''
WEBPASSWORD=${config.sops.placeholder."pihole/pass"}
'';
path = "/ssd1/Pihole/.env";
};
*/
networking = {
nameservers = [
"192.168.100.28"
"1.1.1.1"
"1.0.0.1"
];
nat.internalInterfaces = [ "ve-pihole" ];
/*firewall.interfaces."ve-traefik" = {
allowedTCPPorts = [ 53 80 ];
allowedUDPPorts = [ 53 ];
};*/
};
/*services = {
pihole-web = {
enable = true;
hostName = "pihole.local";
ports = [ 80 ];
};
pihole-ftl = {
enable = true;
openFirewallDNS = true;
openFirewallWebserver = true;
lists = [
{
url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts";
}
];
settings = {
dns = {
upstreams = [
#"127.0.0.1#5335"
"1.0.0.1"
"1.1.1.1"
];
cnameRecords = [
"traefik.local,local.internal.esotericbytes.com"
"pihole.local,local.internal.esotericbytes.com"
"hass.local,local.internal.esotericbytes.com"
];
};
misc.dnsmasq_lines = [ "interface=ve-traefik" ];
};
};
};*/
containers.pihole = {
autoStart = true;
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.28";
timeoutStartSec = "infinity";
config = let
pkgs-us = import nixpkgs-us { system = "x86_64-linux"; };
in {
/*imports = [
(import "${nixpkgs-us}/nixos/modules/services/networking/pihole-ftl.nix" { config = config.containers.pihole.config; inherit lib; pkgs = pkgs-us;})
(import "${nixpkgs-us}/nixos/modules/services/web-apps/pihole-web.nix" { config = config.containers.pihole.config; inherit lib; pkgs = pkgs-us;})
];*/
services = {
pihole-web = {
enable = true;
hostName = "pihole.local";
ports = [ 80 ];
};
pihole-ftl = {
enable = true;
openFirewallDNS = true;
openFirewallWebserver = true;
lists = [
{
url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts";
}
];
settings = {
dns = {
upstreams = [
#"127.0.0.1#5335"
"1.0.0.1"
"1.1.1.1"
];
cnameRecords = [
"traefik.local,local.internal.esotericbytes.com"
"pihole.local,local.internal.esotericbytes.com"
"hass.local,local.internal.esotericbytes.com"
];
};
misc.dnsmasq_lines = [ "except-interface=nonexisting" ];
};
};
/*unbound = {
enable = true;
resolveLocalQueries = false;
settings = {
server = {
interface = [ "127.0.0.1" ];
port = 5335;
access-control = [ "127.0.0.1 allow" ];
harden-glue = true;
harden-dnssec-stripped = true;
use-caps-for-id = false;
prefetch = true;
edns-buffer-size = 1232;
hide-identity = true;
hide-version = true;
};
forward-zone = [
{
name = "cloudflare";
forward-addr = [
"1.1.1.1#one.one.one.one"
"1.0.0.1#one.one.one.one"
];
forward-tls-upstream = true;
}
];
};
};*/
};
/*systemd.services.pihole-ftl-setup.preStart = ''
while [[ ! ''$(ip l | grep eth0 | grep UP) ]]; do sleep 1; done;
'';*/
systemd.network = {
enable = true;
networks."eth0" = {
linkConfig.RequiredForOnline = "yes";
dns = [
"1.1.1.1"
"1.0.0.1"
];
};
};
networking = {
useHostResolvConf = false;
firewall.allowedTCPPorts = [ 5335 ];
firewall.allowedUDPPorts = [ 5335 ];
};
system.stateVersion = "25.05";
};
};
};
}