push
This commit is contained in:
1 parent
c86ee98def
commit
a3163cdd43
29 files changed
+693
-231
No files matched your search
@@ -1,18 +1,18 @@
|
||||
{
|
||||
# Private Nix binary cache. Caches are created private; pulling needs a token (netrc).
|
||||
den.aspects.services.attic = let port = 8090; in {
|
||||
tunnel = { subdomain = "cache"; inherit port; };
|
||||
|
||||
nixos = { config, host, ... }: {
|
||||
services.atticd = {
|
||||
enable = true;
|
||||
# ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64=...
|
||||
|
||||
environmentFile = "${config.users.users.${host.owner}.home}/.config/attic/env";
|
||||
|
||||
settings = {
|
||||
listen = "127.0.0.1:${toString port}";
|
||||
# No api-endpoint: CI uploads stay on localhost (Cloudflare caps bodies at 100MB).
|
||||
|
||||
substituter-endpoint = "https://cache.${host.domain}/";
|
||||
# Big NARs (darling rootfs) dedupe better in chunks.
|
||||
|
||||
chunking = {
|
||||
nar-size-threshold = 64 * 1024;
|
||||
min-size = 16 * 1024;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
den.quirks.tunnel.description = "cloudflared ingress: { subdomain, port, scheme ? \"http\" }";
|
||||
|
||||
# per host: den.hosts.<sys>.<host>.cloudflared = { uuid = "..."; protocol = "http2"; # optional };
|
||||
den.aspects.services.cloudflared = {
|
||||
nixos = { tunnel, host, pkgs, lib, config, ... }: let
|
||||
inherit (host.cloudflared) uuid;
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
};
|
||||
|
||||
"/Music" = {
|
||||
path = "${home}/Music/";
|
||||
path = "${home}/media/music/";
|
||||
|
||||
access = {
|
||||
r = "*";
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
{
|
||||
# Gitea Actions runner on box itself; jobs run directly on the host (label "native").
|
||||
den.aspects.services.gitea-runner.nixos = { config, host, pkgs, ... }: let
|
||||
home = config.users.users.${host.owner}.home;
|
||||
in {
|
||||
# Owner's GitHub SSH key, readable by jobs at $CREDENTIALS_DIRECTORY/github; never in Gitea.
|
||||
systemd.services."gitea-runner-${config.networking.hostName}".serviceConfig.LoadCredential = [ "github:${home}/.ssh/id_rsa" ];
|
||||
|
||||
services.gitea-actions-runner.instances.${config.networking.hostName} = {
|
||||
enable = true;
|
||||
name = config.networking.hostName;
|
||||
url = "http://127.0.0.1:${toString config.services.gitea.settings.server.HTTP_PORT}";
|
||||
# TOKEN=<registration token from `gitea actions generate-runner-token`>
|
||||
|
||||
tokenFile = "${config.users.users.${host.owner}.home}/.config/gitea-runner/token";
|
||||
labels = [ "native:host" ];
|
||||
hostPackages = with pkgs; [ bash coreutils gnused gnugrep findutils git openssh curl jq nix nodejs attic-client ];
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
systemd.services.glances-web = {
|
||||
description = "glances web interface";
|
||||
# after = [ "network-online.target" ];
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
|
||||
@@ -17,41 +17,12 @@
|
||||
"companioncache:/var/tmp/youtubei.js:rw"
|
||||
];
|
||||
environment = {
|
||||
# Same as configured on invidious above.
|
||||
SERVER_SECRET_KEY = companionKey;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/*virtualisation.podman.enable = true;
|
||||
virtualisation.oci-containers.backend = lib.mkDefault "podman";
|
||||
|
||||
virtualisation.oci-containers.containers.invidious-companion = {
|
||||
image = "quay.io/invidious/invidious-companion:master-5652eda";
|
||||
extraOptions = [ "--network=host" "--pull=always" ];
|
||||
|
||||
environment = {
|
||||
SERVER_SECRET_KEY = companionKey;
|
||||
HOST = "127.0.0.1";
|
||||
PORT = toString companionPort;
|
||||
SERVER_BASE_URL = "http://127.0.0.1:${toString companionPort}";
|
||||
|
||||
# HTTP_PROXY = "http://proxy.example:3128";
|
||||
# HTTPS_PROXY = "http://proxy.example:3128";
|
||||
# NO_PROXY = "127.0.0.1,localhost";
|
||||
|
||||
CACHE_DIRECTORY = "/var/tmp";
|
||||
NETWORKING_VIDEOPLAYBACK_UMP = "false";
|
||||
NETWORKING_FETCH_RETRY_ENABLED = "true";
|
||||
NETWORKING_FETCH_RETRY_TIMES = "3";
|
||||
NETWORKING_FETCH_RETRY_INITIAL_DEBOUNCE = "500"; # ms
|
||||
NETWORKING_FETCH_RETRY_DEBOUNCE_MULTIPLIER = "2";
|
||||
#JOBS_YOUTUBE_SESSION_PO_TOKEN_ENABLED = "false";
|
||||
#YOUTUBE_SESSION_OAUTH_ENABLED = "true";
|
||||
};
|
||||
};*/
|
||||
|
||||
services.invidious = {
|
||||
enable = true;
|
||||
package = pkgs.invidious;
|
||||
@@ -67,7 +38,7 @@
|
||||
settings = {
|
||||
domain = "tube.${host.domain}";
|
||||
#https_only = false;
|
||||
external_port = 443; # public URLs go through cloudflared on https, not :3030
|
||||
external_port = 443;
|
||||
|
||||
invidious_companion = [
|
||||
{
|
||||
@@ -78,7 +49,7 @@
|
||||
invidious_companion_key = companionKey;
|
||||
|
||||
continue = true;
|
||||
local = true; # googlevideo URLs are bound to box's IP; proxy playback via companion
|
||||
local = true;
|
||||
check_tables = true;
|
||||
https_only = true;
|
||||
use_quic = false;
|
||||
@@ -90,12 +61,6 @@
|
||||
statistics_enabled = true;
|
||||
};
|
||||
};
|
||||
|
||||
/*systemd.services.invidious = let dep = "podman-invidious-companion.service"; in {
|
||||
wants = [ dep ];
|
||||
after = [ dep ];
|
||||
requires = [ dep ];
|
||||
};*/
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -6,12 +6,10 @@
|
||||
|
||||
nixos = { pkgs, lib, ... }: {
|
||||
services.llama-cpp = let
|
||||
# https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md
|
||||
modelsPreset = {
|
||||
"*" = rec {
|
||||
# keep-sorted start
|
||||
agent = true;
|
||||
cache-ram = 0; # unified memory
|
||||
cache-ram = 0;
|
||||
cache-type-k = "q8_0";
|
||||
cache-type-v = "q8_0";
|
||||
ctx-size = 256 * 256 * parallel;
|
||||
@@ -26,28 +24,23 @@
|
||||
sleep-idle-seconds = -1;
|
||||
spec-draft-type-k = "q8_0";
|
||||
spec-draft-type-v = "q8_0";
|
||||
# keep-sorted end
|
||||
};
|
||||
};
|
||||
|
||||
"qwen3.6-35b-a3b" = {
|
||||
# keep-sorted start
|
||||
hf-repo = "unsloth/Qwen3.6-35B-A3B-GGUF:UD-Q4_K_XL";
|
||||
min-p = 0.0;
|
||||
temperature = 1.0;
|
||||
top-k = 20;
|
||||
top-p = 0.95;
|
||||
# keep-sorted end
|
||||
};
|
||||
|
||||
"qwen3.8-27b" = {
|
||||
# keep-sorted start
|
||||
ctx-size = 32768; # drop from the 65536 default to leave VRAM headroom at Q6
|
||||
ctx-size = 32768;
|
||||
hf-repo = "unsloth/Qwen3.8-27B-GGUF:UD-Q6_K";
|
||||
min-p = 0.0;
|
||||
temperature = 1.0;
|
||||
top-k = 20;
|
||||
top-p = 0.95;
|
||||
# keep-sorted end
|
||||
};
|
||||
};
|
||||
in {
|
||||
|
||||
+15
-49
@@ -1,44 +1,27 @@
|
||||
{
|
||||
den.aspects.services.matrix = {
|
||||
nixos = {
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
host,
|
||||
...
|
||||
}: let
|
||||
port = 8008;
|
||||
den.aspects.services.matrix = let port = 8008; in {
|
||||
tunnel = { subdomain = "matrix"; inherit port; };
|
||||
|
||||
nixos = { lib, host, ... }: let
|
||||
inherit (host) domain;
|
||||
matrixDomain = "matrix.${domain}";
|
||||
clientConfig = {
|
||||
"m.homeserver".base_url = "https://${matrixDomain}";
|
||||
"m.identity_server" = {};
|
||||
};
|
||||
serverConfig = {
|
||||
"m.server" = "${matrixDomain}:443";
|
||||
};
|
||||
mkWellKnown = data: ''
|
||||
default_type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
return 200 '${builtins.toJSON data}';
|
||||
'';
|
||||
secret = "/var/lib/matrix-synapse/registration_secret";
|
||||
in {
|
||||
services.matrix-synapse = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server_name = domain;
|
||||
public_baseurl = "https://${matrixDomain}";
|
||||
public_baseurl = "https://matrix.${domain}";
|
||||
|
||||
listeners = [
|
||||
{
|
||||
port = port;
|
||||
bind_addresses = ["127.0.0.1"];
|
||||
inherit port;
|
||||
bind_addresses = [ "127.0.0.1" ];
|
||||
type = "http";
|
||||
tls = false;
|
||||
x_forwarded = true;
|
||||
resources = [
|
||||
{
|
||||
names = ["client" "federation"];
|
||||
names = [ "client" "federation" ];
|
||||
compress = true;
|
||||
}
|
||||
];
|
||||
@@ -59,7 +42,7 @@
|
||||
url_preview_enabled = true;
|
||||
enable_registration = false;
|
||||
enable_metrics = false;
|
||||
registration_shared_secret_path = "/var/lib/matrix-synapse/registration_secret";
|
||||
registration_shared_secret_path = secret;
|
||||
|
||||
trusted_key_servers = [
|
||||
{
|
||||
@@ -69,9 +52,13 @@
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.matrix-synapse.preStart = lib.mkBefore ''
|
||||
[ -s ${secret} ] || (umask 077; head -c 32 /dev/urandom | base64 | tr -d '\n' > ${secret})
|
||||
'';
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = ["matrix-synapse"];
|
||||
ensureDatabases = [ "matrix-synapse" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "matrix-synapse";
|
||||
@@ -79,27 +66,6 @@
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown serverConfig;
|
||||
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown clientConfig;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${matrixDomain} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString port}";
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Host $host;
|
||||
client_max_body_size 100M;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
# MPD on the server: plays ~/Music into an Opus HTTP stream, no local speakers.
|
||||
# MPD on the server: plays ~/media/music into an Opus HTTP stream, no local speakers.
|
||||
# music.<domain> = audio stream, mpd.<domain> = MPD protocol (via `cloudflared access tcp` on clients).
|
||||
# Password: ~/.config/mpd/password (same file on every device, chmod 600).
|
||||
den.aspects.services.mpd = {
|
||||
@@ -19,7 +19,7 @@
|
||||
}];
|
||||
|
||||
settings = {
|
||||
music_directory = "${home}/Music";
|
||||
music_directory = "${home}/media/music";
|
||||
|
||||
decoder = [
|
||||
{ plugin = "ffmpeg"; enabled = "yes"; }
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
*/
|
||||
|
||||
den.aspects.services.omnisearch = {
|
||||
tunnel = { subdomain = "omnisearch"; port = 8087; }; # module default port
|
||||
tunnel = { subdomain = "omnisearch"; port = 8087; };
|
||||
|
||||
nixos = {
|
||||
imports = [ inputs.omnisearch.nixosModules.default ];
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
services.redlib = {
|
||||
enable = true;
|
||||
|
||||
# upstream main with the wreq TLS-fingerprint fix for Reddit OAuth 401s
|
||||
package = pkgs.redlib.overrideAttrs (old: rec {
|
||||
version = "0.36.0-unstable-2026-04-24";
|
||||
|
||||
@@ -22,7 +21,6 @@
|
||||
hash = "sha256-eO3c7rlFna3DuO31etJ6S4c7NmcvgvIWZ1KVkNIuUqQ=";
|
||||
};
|
||||
|
||||
# BoringSSL via boring-sys2
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ (with pkgs; [
|
||||
cmake go perl git rustPlatform.bindgenHook
|
||||
]);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
systemd.services.slskd.serviceConfig = {
|
||||
ReadWritePaths = [ "${home}/slskd" ];
|
||||
ProtectHome = lib.mkForce false;
|
||||
ReadOnlyPaths = lib.mkForce [ ];
|
||||
};
|
||||
|
||||
services.slskd = {
|
||||
|
||||
Reference in new issue
Block a user