Extract Shared NixOS Settings
This commit is contained in:
@@ -1,18 +1,4 @@
|
|||||||
services:
|
services:
|
||||||
postgres:
|
|
||||||
image: postgres:${PG_VER}-alpine
|
|
||||||
container_name: postgres
|
|
||||||
hostname: postgres
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- /opt/data/postgres:/var/lib/postgresql/data
|
|
||||||
environment:
|
|
||||||
TZ: Europe/Moscow
|
|
||||||
POSTGRES_DB: ${DB_NAME}
|
|
||||||
POSTGRES_USER: ${DB_USER}
|
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
container_name: redis
|
container_name: redis
|
||||||
@@ -20,6 +6,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
TZ: Europe/Moscow
|
TZ: Europe/Moscow
|
||||||
|
|
||||||
nextcloud:
|
nextcloud:
|
||||||
image: nextcloud:${NC_VER}
|
image: nextcloud:${NC_VER}
|
||||||
container_name: nextcloud
|
container_name: nextcloud
|
||||||
@@ -32,7 +19,6 @@ services:
|
|||||||
extra_hosts:
|
extra_hosts:
|
||||||
- ${NC_DOMAIN}:host-gateway
|
- ${NC_DOMAIN}:host-gateway
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
|
||||||
- redis
|
- redis
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/configs/nextcloud/app:/var/www/html
|
- /opt/configs/nextcloud/app:/var/www/html
|
||||||
@@ -45,12 +31,9 @@ services:
|
|||||||
NEXTCLOUD_OVERWRITEPROTOCOL: https
|
NEXTCLOUD_OVERWRITEPROTOCOL: https
|
||||||
NEXTCLOUD_ADMIN_USER: ${NC_ADMIN_USER}
|
NEXTCLOUD_ADMIN_USER: ${NC_ADMIN_USER}
|
||||||
NEXTCLOUD_ADMIN_PASSWORD: ${NC_ADMIN_PASSWORD}
|
NEXTCLOUD_ADMIN_PASSWORD: ${NC_ADMIN_PASSWORD}
|
||||||
POSTGRES_HOST: postgres
|
|
||||||
POSTGRES_DB: ${DB_NAME}
|
|
||||||
POSTGRES_USER: ${DB_USER}
|
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
TRUSTED_PROXIES: ${TRUSTED_PROXIES}
|
TRUSTED_PROXIES: ${TRUSTED_PROXIES}
|
||||||
|
|
||||||
cron:
|
cron:
|
||||||
image: nextcloud:${NC_VER}
|
image: nextcloud:${NC_VER}
|
||||||
hostname: cron
|
hostname: cron
|
||||||
@@ -64,9 +47,6 @@ services:
|
|||||||
- nextcloud
|
- nextcloud
|
||||||
environment:
|
environment:
|
||||||
TZ: Europe/Moscow
|
TZ: Europe/Moscow
|
||||||
POSTGRES_HOST: postgres
|
|
||||||
POSTGRES_DB: ${DB_NAME}
|
|
||||||
POSTGRES_USER: ${DB_USER}
|
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
|
|
||||||
networks: {}
|
networks: {}
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
../../modules/base.nix
|
../../modules/base.nix
|
||||||
../../modules/docker.nix
|
../../modules/docker.nix
|
||||||
../../modules/libvirtd.nix
|
../../modules/libvirtd.nix
|
||||||
|
../../modules/zerotier.nix
|
||||||
./firewall.nix
|
./firewall.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.nix-daemon.environment = {
|
|
||||||
HTTPS_PROXY = "http://192.168.1.10:10172";
|
|
||||||
HTTP_PROXY = "http://192.168.1.10:10172";
|
|
||||||
NO_PROXY = "localhost,127.0.0.0/8,::1,192.168.1.0/24";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "cloud-pc";
|
hostName = "cloud-pc";
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
@@ -50,18 +45,6 @@
|
|||||||
options = [ "nofail" ];
|
options = [ "nofail" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.network.wait-online.anyInterface = true;
|
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
services.zerotierone = {
|
|
||||||
enable = true;
|
|
||||||
joinNetworks = [
|
|
||||||
"743993800fa5a34c"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d /opt/data/postgres 0755 ada users - -"
|
"d /opt/data/postgres 0755 ada users - -"
|
||||||
"d /opt/data/nextcloud 0755 ada users - -"
|
"d /opt/data/nextcloud 0755 ada users - -"
|
||||||
|
|||||||
@@ -5,16 +5,11 @@
|
|||||||
../../modules/base.nix
|
../../modules/base.nix
|
||||||
../../modules/docker.nix
|
../../modules/docker.nix
|
||||||
../../modules/libvirtd.nix
|
../../modules/libvirtd.nix
|
||||||
|
../../modules/zerotier.nix
|
||||||
./firewall.nix
|
./firewall.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services.nix-daemon.environment = {
|
|
||||||
HTTPS_PROXY = "http://192.168.1.10:10172";
|
|
||||||
HTTP_PROXY = "http://192.168.1.10:10172";
|
|
||||||
NO_PROXY = "localhost,127.0.0.0/8,::1,192.168.1.0/24";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "mini-pc";
|
hostName = "mini-pc";
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
@@ -22,7 +17,6 @@
|
|||||||
|
|
||||||
systemd.network = {
|
systemd.network = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wait-online.anyInterface = true;
|
|
||||||
networks."10-lan" = {
|
networks."10-lan" = {
|
||||||
matchConfig.Name = "en*";
|
matchConfig.Name = "en*";
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
@@ -41,16 +35,6 @@
|
|||||||
fallbackDns = [ "1.1.1.1" "8.8.8.8" ];
|
fallbackDns = [ "1.1.1.1" "8.8.8.8" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
services.zerotierone = {
|
|
||||||
enable = true;
|
|
||||||
joinNetworks = [
|
|
||||||
"743993800fa5a34c"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d /opt/data/adguard 0755 ada users - -"
|
"d /opt/data/adguard 0755 ada users - -"
|
||||||
"d /opt/data/adguard/work 0755 ada users - -"
|
"d /opt/data/adguard/work 0755 ada users - -"
|
||||||
|
|||||||
@@ -2,22 +2,19 @@
|
|||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
enable = true;
|
enable = true;
|
||||||
allowedTCPPorts = [
|
allowedTCPPorts = [
|
||||||
22
|
22 # SSH
|
||||||
53 # DNS (AdGuard)
|
53 # DNS (AdGuard)
|
||||||
80 # HTTP
|
80 # HTTP
|
||||||
443 # HTTPS
|
443 # HTTPS
|
||||||
784 # DNS-over-QUIC
|
784 # DNS-over-QUIC
|
||||||
853 # DNS-over-TLS
|
853 # DNS-over-TLS
|
||||||
3001 # Uptime Kuma
|
3001 # Uptime Kuma
|
||||||
3015
|
3015
|
||||||
10171 # v2raya SOCKS5 LAN
|
|
||||||
10172 # v2raya HTTP proxy LAN
|
|
||||||
20171 # v2raya SOCKS5 (localhost)
|
|
||||||
20172 # v2raya HTTP proxy (localhost)
|
|
||||||
20170 # v2raya mixed
|
|
||||||
4438
|
4438
|
||||||
5443
|
5443
|
||||||
8088
|
8088
|
||||||
|
10171 # v2raya SOCKS5 LAN
|
||||||
|
10172 # v2raya HTTP proxy LAN
|
||||||
10380
|
10380
|
||||||
];
|
];
|
||||||
allowedUDPPorts = [
|
allowedUDPPorts = [
|
||||||
|
|||||||
+13
-1
@@ -13,7 +13,19 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.tmp.cleanOnBoot = true;
|
boot = {
|
||||||
|
tmp.cleanOnBoot = true;
|
||||||
|
loader.systemd-boot.enable = true;
|
||||||
|
loader.efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.network.wait-online.anyInterface = true;
|
||||||
|
|
||||||
|
systemd.services.nix-daemon.environment = {
|
||||||
|
HTTPS_PROXY = "http://192.168.1.10:10172";
|
||||||
|
HTTP_PROXY = "http://192.168.1.10:10172";
|
||||||
|
NO_PROXY = "localhost,127.0.0.0/8,::1,192.168.1.0/24";
|
||||||
|
};
|
||||||
|
|
||||||
time.timeZone = "Europe/Moscow";
|
time.timeZone = "Europe/Moscow";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
services.zerotierone = {
|
||||||
|
enable = true;
|
||||||
|
joinNetworks = [ "743993800fa5a34c" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user