2024-06-13 17:00:05 +03:00
|
|
|
{ pkgs
|
|
|
|
, const
|
|
|
|
, lib
|
|
|
|
, config
|
|
|
|
, util
|
|
|
|
, poetry2nixJobber
|
|
|
|
, pkgsJobber
|
2024-06-20 22:13:59 +03:00
|
|
|
, pkgsMaster
|
|
|
|
, pkgsStable
|
2024-06-13 17:00:05 +03:00
|
|
|
, ... }: let
|
|
|
|
args = let
|
2024-06-24 03:32:33 +03:00
|
|
|
# Path where all the container data will be stored.
|
2024-06-13 17:00:05 +03:00
|
|
|
storage = "/storage/hot/container";
|
2024-06-24 03:32:33 +03:00
|
|
|
|
|
|
|
# Domain used to host stuff. All the services will be like `service.${domain}`.
|
2024-06-13 17:00:05 +03:00
|
|
|
domain = "voronind.com";
|
2024-06-24 03:32:33 +03:00
|
|
|
|
|
|
|
# External IP address of the host, where all the services will listen to.
|
2024-06-13 17:00:05 +03:00
|
|
|
host = "192.168.1.2";
|
2024-06-24 03:32:33 +03:00
|
|
|
|
|
|
|
# External interface where all the services will listen on.
|
2024-06-21 14:34:40 +03:00
|
|
|
externalInterface = "enp7s0";
|
2024-06-24 03:32:33 +03:00
|
|
|
|
|
|
|
# Paths to media content. Later they can be plugged to the containers using the `attachMedia "photo"` function.
|
2024-06-13 17:00:05 +03:00
|
|
|
media = {
|
|
|
|
anime = [ "/storage/cold_1/media/anime" "/storage/cold_2/media/anime" ];
|
|
|
|
book = [ "/storage/hot/media/book" ];
|
|
|
|
download = [ "/storage/hot/download" ];
|
|
|
|
manga = [ "/storage/cold_1/media/manga" "/storage/cold_2/media/manga" ];
|
|
|
|
movie = [ "/storage/cold_1/media/movie" "/storage/cold_2/media/movie" ];
|
2024-06-23 16:59:15 +03:00
|
|
|
music = [ "/storage/cold_2/media/music" ];
|
2024-06-13 17:00:05 +03:00
|
|
|
paper = [ "/storage/hot/media/paper" ];
|
2024-06-14 01:18:50 +03:00
|
|
|
porn = [ "/storage/cold_2/media/porn" ];
|
2024-06-13 17:00:05 +03:00
|
|
|
photo = [ "${storage}/cloud/data/data/cakee/files/media/photo" "/storage/cold_1/backup/tmp/photo" ];
|
|
|
|
show = [ "/storage/cold_1/media/show" "/storage/cold_2/media/show" ];
|
|
|
|
study = [ "/storage/cold_1/media/study" "/storage/cold_2/media/study" ];
|
|
|
|
work = [ "/storage/cold_2/media/work" ];
|
|
|
|
youtube = [ "/storage/cold_1/media/youtube" "/storage/cold_2/media/youtube" ];
|
|
|
|
};
|
|
|
|
in {
|
2024-06-24 03:32:33 +03:00
|
|
|
# Pass all the arguments further.
|
2024-06-18 10:24:58 +03:00
|
|
|
inherit storage domain host pkgs const lib config util media externalInterface;
|
2024-06-13 17:00:05 +03:00
|
|
|
inherit poetry2nixJobber pkgsJobber;
|
2024-06-20 22:13:59 +03:00
|
|
|
inherit pkgsMaster pkgsStable;
|
2024-06-13 17:00:05 +03:00
|
|
|
|
2024-06-24 03:32:33 +03:00
|
|
|
# Pass the global container configuration.
|
2024-06-13 17:00:05 +03:00
|
|
|
container = import ../../container args;
|
|
|
|
};
|
|
|
|
in {
|
2024-06-24 03:32:33 +03:00
|
|
|
# List of containers enabled on this host.
|
2024-06-13 17:00:05 +03:00
|
|
|
imports = [
|
|
|
|
(import ../../container/Change.nix args)
|
|
|
|
(import ../../container/Cloud.nix args)
|
2024-06-23 15:40:48 +03:00
|
|
|
(import ../../container/Ddns.nix args)
|
2024-06-13 17:00:05 +03:00
|
|
|
(import ../../container/Dns.nix args)
|
|
|
|
(import ../../container/Download.nix args)
|
|
|
|
(import ../../container/Git.nix args)
|
|
|
|
# (import ../../container/Hdd.nix args)
|
|
|
|
(import ../../container/Home.nix args)
|
|
|
|
(import ../../container/Iot.nix args)
|
|
|
|
(import ../../container/Jobber.nix args)
|
|
|
|
(import ../../container/Mail.nix args)
|
2024-06-15 18:38:17 +03:00
|
|
|
(import ../../container/Office.nix args)
|
2024-06-13 17:00:05 +03:00
|
|
|
(import ../../container/Paper.nix args)
|
|
|
|
(import ../../container/Pass.nix args)
|
|
|
|
(import ../../container/Paste.nix args)
|
|
|
|
(import ../../container/Postgres.nix args)
|
|
|
|
(import ../../container/Print.nix args)
|
|
|
|
(import ../../container/Proxy.nix args)
|
|
|
|
(import ../../container/Rabbitmq.nix args)
|
|
|
|
(import ../../container/Read.nix args)
|
|
|
|
(import ../../container/Redis.nix args)
|
|
|
|
(import ../../container/Search.nix args)
|
2024-06-23 15:56:38 +03:00
|
|
|
(import ../../container/Status.nix args)
|
2024-06-13 17:00:05 +03:00
|
|
|
(import ../../container/Stock.nix args)
|
|
|
|
(import ../../container/Vpn.nix args)
|
|
|
|
(import ../../container/Watch.nix args)
|
|
|
|
(import ../../container/Yt.nix args)
|
|
|
|
];
|
|
|
|
|
2024-06-24 03:32:33 +03:00
|
|
|
# This is the network for all the containers.
|
|
|
|
# They are not available to the external interface by default,
|
|
|
|
# instead they all expose specific ports in their configuration.
|
2024-06-13 17:00:05 +03:00
|
|
|
networking.nat = {
|
|
|
|
enable = true;
|
|
|
|
internalInterfaces = [ "ve-+" ];
|
2024-06-18 10:24:58 +03:00
|
|
|
inherit (args) externalInterface;
|
2024-06-13 17:00:05 +03:00
|
|
|
};
|
|
|
|
}
|