refactor: den-native config, tunnel quirk, per-module inputs
This commit is contained in:
1 parent
0431bce152
commit
bfbac8b961
100 files changed
+668
-1417
No files matched your search
@@ -1,29 +0,0 @@
|
||||
{ ... }: {
|
||||
den.aspects.beszel = { host, ... }: {
|
||||
den.tunnels =
|
||||
if host.name == "box"
|
||||
then [ "fleet" ]
|
||||
else [];
|
||||
|
||||
nixos = { lib, ... }: {
|
||||
services.beszel.agent = {
|
||||
enable = true;
|
||||
|
||||
environment = {
|
||||
KEY = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMlX8zdofzg+vV0H6H5U54YIbTY/z0iPfD9LXupBY2jX";
|
||||
TOKEN = "30949ab5-3ed3-46c1-b606-4e4e66b847f9";
|
||||
HUB_URL = "https://fleet.bug.tools";
|
||||
SYSTEM_NAME = host.name;
|
||||
};
|
||||
|
||||
environmentFile = "/var/lib/beszel-agent/environment";
|
||||
};
|
||||
|
||||
services.beszel.hub = lib.mkIf (host.name == "box") {
|
||||
enable = true;
|
||||
host = "0.0.0.0";
|
||||
port = 8090;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
{ inputs, ... }: {
|
||||
den.aspects.bugtv = {
|
||||
#flake-file.inputs.bug-tv = {
|
||||
# url = "git+https://git.bug.tools/bug/tv.git";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
#};
|
||||
den.aspects.services.bugtv = let port = port; in {
|
||||
tunnel = { subdomain = "api-tv"; inherit port; };
|
||||
|
||||
nixos = { pkgs, ... }: {
|
||||
imports = [ inputs.bug-tv.nixosModules.default ];
|
||||
|
||||
den.tunnels = [ "api-tv" ];
|
||||
|
||||
services."bug-tv" = {
|
||||
enable = true;
|
||||
|
||||
|
||||
@@ -1,42 +1,43 @@
|
||||
{ inputs, ... }: {
|
||||
den.aspects.copyparty = {
|
||||
nixos = { config, ... }: {
|
||||
flake-file.inputs.copyparty.url = "github:9001/copyparty";
|
||||
den.aspects.services.copyparty = let port = 3210; in {
|
||||
tunnel = { subdomain = "files"; inherit port; };
|
||||
|
||||
nixos = { host, config, ... }: let user = host.owner; home = config.users.users.${user}.home; in {
|
||||
imports = [ inputs.copyparty.nixosModules.default ];
|
||||
|
||||
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
|
||||
|
||||
den.tunnels = [ "files" ];
|
||||
|
||||
services.copyparty = {
|
||||
enable = true;
|
||||
|
||||
user = "bug";
|
||||
inherit user;
|
||||
group = "copyparty";
|
||||
|
||||
settings = {
|
||||
i = "0.0.0.0";
|
||||
p = [ config.den.portmap.files (config.den.portmap.files + 1) ];
|
||||
p = [ port (port + 1) ];
|
||||
no-reload = true;
|
||||
ignored-flag = false;
|
||||
};
|
||||
|
||||
accounts = {
|
||||
bug = {
|
||||
passwordFile = "/home/bug/copyparty/bug.passwd";
|
||||
${user} = {
|
||||
passwordFile = "${home}/copyparty/${user}.passwd";
|
||||
};
|
||||
};
|
||||
|
||||
groups = {
|
||||
g1 = [ "bug" ];
|
||||
g1 = [ user ];
|
||||
};
|
||||
|
||||
volumes = {
|
||||
"/" = {
|
||||
path = "/home/bug/copyparty/public/";
|
||||
path = "${home}/copyparty/public/";
|
||||
|
||||
access = {
|
||||
r = "*";
|
||||
rwdma = [ "bug" ];
|
||||
rwdma = [ user ];
|
||||
};
|
||||
|
||||
flags = {
|
||||
@@ -46,11 +47,11 @@
|
||||
};
|
||||
|
||||
"/slsk" = {
|
||||
path = "/home/bug/slskd/complete/";
|
||||
path = "${home}/slskd/complete/";
|
||||
|
||||
access = {
|
||||
r = "*";
|
||||
rwdma = [ "bug" ];
|
||||
rwdma = [ user ];
|
||||
};
|
||||
|
||||
flags = {
|
||||
@@ -60,7 +61,7 @@
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
path = "/home/bug/nix/";
|
||||
path = "${home}/nix/";
|
||||
|
||||
access = {
|
||||
r = "*";
|
||||
@@ -73,11 +74,11 @@
|
||||
};
|
||||
|
||||
"/Music" = {
|
||||
path = "/home/bug/Music/";
|
||||
path = "${home}/Music/";
|
||||
|
||||
access = {
|
||||
r = "*";
|
||||
rwdma = [ "bug" ];
|
||||
rwdma = [ user ];
|
||||
};
|
||||
|
||||
flags = {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{
|
||||
den.aspects.gitea = {
|
||||
# includes = [ den.aspects.gitea-mirrors ];
|
||||
den.aspects.services.gitea = let port = 3002; in {
|
||||
tunnel = { subdomain = "git"; inherit port; };
|
||||
|
||||
nixos = { config, ... }: {
|
||||
den.tunnels = [ "git" ];
|
||||
nixos = { host, ... }: {
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
@@ -14,7 +13,8 @@
|
||||
DISABLE_REGISTRATION = false;
|
||||
};
|
||||
|
||||
settings.server.HTTP_PORT = config.den.portmap.git;
|
||||
settings.server.HTTP_PORT = port;
|
||||
settings.server.ROOT_URL = "https://git.${host.domain}/";
|
||||
|
||||
/*
|
||||
mirrors = {
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
{
|
||||
den.aspects.gitea-mirrors = {
|
||||
nixos = { pkgs, lib, config, ... }:
|
||||
let
|
||||
cfg = config.services.gitea;
|
||||
mcfg = cfg.mirrors;
|
||||
|
||||
uniqueOwners = lib.unique (
|
||||
(map (m: m.owner) mcfg.repos) ++
|
||||
(map (m: m.owner) mcfg.users)
|
||||
);
|
||||
|
||||
giteaUrl = "http://localhost:${toString cfg.settings.server.HTTP_PORT}";
|
||||
tokenFile = "${cfg.stateDir}/mirror-setup-token";
|
||||
|
||||
repoSource = m:
|
||||
if m ? source then m.source
|
||||
else if (m.service or "git") == "github" then "https://github.com/${m.owner}/${m.repo}.git"
|
||||
else if (m.service or "git") == "gitlab" then "https://gitlab.com/${m.owner}/${m.repo}.git"
|
||||
else throw "mirrors.repos: '${m.owner}/${m.repo}' has no source and service '${m.service or "git"}' needs an explicit source";
|
||||
|
||||
setupScript = pkgs.writeShellScript "gitea-mirror-setup" ''
|
||||
set -euo pipefail
|
||||
|
||||
GITEA_URL="${giteaUrl}"
|
||||
TOKEN_FILE="${tokenFile}"
|
||||
GITEA_CMD="${lib.getExe cfg.package}"
|
||||
|
||||
for i in $(seq 1 60); do
|
||||
if ${pkgs.curl}/bin/curl -sf "$GITEA_URL/api/v1/version" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
|
||||
$GITEA_CMD admin user create \
|
||||
--username "${mcfg.admin.user}" \
|
||||
--email "${mcfg.admin.email}" \
|
||||
--random-password \
|
||||
--admin \
|
||||
--must-change-password=false 2>/dev/null || true
|
||||
|
||||
if [ ! -f "$TOKEN_FILE" ]; then
|
||||
TOKEN=$($GITEA_CMD admin user generate-access-token \
|
||||
--username "${mcfg.admin.user}" \
|
||||
--token-name "mirror-setup" \
|
||||
--scopes "all" \
|
||||
--raw)
|
||||
echo "$TOKEN" > "$TOKEN_FILE"
|
||||
chmod 600 "$TOKEN_FILE"
|
||||
fi
|
||||
|
||||
TOKEN=$(cat "$TOKEN_FILE")
|
||||
AUTH="Authorization: token $TOKEN"
|
||||
|
||||
${lib.concatMapStringsSep "\n" (owner: ''
|
||||
RAND_PASS=$(${pkgs.openssl}/bin/openssl rand -base64 32)
|
||||
${pkgs.curl}/bin/curl -sf -X POST "$GITEA_URL/api/v1/admin/users" \
|
||||
-H "$AUTH" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"username\": \"${owner}\",
|
||||
\"email\": \"${owner}@git.bug.tools\",
|
||||
\"password\": \"$RAND_PASS\",
|
||||
\"must_change_password\": false,
|
||||
\"visibility\": \"public\"
|
||||
}" >/dev/null 2>&1 || true
|
||||
'') uniqueOwners}
|
||||
|
||||
${lib.concatMapStringsSep "\n" (m: ''
|
||||
${pkgs.curl}/bin/curl -sf -X POST "$GITEA_URL/api/v1/repos/migrate" \
|
||||
-H "$AUTH" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"clone_addr": "${repoSource m}",
|
||||
"repo_name": "${m.repo}",
|
||||
"repo_owner": "${m.owner}",
|
||||
"mirror": true,
|
||||
"private": false,
|
||||
"service": "${m.service or "git"}"
|
||||
}' >/dev/null 2>&1 || true
|
||||
'') mcfg.repos}
|
||||
|
||||
${lib.concatMapStringsSep "\n" (u:
|
||||
let
|
||||
platform = u.platform;
|
||||
owner = u.owner;
|
||||
baseUrl = u.baseUrl or (if platform == "github" then "https://api.github.com"
|
||||
else if platform == "gitlab" then "https://gitlab.com"
|
||||
else if platform == "gitea" then u.baseUrl
|
||||
else throw "mirrors.users: unsupported platform '${platform}', provide baseUrl");
|
||||
cloneBase = if platform == "github" then "https://github.com/${owner}"
|
||||
else if platform == "gitlab" then "${u.baseUrl or "https://gitlab.com"}/${owner}"
|
||||
else if platform == "gitea" then "${u.baseUrl}/${owner}"
|
||||
else throw "mirrors.users: unsupported platform '${platform}'";
|
||||
service = if platform == "github" then "github"
|
||||
else if platform == "gitlab" then "gitlab"
|
||||
else if platform == "gitea" then "gitea"
|
||||
else "git";
|
||||
jqExpr = if platform == "gitlab" then ".[].path" else ".[].name";
|
||||
pageSize = if platform == "gitea" then 50 else 100;
|
||||
pageSizeStr = toString pageSize;
|
||||
listUrl = if platform == "github" then "${baseUrl}/users/${owner}/repos?per_page=${pageSizeStr}&type=owner"
|
||||
else if platform == "gitlab" then "${baseUrl}/api/v4/users/${owner}/projects?per_page=${pageSizeStr}"
|
||||
else "${baseUrl}/api/v1/users/${owner}/repos?limit=${pageSizeStr}";
|
||||
in ''
|
||||
echo "Fetching repos for ${owner} from ${platform}..."
|
||||
PAGE=1
|
||||
while true; do
|
||||
REPOS=$(${pkgs.curl}/bin/curl -sf "${listUrl}&page=$PAGE" || echo "[]")
|
||||
|
||||
NAMES=$(echo "$REPOS" | ${pkgs.jq}/bin/jq -r '${jqExpr}')
|
||||
if [ -z "$NAMES" ] || [ "$NAMES" = "null" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
for REPO_NAME in $NAMES; do
|
||||
${pkgs.curl}/bin/curl -sf -X POST "$GITEA_URL/api/v1/repos/migrate" \
|
||||
-H "$AUTH" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"clone_addr\": \"${cloneBase}/$REPO_NAME.git\",
|
||||
\"repo_name\": \"$REPO_NAME\",
|
||||
\"repo_owner\": \"${owner}\",
|
||||
\"mirror\": true,
|
||||
\"private\": false,
|
||||
\"service\": \"${service}\"
|
||||
}" >/dev/null 2>&1 || true
|
||||
done
|
||||
|
||||
COUNT=$(echo "$REPOS" | ${pkgs.jq}/bin/jq 'length')
|
||||
if [ "$COUNT" -lt ${pageSizeStr} ]; then break; fi
|
||||
PAGE=$((PAGE + 1))
|
||||
done
|
||||
'') mcfg.users}
|
||||
|
||||
echo "Mirror setup complete."
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.services.gitea.mirrors = {
|
||||
admin = {
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "admin";
|
||||
description = "Gitea admin username for mirror management.";
|
||||
};
|
||||
|
||||
email = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "admin@localhost";
|
||||
description = "Gitea admin email.";
|
||||
};
|
||||
};
|
||||
|
||||
repos = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.attrsOf lib.types.str);
|
||||
default = [];
|
||||
description = "Individual repositories to mirror. Each entry: { owner, repo, service?, source? }. Source is auto-derived for github/gitlab.";
|
||||
example = [
|
||||
{ owner = "nixos"; repo = "nixpkgs"; service = "github"; }
|
||||
{ owner = "someone"; repo = "thing"; source = "https://custom.instance/someone/thing.git"; }
|
||||
];
|
||||
};
|
||||
|
||||
users = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.attrsOf lib.types.str);
|
||||
default = [];
|
||||
description = "Mirror all public repos of a user/org. Each entry: { owner, platform, baseUrl? }.";
|
||||
example = [
|
||||
{ owner = "catppuccin"; platform = "github"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (mcfg.repos != [] || mcfg.users != []) {
|
||||
services.gitea.settings.mirror = {
|
||||
DEFAULT_INTERVAL = "6h";
|
||||
MIN_INTERVAL = "10m";
|
||||
};
|
||||
|
||||
services.gitea.settings."cron.update_mirrors" = {
|
||||
SCHEDULE = "@every 10m";
|
||||
RUN_AT_START = true;
|
||||
};
|
||||
|
||||
systemd.services.gitea-mirror-setup = {
|
||||
description = "Setup Gitea mirror repositories";
|
||||
after = [ "gitea.service" ];
|
||||
requires = [ "gitea.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = cfg.user;
|
||||
Group = cfg.group;
|
||||
ExecStart = setupScript;
|
||||
WorkingDirectory = cfg.stateDir;
|
||||
Environment = [
|
||||
"GITEA_WORK_DIR=${cfg.stateDir}"
|
||||
"GITEA_CUSTOM=${cfg.customDir}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.timers.gitea-mirror-setup = {
|
||||
description = "Run Gitea mirror setup on boot and periodically";
|
||||
wantedBy = [ "timers.target" ];
|
||||
|
||||
timerConfig = {
|
||||
OnBootSec = "2min";
|
||||
OnUnitActiveSec = "6h";
|
||||
Unit = "gitea-mirror-setup.service";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
den.aspects.glances = {
|
||||
nixos = { pkgs, config, ... }: {
|
||||
den.tunnels = [ "monitor" ];
|
||||
den.aspects.services.glances = let port = 61208; in {
|
||||
tunnel = { subdomain = "monitor"; inherit port; };
|
||||
|
||||
nixos = { pkgs, ... }: {
|
||||
|
||||
environment.systemPackages = [ pkgs.glances ];
|
||||
|
||||
@@ -26,7 +27,7 @@
|
||||
ExecStart = ''
|
||||
${pkgs.glances}/bin/glances \
|
||||
-w \
|
||||
-p ${toString config.den.portmap.monitor} \
|
||||
-p ${toString port} \
|
||||
-B 0.0.0.0
|
||||
'';
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
{ lib, ... }: {
|
||||
den.aspects.invidious = {
|
||||
nixos = { pkgs, config, ... }: let
|
||||
den.aspects.services.invidious = let port = 3030; in {
|
||||
tunnel = { subdomain = "tube"; inherit port; };
|
||||
|
||||
nixos = { pkgs, host, ... }: let
|
||||
companionPort = 8282;
|
||||
companionPath = "/companion";
|
||||
companionKey = "kKg3RKeZjE7frmvr";
|
||||
port = config.den.portmap.tube;
|
||||
in {
|
||||
den.tunnels = [ "tube" ];
|
||||
|
||||
virtualisation.oci-containers = {
|
||||
backend = "podman";
|
||||
containers = {
|
||||
@@ -66,9 +65,9 @@
|
||||
http3-ytproxy.enable = true;
|
||||
|
||||
settings = {
|
||||
domain = "tube.bug.tools";
|
||||
domain = "tube.${host.domain}";
|
||||
#https_only = false;
|
||||
external_port = port;
|
||||
external_port = 443; # public URLs go through cloudflared on https, not :3030
|
||||
|
||||
invidious_companion = [
|
||||
{
|
||||
@@ -79,11 +78,11 @@
|
||||
invidious_companion_key = companionKey;
|
||||
|
||||
continue = true;
|
||||
local = false;
|
||||
local = true; # googlevideo URLs are bound to box's IP; proxy playback via companion
|
||||
check_tables = true;
|
||||
https_only = true;
|
||||
use_quic = false;
|
||||
admins = [ "bug" ];
|
||||
admins = [ host.owner ];
|
||||
use_pubsub_feeds = false;
|
||||
captcha_enabled = false;
|
||||
login_enabled = true;
|
||||
|
||||
@@ -1,29 +1,10 @@
|
||||
{ ... }: {
|
||||
den.aspects.llama = {
|
||||
{ den, ... }: {
|
||||
den.aspects.services.llama = let port = 8080; in {
|
||||
includes = [ (den.batteries.unfree [ "cccl" "cuda_compat" "cuda_crt" "cuda_cudart" "cuda_nvcc" "cuda_nvrtc" "libcublas" "libnvvm" ]) ];
|
||||
|
||||
tunnel = { subdomain = "llama"; inherit port; };
|
||||
|
||||
nixos = { pkgs, lib, ... }: {
|
||||
environment.systemPackages = [ pkgs.cloudflared ];
|
||||
environment.etc."cloudflared/608ba37a-1be8-49e8-be2d-abeb8b77081d.json".source = "/home/bug/.cloudflared/608ba37a-1be8-49e8-be2d-abeb8b77081d.json";
|
||||
|
||||
services.cloudflared = {
|
||||
enable = true;
|
||||
tunnels = {
|
||||
"608ba37a-1be8-49e8-be2d-abeb8b77081d" = {
|
||||
credentialsFile = "/etc/cloudflared/608ba37a-1be8-49e8-be2d-abeb8b77081d.json";
|
||||
|
||||
ingress = {
|
||||
"llama.bug.tools" = "http://127.0.0.1:8080";
|
||||
};
|
||||
|
||||
default = "http_status:404";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."cloudflared-tunnel-608ba37a-1be8-49e8-be2d-abeb8b77081d".environment = {
|
||||
TUNNEL_TRANSPORT_PROTOCOL = pkgs.lib.mkForce "http2";
|
||||
};
|
||||
|
||||
|
||||
services.llama-cpp = let
|
||||
# https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md
|
||||
modelsPreset = {
|
||||
@@ -75,7 +56,7 @@
|
||||
|
||||
settings = {
|
||||
host = "0.0.0.0";
|
||||
port = 8080;
|
||||
port = port;
|
||||
ctx-size = 65536;
|
||||
|
||||
models-max = 1;
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
den.aspects.mailserver = {
|
||||
nixos = {
|
||||
flake-file.inputs.nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
den.aspects.services.mailserver = let port = 8088; in {
|
||||
tunnel = [
|
||||
{ subdomain = "mail"; inherit port; }
|
||||
{ subdomain = "email"; inherit port; }
|
||||
];
|
||||
|
||||
nixos = { host, config, ... }: let user = host.owner; home = config.users.users.${user}.home; inherit (host) domain; in {
|
||||
imports = [ inputs.nixos-mailserver.nixosModules.default ];
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "security@bug.tools";
|
||||
defaults.email = "security@${domain}";
|
||||
|
||||
certs."mx.bug.tools" = {
|
||||
listenHTTP = "1360";
|
||||
certs."mx.${domain}" = {
|
||||
listenHTTP = ":1360";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,10 +24,10 @@
|
||||
|
||||
stateVersion = 4;
|
||||
|
||||
fqdn = "mx.bug.tools";
|
||||
domains = [ "bug.tools" ];
|
||||
fqdn = "mx.${domain}";
|
||||
domains = [ "${domain}" ];
|
||||
|
||||
x509.useACMEHost = "mx.bug.tools";
|
||||
x509.useACMEHost = "mx.${domain}";
|
||||
|
||||
fullTextSearch = {
|
||||
enable = true;
|
||||
@@ -30,51 +36,46 @@
|
||||
};
|
||||
|
||||
accounts = {
|
||||
"bug@bug.tools" = {
|
||||
hashedPasswordFile = "/home/bug/mailserver/bug.passwd";
|
||||
"${user}@${domain}" = {
|
||||
hashedPasswordFile = "${home}/mailserver/bug.passwd";
|
||||
aliases = [
|
||||
"admin@bug.tools"
|
||||
"security@bug.tools"
|
||||
"google@bug.tools"
|
||||
"apple@bug.tools"
|
||||
"roblox@bug.tools"
|
||||
"twitch@bug.tools"
|
||||
"discord@bug.tools"
|
||||
"github@bug.tools"
|
||||
"matrix@bug.tools"
|
||||
"git@bug.tools"
|
||||
"contact@bug.tools"
|
||||
"claude@bug.tools"
|
||||
"rumble@bug.tools"
|
||||
"bambu@bug.tools"
|
||||
"soulframe@bug.tools"
|
||||
"vortex@bug.tools"
|
||||
"codex@bug.tools"
|
||||
"tailscale@bug.tools"
|
||||
"firefox@bug.tools"
|
||||
"keldurn@bug.tools"
|
||||
"brax@bug.tools"
|
||||
"admin@${domain}"
|
||||
"security@${domain}"
|
||||
"google@${domain}"
|
||||
"apple@${domain}"
|
||||
"roblox@${domain}"
|
||||
"twitch@${domain}"
|
||||
"discord@${domain}"
|
||||
"github@${domain}"
|
||||
"matrix@${domain}"
|
||||
"git@${domain}"
|
||||
"contact@${domain}"
|
||||
"claude@${domain}"
|
||||
"rumble@${domain}"
|
||||
"bambu@${domain}"
|
||||
"soulframe@${domain}"
|
||||
"vortex@${domain}"
|
||||
"codex@${domain}"
|
||||
"tailscale@${domain}"
|
||||
"firefox@${domain}"
|
||||
"keldurn@${domain}"
|
||||
"brax@${domain}"
|
||||
];
|
||||
};
|
||||
|
||||
"pare@bug.tools" = {
|
||||
hashedPasswordFile = "/home/bug/mailserver/pare.passwd";
|
||||
"pare@${domain}" = {
|
||||
hashedPasswordFile = "${home}/mailserver/pare.passwd";
|
||||
};
|
||||
|
||||
"poop@bug.tools" = {
|
||||
hashedPasswordFile = "/home/bug/mailserver/pare.passwd";
|
||||
"poop@${domain}" = {
|
||||
hashedPasswordFile = "${home}/mailserver/pare.passwd";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
den.tunnels = [
|
||||
"mail"
|
||||
"email"
|
||||
];
|
||||
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
hostName = "mail.bug.tools";
|
||||
hostName = "mail.${domain}";
|
||||
extraConfig = ''
|
||||
$config['imap_host'] = 'ssl://localhost:993';
|
||||
$config['imap_conn_options'] = [
|
||||
@@ -86,20 +87,20 @@
|
||||
];
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['smtp_pass'] = "%p";
|
||||
$config['username_domain'] = 'bug.tools';
|
||||
$config['username_domain'] = '${domain}';
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.enable = true;
|
||||
|
||||
services.nginx.virtualHosts."mail.bug.tools" = {
|
||||
services.nginx.virtualHosts."mail.${domain}" = {
|
||||
forceSSL = false;
|
||||
enableACME = false;
|
||||
|
||||
listen = [
|
||||
{
|
||||
addr = "0.0.0.0";
|
||||
port = 8088;
|
||||
port = port;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{
|
||||
den.aspects.matrix = {
|
||||
den.aspects.services.matrix = {
|
||||
nixos = {
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
host,
|
||||
...
|
||||
}: let
|
||||
port = config.den.portmap.matrix;
|
||||
domain = "bug.tools";
|
||||
port = 8008;
|
||||
inherit (host) domain;
|
||||
matrixDomain = "matrix.${domain}";
|
||||
clientConfig = {
|
||||
"m.homeserver".base_url = "https://${matrixDomain}";
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1,16 +1,16 @@
|
||||
{
|
||||
den.aspects.mpd = {
|
||||
den.aspects.services.mpd = {
|
||||
homeManager = {
|
||||
services.mpd-mpris.enable = true;
|
||||
};
|
||||
|
||||
nixos = {
|
||||
nixos = { host, config, ... }: let user = host.owner; home = config.users.users.${user}.home; in {
|
||||
services = {
|
||||
mpd = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
music_directory = "/home/bug/Music";
|
||||
music_directory = "${home}/Music";
|
||||
|
||||
decoder = [
|
||||
{
|
||||
@@ -29,7 +29,7 @@
|
||||
}];
|
||||
};
|
||||
|
||||
user = "bug";
|
||||
inherit user;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
{ inputs, ... }: {
|
||||
den.aspects.omnisearch = {
|
||||
/*
|
||||
flake-file.inputs.omnisearch = {
|
||||
url = "git+https://git.bwaaa.monster/omnisearch";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
*/
|
||||
den.aspects.services.omnisearch = {
|
||||
tunnel = { subdomain = "omnisearch"; port = 8087; }; # module default port
|
||||
|
||||
nixos = {
|
||||
imports = [ inputs.omnisearch.nixosModules.default ];
|
||||
|
||||
den.tunnels = [ "omnisearch" ];
|
||||
|
||||
services.omnisearch.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
den.aspects.portmap.nixos = { lib, ... }: {
|
||||
options.den.portmap = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.port;
|
||||
default = {};
|
||||
description = "ports";
|
||||
};
|
||||
|
||||
config.den.portmap = {
|
||||
tvtun = 3001;
|
||||
search = 8888;
|
||||
files = 3210;
|
||||
tube = 3030;
|
||||
reddit = 8975;
|
||||
git = 3002;
|
||||
monitor = 61208;
|
||||
matrix = 8008;
|
||||
omnisearch = 8087;
|
||||
mail = 8088;
|
||||
email = 8088;
|
||||
llama = 8080;
|
||||
api-tv = 8789;
|
||||
seek = 8089;
|
||||
fleet = 8090;
|
||||
mpd = 6600;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
den.aspects.redlib = {
|
||||
nixos = { config, ... }: {
|
||||
den.tunnels = [ "reddit" ];
|
||||
|
||||
services.redlib = {
|
||||
enable = true;
|
||||
|
||||
address = "127.0.0.1";
|
||||
port = config.den.portmap.reddit;
|
||||
openFirewall = true;
|
||||
|
||||
settings = {
|
||||
SFW_ONLY = "off";
|
||||
ROBOTS_DISABLE_INDEXING = "on";
|
||||
ENABLE_RSS = "on";
|
||||
THEME = "system";
|
||||
FRONT_PAGE = "default";
|
||||
LAYOUT = "card";
|
||||
WIDE = "on";
|
||||
POST_SORT = "hot";
|
||||
COMMENT_SORT = "confidence";
|
||||
BLUR_SPOILER = "off";
|
||||
SHOW_NSFW = "on";
|
||||
BLUR_NSFW = "off";
|
||||
USE_HLS = "on";
|
||||
HIDE_HLS_NOTIFICATION = "off";
|
||||
AUTOPLAY_VIDEOS = "off";
|
||||
HIDE_AWARDS = "off";
|
||||
DISABLE_VISIT_REDDIT_CONFIRMATION = "off";
|
||||
HIDE_SCORE = "off";
|
||||
HIDE_SIDEBAR_AND_SUMMARY = "off";
|
||||
FIXED_NAVBAR = "on";
|
||||
REMOVE_DEFAULT_FEEDS = "off";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
{
|
||||
den.aspects.searxng = {
|
||||
nixos = { config, ... }: {
|
||||
den.tunnels = [ "search" ];
|
||||
den.aspects.services.searxng = let port = 8888; in {
|
||||
tunnel = { subdomain = "search"; inherit port; };
|
||||
|
||||
nixos = { host, config, ... }: let user = host.owner; home = config.users.users.${user}.home; in {
|
||||
systemd.services.searx-init.serviceConfig.EnvironmentFile = [
|
||||
"/home/bug/.searxng.env"
|
||||
"${home}/.searxng.env"
|
||||
];
|
||||
|
||||
services.searx = {
|
||||
enable = true;
|
||||
redisCreateLocally = false;
|
||||
configureUwsgi = false;
|
||||
settingsFile = ./searxng.yml;
|
||||
environmentFile = "/home/bug/.searxng.env";
|
||||
settingsFile = builtins.path { path = ./searxng.yml; name = "searxng.yml"; };
|
||||
environmentFile = "${home}/.searxng.env";
|
||||
|
||||
settings = {
|
||||
general.instance_name = "search.bug.tools";
|
||||
general.instance_name = "search.${host.domain}";
|
||||
|
||||
server.port = config.den.portmap.search;
|
||||
server.port = port;
|
||||
server.bind_address = "0.0.0.0";
|
||||
server.secret_key = "$SEARX_SECRET_KEY";
|
||||
};
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
den.aspects.sish = {
|
||||
nixos = {
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
+11
-10
@@ -1,32 +1,33 @@
|
||||
{ lib, inputs, ... }: {
|
||||
den.aspects.slskd = {
|
||||
nixos = { pkgs, config, ... }: {
|
||||
den.tunnels = [ "seek" ];
|
||||
den.aspects.services.slskd = let port = 8089; in {
|
||||
tunnel = { subdomain = "seek"; inherit port; };
|
||||
|
||||
nixos = { pkgs, host, config, ... }: let user = host.owner; home = config.users.users.${user}.home; in {
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
slskd
|
||||
];
|
||||
|
||||
systemd.services.slskd.serviceConfig = {
|
||||
ReadWritePaths = [ "/home/bug/slskd" ];
|
||||
ReadWritePaths = [ "${home}/slskd" ];
|
||||
ProtectHome = lib.mkForce false;
|
||||
};
|
||||
|
||||
services.slskd = {
|
||||
enable = true;
|
||||
user = "bug";
|
||||
inherit user;
|
||||
|
||||
settings.web.port = 8089;
|
||||
settings.web.port = port;
|
||||
|
||||
environmentFile = "/home/bug/slskd/env";
|
||||
environmentFile = "${home}/slskd/env";
|
||||
|
||||
settings = {
|
||||
directories = {
|
||||
downloads = "/home/bug/slskd/complete";
|
||||
incomplete = "/home/bug/slskd/incomplete";
|
||||
downloads = "${home}/slskd/complete";
|
||||
incomplete = "${home}/slskd/incomplete";
|
||||
};
|
||||
|
||||
shares.directories = [ "/home/bug/slskd/share" ];
|
||||
shares.directories = [ "${home}/slskd/share" ];
|
||||
|
||||
shares.filters = [
|
||||
"\\.ini$"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
den.aspects.vscode-server = {
|
||||
{ inputs, ... }: {
|
||||
flake-file.inputs.vscode-server.url = "github:nix-community/nixos-vscode-server";
|
||||
den.aspects.services.vscode-server = {
|
||||
nixos = {
|
||||
imports = [
|
||||
(fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master")
|
||||
inputs.vscode-server.nixosModules.default
|
||||
];
|
||||
|
||||
services.vscode-server.enable = true;
|
||||
|
||||
Reference in new issue
Block a user