Compare commits

3 Commits
Author SHA1 Message Date
oqyude cc12ab5bba refactoring 2026-08-10 03:36:19 +03:00
oqyude e66bbef553 3x-ui on server 2026-08-09 23:51:49 +03:00
oqyude 5b3da95fc2 path refactoring 2026-08-09 01:11:23 +03:00
18 changed files with 181 additions and 183 deletions
+13 -8
View File
@@ -6,9 +6,12 @@
... ...
}: }:
let let
stable = import inputs.nixpkgs-previous { # stable = import inputs.nixpkgs-previous {
system = "x86_64-linux"; # system = "x86_64-linux";
}; # };
libraryDir = "${xlib.dirs.services-mnt-folder}/calibre-web-library";
sourceDir = "${xlib.dirs.services-mnt-folder}/calibre-web";
targetDir = "/var/lib/calibre-web";
in in
{ {
services = { services = {
@@ -17,7 +20,7 @@ in
enable = true; enable = true;
# dataDir = "${xlib.dirs.services-mnt-folder}/calibre-web"; # dataDir = "${xlib.dirs.services-mnt-folder}/calibre-web";
options = { options = {
calibreLibrary = "${xlib.dirs.services-mnt-folder}/calibre-web-library"; calibreLibrary = "${libraryDir}";
enableBookUploading = true; enableBookUploading = true;
enableKepubify = true; enableKepubify = true;
enableBookConversion = false; enableBookConversion = false;
@@ -40,13 +43,15 @@ in
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d ${xlib.dirs.services-mnt-folder}/calibre-web 0755 calibre-web calibre-web -" "d ${libraryDir} 0755 calibre-web calibre-web -"
"d ${xlib.dirs.services-mnt-folder}/calibre-web-library 0755 calibre-web calibre-web -" "d ${sourceDir} 0755 calibre-web calibre-web -"
"Z ${libraryDir} 0755 calibre-web calibre-web -"
"Z ${sourceDir} 0755 calibre-web calibre-web -"
]; ];
fileSystems = { fileSystems = {
"/var/lib/calibre-web" = { "${targetDir}" = {
device = "${xlib.dirs.services-mnt-folder}/calibre-web"; device = "${sourceDir}";
fsType = "none"; fsType = "none";
options = [ options = [
"bind" "bind"
+8 -3
View File
@@ -1,9 +1,11 @@
{ {
lib, lib,
xlib,
... ...
}: }:
{ {
imports = [ imports = [
../containers/3x-ui.nix
../software/beets ../software/beets
./acme.nix ./acme.nix
./bentopdf.nix ./bentopdf.nix
@@ -23,9 +25,9 @@
./postgresql.nix ./postgresql.nix
./power.nix ./power.nix
./samba.nix ./samba.nix
# ./step-ca.nix
./syncthing.nix ./syncthing.nix
./systemd.nix ./systemd.nix
./uptime-kuma.nix
# ../containers/remnawave.nix # ../containers/remnawave.nix
# ./coturn.nix # ./coturn.nix
# ./mealie.nix # ./mealie.nix
@@ -33,13 +35,16 @@
# ./n8n.nix # ./n8n.nix
# ./netdata.nix # ./netdata.nix
# ./nfs.nix # ./nfs.nix
# ./node-red.nix
# ./open-webui.nix # ./open-webui.nix
# ./rsync.nix # ./rsync.nix
# ./step-ca.nix
# ./stirling-pdf.nix # ./stirling-pdf.nix
# ./transmission.nix # ./transmission.nix
# ./trilium.nix # ./trilium.nix
# ./uptime-kuma.nix
# ./zerotier.nix # ./zerotier.nix
]; ];
systemd.tmpfiles.rules = [
"d /mnt 0755 root root -"
"d ${xlib.dirs.services-mnt-folder} 0755 root root -"
];
} }
+20 -18
View File
@@ -5,8 +5,8 @@
... ...
}: }:
let let
configDir = "${xlib.dirs.services-mnt-folder}/homebox"; sourceDir = "${xlib.dirs.services-mnt-folder}/homebox";
varDir = "/var/lib/homebox"; targetDir = "/var/lib/homebox";
in in
{ {
services.homebox = { services.homebox = {
@@ -14,31 +14,33 @@ in
settings = { settings = {
HBOX_WEB_HOST = "0.0.0.0"; HBOX_WEB_HOST = "0.0.0.0";
HBOX_WEB_PORT = "7745"; HBOX_WEB_PORT = "7745";
HBOX_STORAGE_CONN_STRING = "file://${varDir}"; HBOX_STORAGE_CONN_STRING = "file://${targetDir}";
HBOX_STORAGE_PREFIX_PATH = "data"; HBOX_STORAGE_PREFIX_PATH = "data";
HBOX_DATABASE_DRIVER = "sqlite3"; HBOX_DATABASE_DRIVER = "sqlite3";
HBOX_DATABASE_SQLITE_PATH = "${varDir}/data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1"; HBOX_DATABASE_SQLITE_PATH = "${targetDir}/data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1";
HBOX_OPTIONS_ALLOW_REGISTRATION = "true"; HBOX_OPTIONS_ALLOW_REGISTRATION = "true";
HBOX_OPTIONS_GITHUB_RELEASE_CHECK = "false"; HBOX_OPTIONS_GITHUB_RELEASE_CHECK = "false";
HBOX_MODE = "production"; HBOX_MODE = "production";
HOME = "${varDir}"; HOME = "${targetDir}";
TMPDIR = "${varDir}/tmp"; TMPDIR = "${targetDir}/tmp";
}; };
}; };
systemd.tmpfiles.rules = [ systemd = {
"d ${configDir} 0755 homebox homebox -" tmpfiles.rules = [
"z ${configDir} 0755 homebox homebox -" "d ${sourceDir} 0755 homebox homebox -"
"z ${sourceDir} 0755 homebox homebox -"
]; ];
mounts = [
fileSystems = { {
"${varDir}" = { enable = true;
device = "${configDir}"; options = "bind,x-systemd.automount,nofail";
fsType = "none"; requires = [ "local-fs.target" ];
options = [ type = "none";
"bind" wantedBy = [ "multi-user.target" ];
"nofail" what = "${sourceDir}";
where = "${targetDir}";
}
]; ];
}; };
};
} }
-1
View File
@@ -12,7 +12,6 @@
CLEANUP_FREQUENCY = 48; CLEANUP_FREQUENCY = 48;
LISTEN_ADDR = "0.0.0.0:6061"; LISTEN_ADDR = "0.0.0.0:6061";
}; };
# adminCredentialsFile = "${inputs.zeroq-credentials}/services/miniflux/admin-pass.txt";
adminCredentialsFile = config.sops.secrets.minifluxenv.path; adminCredentialsFile = config.sops.secrets.minifluxenv.path;
}; };
+17 -13
View File
@@ -7,31 +7,35 @@
... ...
}: }:
let let
configDir = "${xlib.dirs.services-mnt-folder}/n8n"; sourceDir = "${xlib.dirs.services-mnt-folder}/n8n";
varDir = "/var/lib/n8n"; targetDir = "/var/lib/n8n";
in in
{ {
services.n8n = { services.n8n = {
enable = false; enable = false;
environment = { environment = {
# N8N_USER_FOLDER = lib.mkForce "${configDir}"; # N8N_USER_FOLDER = lib.mkForce "${sourceDir}";
N8N_SECURE_COOKIE = "false"; N8N_SECURE_COOKIE = "false";
N8N_PORT = 5678; N8N_PORT = 5678;
}; };
openFirewall = true; openFirewall = true;
}; };
systemd.tmpfiles.rules = [ systemd = {
"d ${configDir} 0755 nobody nogroup -" tmpfiles.rules = [
"z ${configDir} 0755 nobody nogroup -" "d ${sourceDir} 0755 nobody nogroup -"
"z ${sourceDir} 0755 nobody nogroup -"
]; ];
mounts = [
fileSystems.${varDir} = { {
device = "${configDir}"; enable = true;
fsType = "none"; options = "bind,x-systemd.automount,nofail";
options = [ requires = [ "local-fs.target" ];
"bind" type = "none";
"nofail" wantedBy = [ "multi-user.target" ];
what = "${sourceDir}";
where = "${targetDir}";
}
]; ];
}; };
} }
+16 -1
View File
@@ -6,6 +6,10 @@
xlib, xlib,
... ...
}: }:
let
pointDir = "/var/lib/services/navidrome-point";
libraryDir = "${xlib.dirs.server-home}/Music";
in
{ {
services = { services = {
navidrome = { navidrome = {
@@ -15,8 +19,19 @@
settings = { settings = {
Address = "0.0.0.0"; Address = "0.0.0.0";
Port = 4533; Port = 4533;
MusicFolder = "/mnt/beets/music"; MusicFolder = "${pointDir}";
}; };
}; };
}; };
systemd.mounts = [
{
enable = true;
options = "bind,x-systemd.automount,nofail";
requires = [ "local-fs.target" ];
type = "none";
wantedBy = [ "multi-user.target" ];
what = "${libraryDir}";
where = "${pointDir}";
}
];
} }
+34 -63
View File
@@ -64,47 +64,29 @@ in
client_max_body_size 5G; client_max_body_size 5G;
''; '';
}; };
# "pdf.home.arpa" = { "x.zeroq.su" = {
# forceSSL = true; forceSSL = true;
# enableACME = true; enableACME = true;
# locations = { locations = {
# "/" = { "/" = {
# proxyPass = "http://127.0.0.1:8446"; proxyPass = "http://${server}:2049";
# proxyWebsockets = true; proxyWebsockets = true;
# }; };
# }; "/subs/" = {
# extraConfig = '' proxyPass = "http://${server}:2096";
# client_max_body_size 5G; proxyWebsockets = true;
# ''; };
# }; "/subsjs/" = {
# "homebox.home.arpa" = { proxyPass = "http://${server}:2096";
# forceSSL = true; proxyWebsockets = true;
# enableACME = true; };
# locations = { "/clash/" = {
# "/" = { proxyPass = "http://${server}:2096";
# proxyPass = "http://127.0.0.1:7745"; proxyWebsockets = true;
# proxyWebsockets = true; };
# }; };
# }; };
# }; # "talk.zeroq.su" = {
# "nextcloud.home.arpa" = {
# forceSSL = true;
# enableACME = true;
# locations = {
# "/" = {
# proxyPass = "http://127.0.0.1:10000";
# proxyWebsockets = true;
# };
# "/whiteboard" = {
# proxyPass = "http://127.0.0.1:3002";
# proxyWebsockets = true;
# };
# };
# extraConfig = ''
# client_max_body_size 5G;
# '';
# };
# "talk.home.arpa" = {
# forceSSL = true; # forceSSL = true;
# enableACME = true; # enableACME = true;
# # locations = { # # locations = {
@@ -117,7 +99,7 @@ in
# client_max_body_size 5G; # client_max_body_size 5G;
# ''; # '';
# }; # };
# "turn.home.arpa" = { # "turn.zeroq.su" = {
# forceSSL = true; # forceSSL = true;
# enableACME = true; # enableACME = true;
# locations = { # locations = {
@@ -130,7 +112,7 @@ in
# client_max_body_size 5G; # client_max_body_size 5G;
# ''; # '';
# }; # };
# "ca.zeroq.su" = { # "ca.home.arpa" = {
# forceSSL = true; # forceSSL = true;
# enableACME = true; # enableACME = true;
# locations."/" = { # locations."/" = {
@@ -141,18 +123,7 @@ in
# client_max_body_size 5G; # client_max_body_size 5G;
# ''; # '';
# }; # };
# "git.home.arpa" = { # "n8n.zeroq.su" = {
# forceSSL = true;
# enableACME = true;
# locations."/" = {
# proxyPass = "http://127.0.0.1:3000";
# proxyWebsockets = true;
# };
# extraConfig = ''
# client_max_body_size 5G;
# '';
# };
# "n8n.home.arpa" = {
# forceSSL = true; # forceSSL = true;
# enableACME = true; # enableACME = true;
# locations."/" = { # locations."/" = {
@@ -317,14 +288,14 @@ in
proxyWebsockets = true; proxyWebsockets = true;
}; };
}; };
"n8n.zeroq.su" = { # "n8n.zeroq.su" = {
forceSSL = true; # forceSSL = true;
enableACME = true; # enableACME = true;
locations."/" = { # locations."/" = {
proxyPass = "http://${server}:5678"; # proxyPass = "http://${server}:5678";
proxyWebsockets = true; # proxyWebsockets = true;
}; # };
}; # };
# "office.zeroq.su" = { # "office.zeroq.su" = {
# enableACME = true; # enableACME = true;
# forceSSL = true; # forceSSL = true;
-21
View File
@@ -1,21 +0,0 @@
{
config,
lib,
pkgs,
xlib,
inputs,
...
}:
{
services.node-red = {
enable = false;
port = 1880;
openFirewall = true;
userDir = "${xlib.dirs.services-mnt-folder}/node-red";
configFile = "${inputs.zeroq-credentials}/configs/node-red/settings.js";
};
systemd.tmpfiles.rules = [
"z ${config.services.node-red.userDir} 0750 node-red node-red -"
];
}
+5 -5
View File
@@ -7,11 +7,11 @@
... ...
}: }:
let let
previous = import inputs.nixpkgs-master { # previous = import inputs.nixpkgs-master {
system = "x86_64-linux"; # system = "x86_64-linux";
config.allowUnfree = true; # config.allowUnfree = true;
config.allowUnfreePredicate = true; # config.allowUnfreePredicate = true;
}; # };
in in
{ {
services.onlyoffice = { services.onlyoffice = {
+19 -12
View File
@@ -6,27 +6,34 @@
xlib, xlib,
... ...
}: }:
let
sourceDir = "${xlib.dirs.services-mnt-folder}/postgresql";
targetDir = "/var/lib/postgresql";
in
{ {
services = { services = {
postgresql = { postgresql = {
enable = true; enable = true;
package = pkgs.postgresql_17; package = pkgs.postgresql_17;
# dataDir = "${xlib.dirs.services-mnt-folder}/postgresql";
}; };
# postgresqlBackup.enable = true; # postgresqlBackup.enable = true;
}; };
fileSystems."/var/lib/postgresql" = { systemd = {
device = "${xlib.dirs.services-mnt-folder}/postgresql"; tmpfiles.rules = [
fsType = "none"; "d ${sourceDir} 0760 postgres postgres -"
options = [ "z ${sourceDir} 0760 postgres postgres -"
"bind" ];
"nofail" mounts = [
{
enable = true;
options = "bind,x-systemd.automount,nofail";
requires = [ "local-fs.target" ];
type = "none";
wantedBy = [ "multi-user.target" ];
what = "${sourceDir}";
where = "${targetDir}";
}
]; ];
}; };
systemd.tmpfiles.rules = [
"z ${xlib.dirs.services-mnt-folder}/postgresql 0760 postgres postgres -"
# "z ${config.services.postgresql.dataDir} 0760 postgres postgres -"
];
} }
+18 -12
View File
@@ -5,6 +5,10 @@
xlib, xlib,
... ...
}: }:
let
sourceDir = "${xlib.dirs.services-mnt-folder}/samba";
targetDir = "/var/lib/samba";
in
{ {
services = { services = {
samba-wsdd = { samba-wsdd = {
@@ -65,19 +69,21 @@
}; };
}; };
systemd.tmpfiles.rules = [ systemd = {
"d ${xlib.dirs.services-mnt-folder}/samba 0755 root root -" tmpfiles.rules = [
"z ${xlib.dirs.services-mnt-folder}/samba 0755 root root -" "d ${sourceDir} 0755 root root -"
"z ${sourceDir} 0755 root root -"
]; ];
mounts = [
fileSystems = { {
"/var/lib/samba" = { enable = true;
device = "${xlib.dirs.services-mnt-folder}/samba"; options = "bind,x-systemd.automount,nofail";
fsType = "none"; requires = [ "local-fs.target" ];
options = [ type = "none";
"bind" wantedBy = [ "multi-user.target" ];
"nofail" what = "${sourceDir}";
where = "${targetDir}";
}
]; ];
}; };
};
} }
+11 -11
View File
@@ -6,8 +6,8 @@
... ...
}: }:
let let
configDir = "${xlib.dirs.services-mnt-folder}/step-ca"; sourceDir = "${xlib.dirs.services-mnt-folder}/step-ca";
varDir = "/var/lib/step-ca"; targetDir = "/var/lib/step-ca";
in in
{ {
services.step-ca = { services.step-ca = {
@@ -17,9 +17,9 @@ in
openFirewall = true; openFirewall = true;
intermediatePasswordFile = config.sops.secrets.intermediate-password.path; intermediatePasswordFile = config.sops.secrets.intermediate-password.path;
settings = { settings = {
root = "${varDir}/certs/root_ca.crt"; root = "${targetDir}/certs/root_ca.crt";
crt = "${varDir}/certs/intermediate_ca.crt"; crt = "${targetDir}/certs/intermediate_ca.crt";
key = "${varDir}/secrets/intermediate_ca_key"; key = "${targetDir}/secrets/intermediate_ca_key";
# address = "0.0.0.0:9000"; # address = "0.0.0.0:9000";
dnsNames = [ dnsNames = [
"*.zeroq.su" "*.zeroq.su"
@@ -28,7 +28,7 @@ in
]; ];
db = { db = {
type = "badgerv2"; type = "badgerv2";
dataSource = "${varDir}/db"; dataSource = "${targetDir}/db";
}; };
authority = { authority = {
claims = { claims = {
@@ -69,8 +69,8 @@ in
}; };
}; };
fileSystems."${varDir}" = { fileSystems."${targetDir}" = {
device = "${configDir}"; device = "${sourceDir}";
fsType = "none"; fsType = "none";
options = [ options = [
"bind" "bind"
@@ -85,9 +85,9 @@ in
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d ${configDir} 0755 nobody nogroup -" "d ${sourceDir} 0755 nobody nogroup -"
"z ${configDir} 0755 nobody nogroup -" "z ${sourceDir} 0755 nobody nogroup -"
"Z ${configDir}/ 0700 nobody nogroup -" "Z ${sourceDir}/ 0700 nobody nogroup -"
]; ];
sops.secrets = { sops.secrets = {
-1
View File
@@ -7,7 +7,6 @@
{ {
services.syncthing = { services.syncthing = {
enable = true; enable = true;
# package = master.syncthing;
systemService = true; systemService = true;
guiAddress = "0.0.0.0:8384"; guiAddress = "0.0.0.0:8384";
configDir = "${xlib.dirs.storage}/persist/Syncthing/${xlib.device.hostname}"; configDir = "${xlib.dirs.storage}/persist/Syncthing/${xlib.device.hostname}";
+5 -2
View File
@@ -3,6 +3,9 @@
xlib, xlib,
... ...
}: }:
let
sourceDir = "${xlib.dirs.services-mnt-folder}/trilium";
in
{ {
services.trilium-server = { services.trilium-server = {
enable = false; enable = false;
@@ -11,10 +14,10 @@
hostName = "trilium"; hostName = "trilium";
}; };
host = "0.0.0.0"; host = "0.0.0.0";
dataDir = "/mnt/services/trilium"; dataDir = "${sourceDir}";
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"z /mnt/services/trilium 0750 trilium trilium -" "z ${sourceDir} 0750 trilium trilium -"
]; ];
} }
+6 -2
View File
@@ -6,9 +6,13 @@
inputs, inputs,
... ...
}: }:
let
targetDir = "/var/lib/private/uptime-kuma";
sourceDir = "${xlib.dirs.services-mnt-folder}/uptime-kuma";
in
{ {
services.uptime-kuma = { services.uptime-kuma = {
enable = false; enable = true;
settings = { settings = {
PORT = "4001"; PORT = "4001";
HOST = "0.0.0.0"; HOST = "0.0.0.0";
@@ -19,7 +23,7 @@
"z ${xlib.dirs.services-mnt-folder}/uptime-kuma 0755 nobody nogroup -" "z ${xlib.dirs.services-mnt-folder}/uptime-kuma 0755 nobody nogroup -"
]; ];
fileSystems."/var/lib/private/uptime-kuma" = { fileSystems."${targetDir}" = {
device = "${xlib.dirs.services-mnt-folder}/uptime-kuma"; device = "${xlib.dirs.services-mnt-folder}/uptime-kuma";
fsType = "none"; fsType = "none";
options = [ options = [
+1 -2
View File
@@ -14,7 +14,6 @@
]; ];
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d /mnt 0755 root root -" "d /mnt 0755 root root -"
"d /mnt/services 0755 root root -" "d ${xlib.dirs.services-mnt-folder} 0755 root root -"
"d /mnt/services/containers 0755 root root -"
]; ];
} }
+2 -2
View File
@@ -17,7 +17,7 @@ in
recommendedProxySettings = true; recommendedProxySettings = true;
recommendedTlsSettings = true; recommendedTlsSettings = true;
virtualHosts = { virtualHosts = {
"x.zeroq.su" = { "pubray1.zeroq.su" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations = { locations = {
@@ -45,7 +45,7 @@ in
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults = { defaults = {
email = "go.bin043120@gmail.com"; email = "oqyude@gmail.com";
}; };
}; };
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [