Compare commits

..

No commits in common. "3b28f09e04428dd9e3aec32dff5616c9e05b9636" and "36c8e99d7efcf827b6fb7ba86778d6a21dedef29" have entirely different histories.

10 changed files with 87 additions and 38 deletions

24
flake.lock generated
View File

@ -319,16 +319,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1731880681, "lastModified": 1726989464,
"narHash": "sha256-FmYTkIyPBUxSWgA7DPIVTsCCMvSSbs56yOtHpLNSnKg=", "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "aecd341dfead1c3ef7a3c15468ecd71e8343b7c6", "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-24.11", "ref": "release-24.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -352,7 +352,7 @@
"local-unstable": { "local-unstable": {
"locked": { "locked": {
"lastModified": 0, "lastModified": 0,
"narHash": "sha256-uewgkTWbDOpOP+wEA3f03XEKsPHsJi0iDqBGQnxWQo0=", "narHash": "sha256-9xAEU7FSzN5kEu+LGYSQwoYySauT7XmyxCTfkdS6eBs=",
"path": "/home/giulio/dev/nixpkgs", "path": "/home/giulio/dev/nixpkgs",
"type": "path" "type": "path"
}, },
@ -481,11 +481,11 @@
}, },
"nixos-unstable": { "nixos-unstable": {
"locked": { "locked": {
"lastModified": 1731955258, "lastModified": 1731762464,
"narHash": "sha256-3p5dNocIBvqugZyMLnT7gjE9DF2WV5kVbVlLTbYI+eQ=", "narHash": "sha256-kr+46IEV/3hqO/IlXvucFeNpVkrNRvIhHFnEv/k381s=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2b552e98ea099d6b7d1a809e32a478f1f6258dd1", "rev": "0361bb03c0bad5f32e7d3010da3921cba20b3126",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -497,16 +497,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1731951205, "lastModified": 1731737433,
"narHash": "sha256-9YhDFPy6K7vUA9NVvlIrV0dFxrARqKgTFhst94yblkM=", "narHash": "sha256-pT/lio7wmcXBZreoQ3xsPYd2wGvlFNKnottDYpwJSfs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "0054a256665f0df8d61b4df921280d6994f2c284", "rev": "3c1c28c6d6691914707719d33f2e88b0feb7c58d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "release-24.11", "ref": "release-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@ -1,11 +1,11 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
nixos-unstable.url = "github:NixOS/nixpkgs/master"; nixos-unstable.url = "github:NixOS/nixpkgs/master";
local-unstable.url = "path:///home/giulio/dev/nixpkgs"; local-unstable.url = "path:///home/giulio/dev/nixpkgs";
teslamate-flake.url = "github:teslamate-org/teslamate/v1.31.1"; teslamate-flake.url = "github:teslamate-org/teslamate/v1.31.1";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.11"; url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nvidia-patch = { nvidia-patch = {

View File

@ -28,11 +28,20 @@ in
./dns.nix ./dns.nix
# ./minecraft.nix # ./minecraft.nix
./prowlarr.nix ./prowlarr.nix
./redlib.nix ./libreddit.nix
# ./invidious.nix # ./invidious.nix
# ./lidarr.nix
./navidrome.nix
./jellyfin.nix ./jellyfin.nix
# ./prosody.nix
# ./deluge.nix
#./calibre.nix
./docker.nix ./docker.nix
# ./keycloak.nix
# ./runas.nix
./tailscale.nix ./tailscale.nix
# ./searx.nix
# ./plex.nix
./headscale.nix ./headscale.nix
./llm.nix ./llm.nix
# ./photoprism.nix # ./photoprism.nix
@ -129,6 +138,7 @@ in
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
extraPackages = with pkgs; [ vaapiVdpau ]; extraPackages = with pkgs; [ vaapiVdpau ];
driSupport = true;
}; };
services = { services = {

View File

@ -26,23 +26,20 @@ in
enable = true; enable = true;
package = headscalePkg; package = headscalePkg;
port = 1194; port = 1194;
settings = { settings = {
server_url = "https://${domain}"; server_url = "https://${domain}";
# log.level = "debug"; log.level = "debug";
dns = { dns_config = {
magic_dns = false; magic_dns = false;
# base_domain = domain; base_domain = domain;
override_local_dns = true; override_local_dns = true;
global = [ nameservers = [
config.architect.networks.tailscale.devices.architect.address
];
nameservers.global = [
config.architect.networks.tailscale.devices.architect.address config.architect.networks.tailscale.devices.architect.address
]; ];
}; };
logtail.enabled = false; logtail.enabled = false;
prefixes.v4 = config.architect.networks.tailscale.net; ip_prefixes = [ config.architect.networks.tailscale.net ];
noise.private_key_path = "/var/lib/headscale/noise_private.key"; noise.private_key_path = "/var/lib/headscale/noise_private.key";
}; };
}; };

View File

@ -4,7 +4,7 @@ let
domain = "reddit.giugl.io"; domain = "reddit.giugl.io";
in in
{ {
systemd.services.redlib.environment = { systemd.services.libreddit.environment = {
REDLIB_ROBOTS_DISABLE_INDEXING = "on"; REDLIB_ROBOTS_DISABLE_INDEXING = "on";
REDLIB_DEFAULT_THEME = "dracula"; REDLIB_DEFAULT_THEME = "dracula";
REDLIB_DEFAULT_SHOW_NSFW = "on"; REDLIB_DEFAULT_SHOW_NSFW = "on";
@ -13,7 +13,7 @@ in
REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION = "on"; REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION = "on";
}; };
services.redlib = { services.libreddit = {
enable = true; enable = true;
port = 9090; port = 9090;
package = pkgs.unstablePkgs.redlib; package = pkgs.unstablePkgs.redlib;
@ -22,7 +22,7 @@ in
architect.vhost.${domain} = { architect.vhost.${domain} = {
dnsInterfaces = [ "lan" "tailscale" ]; dnsInterfaces = [ "lan" "tailscale" ];
locations."/" = { locations."/" = {
port = config.services.redlib.port; port = config.services.libreddit.port;
allowWAN = true; allowWAN = true;
}; };
}; };

View File

@ -1,9 +1,11 @@
{ pkgs, ... }: { pkgs, ... }:
let let
frontendDomain = "pino.giugl.io";
backendDomain = "ollama.giugl.io"; backendDomain = "ollama.giugl.io";
ollamaHost = "127.0.0.1"; frontendPort = 3030;
ollamaPort = 11434; ollamaPort = 11434;
listenAddress = "127.0.0.1:${toString ollamaPort}";
ollamaPkg = pkgs.unstablePkgs.ollama; ollamaPkg = pkgs.unstablePkgs.ollama;
in in
{ {
@ -12,23 +14,37 @@ in
}; };
services.ollama = { services.ollama = {
enable = true; inherit listenAddress;
package = ollamaPkg; enable = true;
host = ollamaHost;
port = ollamaPort;
acceleration = "cuda"; acceleration = "cuda";
package = ollamaPkg;
environmentVariables = { environmentVariables = {
# OLLAMA_ORIGINS = "10.0.0.0/24";
OLLAMA_FLASH_ATTENTION = "1"; OLLAMA_FLASH_ATTENTION = "1";
OLLAMA_NUM_PARALLEL = "2"; OLLAMA_NUM_PARALLEL = "2";
}; };
}; };
# architect.vhost.${frontendDomain} = {
# dnsInterfaces = [ "tailscale" "lan" ];
# locations."/" = {
# host = "127.0.0.1";
# port = frontendPort;
# allowLan = true;
# allowWAN = true;
# extraConfig = ''
# proxy_read_timeout 600s;
# '';
# };
# };
architect.vhost.${backendDomain} = { architect.vhost.${backendDomain} = {
dnsInterfaces = [ "tailscale" "lan" ]; dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = { locations."/" = {
host = ollamaHost; host = "127.0.0.1";
port = ollamaPort; port = ollamaPort;
allowLan = true; allowLan = true;
allowWAN = true; allowWAN = true;
@ -40,4 +56,28 @@ in
''; '';
}; };
}; };
# virtualisation.oci-containers = {
# containers = {
# ollama-webui = {
# image = "ghcr.io/open-webui/open-webui:main";
# autoStart = true;
# ports = [
# "127.0.0.1:${toString frontendPort}:8080"
# ];
# environment = {
# OLLAMA_BASE_URL = "https://${backendDomain}";
# };
# extraOptions = [
# "--pull=always"
# ];
# volumes = [
# "/var/lib/ollama-webui:/app/backend/data"
# ];
# };
# };
# };
} }

View File

@ -30,7 +30,7 @@ let
executable = true; executable = true;
destination = "/bin/resolution.sh"; destination = "/bin/resolution.sh";
}; };
sunshinePkg = (pkgs.localPkgs.sunshine.override { cudaSupport = true; cudaPackages = pkgs.cudaPackages_12_3; boost = pkgs.boost186; }); sunshinePkg = (pkgs.localPkgs.sunshine.override { cudaSupport = true; cudaPackages = pkgs.cudaPackages; boost = pkgs.unstablePkgs.boost186; });
in in
{ {
boot.kernelModules = [ "uinput" ]; boot.kernelModules = [ "uinput" ];
@ -38,7 +38,7 @@ in
environment.systemPackages = [ pkgs.unstablePkgs.gamemode ]; environment.systemPackages = [ pkgs.unstablePkgs.gamemode ];
hardware = { hardware = {
pulseaudio.enable = false; pulseaudio.enable = true;
nvidia = { nvidia = {
modesetting.enable = true; modesetting.enable = true;
@ -203,6 +203,8 @@ in
}; };
}; };
sound.enable = true;
systemd.targets = { systemd.targets = {
sleep.enable = false; sleep.enable = false;
suspend.enable = false; suspend.enable = false;

View File

@ -37,7 +37,7 @@
useGlobalPkgs = true; useGlobalPkgs = true;
}; };
system.stateVersion = "24.11"; system.stateVersion = "24.05";
} }
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager

View File

@ -23,6 +23,6 @@
] ]
++ lib.optional (!pkgs.stdenv.isDarwin) pastebinit; ++ lib.optional (!pkgs.stdenv.isDarwin) pastebinit;
stateVersion = "24.11"; stateVersion = "24.05";
}; };
} }

View File

@ -11,7 +11,7 @@ in
oh-my-zsh = { oh-my-zsh = {
enable = true; enable = true;
plugins = [ "git" "sudo" "docker" "docker-compose" "systemd" ]; plugins = [ "git" "sudo" "docker" "docker-compose" "adb" "systemd" ];
theme = "bira"; theme = "bira";
}; };
autosuggestion.enable = false; autosuggestion.enable = false;