mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 18:15:13 -05:00
refactor: complete overhaul
This commit is contained in:
parent
fb3e6fed86
commit
0541b3d61f
154 changed files with 936 additions and 904 deletions
15
config/instances/config/acme.nix
Normal file
15
config/instances/config/acme.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) sslPath sopsPath;
|
||||
|
||||
acmeLabel = "Acme";
|
||||
acmeName = "acme";
|
||||
in {
|
||||
label = acmeLabel;
|
||||
name = acmeName;
|
||||
paths = {
|
||||
path0 = sslPath;
|
||||
};
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${acmeName}";
|
||||
};
|
||||
}
|
16
config/instances/config/caddy.nix
Normal file
16
config/instances/config/caddy.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) sopsPath;
|
||||
|
||||
caddyLabel = "Caddy";
|
||||
caddyName = "caddy";
|
||||
in {
|
||||
label = caddyLabel;
|
||||
name = caddyName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${caddyName}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 80;
|
||||
port1 = 443;
|
||||
};
|
||||
}
|
26
config/instances/config/castopod.nix
Normal file
26
config/instances/config/castopod.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath;
|
||||
castopodLabel = "Castopod";
|
||||
castopodName = "castopod";
|
||||
castopodSubdomain = "podcast";
|
||||
in {
|
||||
label = castopodLabel;
|
||||
name = castopodName;
|
||||
email = {
|
||||
address0 = "noreply@${castopodSubdomain}.${domain1}";
|
||||
};
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${castopodName}";
|
||||
};
|
||||
subdomain = castopodSubdomain;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${castopodLabel}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 8000;
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${castopodSubdomain}.${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/${castopodSubdomain}.${domain1}/key.pem";
|
||||
};
|
||||
}
|
27
config/instances/config/forgejo.nix
Normal file
27
config/instances/config/forgejo.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath;
|
||||
|
||||
forgejoLabel = "Forgejo";
|
||||
forgejoName = "forgejo";
|
||||
forgejoSubdomain = "source";
|
||||
in {
|
||||
label = forgejoLabel;
|
||||
name = forgejoName;
|
||||
email = {
|
||||
address0 = "noreply@${forgejoSubdomain}.${domain1}";
|
||||
};
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${forgejoName}";
|
||||
};
|
||||
subdomain = forgejoSubdomain;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${forgejoLabel}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 3033;
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${forgejoSubdomain}.${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/${forgejoSubdomain}.${domain1}/key.pem";
|
||||
};
|
||||
}
|
22
config/instances/config/jellyfin.nix
Normal file
22
config/instances/config/jellyfin.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain0 jellyfinLabel jellyfinName servicePath sslPath sopsPath;
|
||||
in {
|
||||
label = jellyfinLabel;
|
||||
name = jellyfinName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${jellyfinName}";
|
||||
};
|
||||
subdomain = jellyfinName;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${jellyfinLabel}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 5055; # Jellyseer
|
||||
port1 = 8096; # Jellyfin HTTP
|
||||
port2 = 8920; # Jellyfin HTTPS
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${jellyfinName}.${domain0}/fullchain.pem";
|
||||
key = "${sslPath}/${jellyfinName}.${domain0}/key.pem";
|
||||
};
|
||||
}
|
24
config/instances/config/mastodon.nix
Normal file
24
config/instances/config/mastodon.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath;
|
||||
|
||||
mastodonLabel = "Mastodon";
|
||||
mastodonName = "mastodon";
|
||||
in {
|
||||
label = mastodonLabel;
|
||||
name = mastodonName;
|
||||
email = {
|
||||
address0 = "thenutrivore@${domain1}";
|
||||
};
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${mastodonName}";
|
||||
};
|
||||
paths = {
|
||||
path0 = "${servicePath}/${mastodonLabel}";
|
||||
path1 = "";
|
||||
path2 = "";
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/${domain1}/key.pem";
|
||||
};
|
||||
}
|
18
config/instances/config/matrix.nix
Normal file
18
config/instances/config/matrix.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) servicePath sopsPath;
|
||||
|
||||
matrixLabel = "Matrix";
|
||||
matrixName = "matrix";
|
||||
in {
|
||||
label = matrixLabel;
|
||||
name = matrixName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${matrixName}";
|
||||
};
|
||||
subdomain = matrixName;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${matrixLabel}";
|
||||
path1 = "";
|
||||
path2 = "";
|
||||
};
|
||||
}
|
23
config/instances/config/minecraft.nix
Normal file
23
config/instances/config/minecraft.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain0 servicePath sslPath sopsPath;
|
||||
|
||||
minecraftLabel = "Minecraft";
|
||||
minecraftName = "minecraft";
|
||||
in {
|
||||
label = minecraftLabel;
|
||||
name = minecraftName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${minecraftName}";
|
||||
};
|
||||
subdomain = minecraftName;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${minecraftLabel}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 43000; # Minecraft (Brix on Nix)
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${minecraftName}.${domain0}/fullchain.pem";
|
||||
key = "${sslPath}/${minecraftName}.${domain0}/key.pem";
|
||||
};
|
||||
}
|
23
config/instances/config/nextcloud.nix
Normal file
23
config/instances/config/nextcloud.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath;
|
||||
|
||||
nextcloudLabel = "Nextcloud";
|
||||
nextcloudName = "nextcloud";
|
||||
in {
|
||||
label = nextcloudLabel;
|
||||
name = nextcloudName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${nextcloudName}";
|
||||
};
|
||||
subdomain = nextcloudName;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${nextcloudLabel}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 8354; # Nextcloud
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${nextcloudName}.${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/${nextcloudName}.${domain1}/key.pem";
|
||||
};
|
||||
}
|
16
config/instances/config/nginx.nix
Normal file
16
config/instances/config/nginx.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) sopsPath;
|
||||
|
||||
nginxLabel = "Ngnix";
|
||||
nginxName = "nginx";
|
||||
in {
|
||||
name = nginxName;
|
||||
label = nginxLabel;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${nginxName}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 8080; # HTTP
|
||||
port1 = 8443; # HTTPS
|
||||
};
|
||||
}
|
25
config/instances/config/ollama.nix
Normal file
25
config/instances/config/ollama.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain0 servicePath sslPath sopsPath;
|
||||
|
||||
ollamaLabel = "Ollama";
|
||||
ollamaName = "ollama";
|
||||
in {
|
||||
label = ollamaLabel;
|
||||
name = ollamaName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${ollamaName}";
|
||||
};
|
||||
subdomain = ollamaName;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${ollamaLabel}";
|
||||
path1 = "/mnt/media/storage/${ollamaName}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 8088; # Open-WebUI (Ollama Front End)
|
||||
port1 = 11434; # Ollama API
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${ollamaName}.${domain0}/fullchain.pem";
|
||||
key = "${sslPath}/${ollamaName}.${domain0}/key.pem";
|
||||
};
|
||||
}
|
26
config/instances/config/owncast.nix
Normal file
26
config/instances/config/owncast.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath;
|
||||
|
||||
owncastLabel = "Owncast";
|
||||
owncastName = "owncast";
|
||||
owncastSubdomain = "stream";
|
||||
in {
|
||||
label = owncastLabel;
|
||||
name = owncastName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${owncastName}";
|
||||
};
|
||||
subdomain = owncastSubdomain;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${owncastLabel}";
|
||||
path1 = "/mnt/media/storage/${owncastName}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 9454;
|
||||
port1 = 1935;
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${owncastSubdomain}.${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/${owncastSubdomain}.${domain1}/key.pem";
|
||||
};
|
||||
}
|
31
config/instances/config/peertube.nix
Normal file
31
config/instances/config/peertube.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath;
|
||||
|
||||
peertubeLabel = "PeerTube";
|
||||
peertubeName = "peertube";
|
||||
peertubeSubdomain = "video";
|
||||
in {
|
||||
label = peertubeLabel;
|
||||
name = peertubeName;
|
||||
email = {
|
||||
address0 = "noreply@${peertubeSubdomain}.${domain1}";
|
||||
};
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${peertubeName}";
|
||||
};
|
||||
subdomain = peertubeSubdomain;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${peertubeLabel}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 9000; # HTTP
|
||||
port1 = 1935;
|
||||
port2 = 1936;
|
||||
port3 = 5432;
|
||||
port4 = 52800;
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/video.${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/video.${domain1}/key.pem";
|
||||
};
|
||||
}
|
18
config/instances/config/postgresql.nix
Normal file
18
config/instances/config/postgresql.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) servicePath sopsPath;
|
||||
|
||||
postgresLabel = "PostgreSQL";
|
||||
postgresName = "postgres";
|
||||
in {
|
||||
label = postgresLabel;
|
||||
name = postgresName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${postgresName}";
|
||||
};
|
||||
paths = {
|
||||
path0 = "${servicePath}/${postgresLabel}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 5432;
|
||||
};
|
||||
}
|
20
config/instances/config/samba.nix
Normal file
20
config/instances/config/samba.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) jellyfinLabel jellyfinName servicePath sopsPath;
|
||||
|
||||
sambaLabel = "Samba";
|
||||
sambaName = "samba";
|
||||
in {
|
||||
label = sambaLabel;
|
||||
name = sambaName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${sambaName}";
|
||||
};
|
||||
paths = {
|
||||
path0 = "${servicePath}/${jellyfinLabel}";
|
||||
path1 = jellyfinName;
|
||||
path2 = "";
|
||||
};
|
||||
ports = {
|
||||
port0 = 445; # Samba
|
||||
};
|
||||
}
|
22
config/instances/config/syncthing.nix
Normal file
22
config/instances/config/syncthing.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain0 sslPath sopsPath;
|
||||
|
||||
syncthingLabel = "Syncthing";
|
||||
syncthingName = "syncthing";
|
||||
in {
|
||||
label = syncthingLabel;
|
||||
name = syncthingName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${syncthingName}";
|
||||
};
|
||||
subdomain = syncthingName;
|
||||
ports = {
|
||||
port0 = 8388; # Syncthing (WebUI)
|
||||
port1 = 21027; # Syncthing (Discovery)
|
||||
port2 = 22000; # Syncthing (Transfer)
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${syncthingName}.${domain0}/fullchain.pem";
|
||||
key = "${sslPath}/${syncthingName}.${domain0}/key.pem";
|
||||
};
|
||||
}
|
15
config/instances/config/synology.nix
Normal file
15
config/instances/config/synology.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) sopsPath;
|
||||
|
||||
synologyLabel = "Synology";
|
||||
synologyName = "synology";
|
||||
in {
|
||||
label = synologyLabel;
|
||||
name = synologyName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${synologyName}";
|
||||
};
|
||||
ports = {
|
||||
port0 = 5001; # Synology HTTPS
|
||||
};
|
||||
}
|
26
config/instances/config/vaultwarden.nix
Normal file
26
config/instances/config/vaultwarden.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain0 servicePath sslPath sopsPath;
|
||||
|
||||
vaultwardenLabel = "Vaultwarden";
|
||||
vaultwardenName = "vaultwarden";
|
||||
in {
|
||||
label = vaultwardenLabel;
|
||||
name = vaultwardenName;
|
||||
email = {
|
||||
address0 = "noreply@${vaultwardenName}.${domain0}";
|
||||
};
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${vaultwardenName}";
|
||||
};
|
||||
subdomain = vaultwardenName;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${vaultwardenLabel}/BackupDir";
|
||||
};
|
||||
ports = {
|
||||
port0 = 8085; # Vaultwarden WebUI
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${vaultwardenName}.${domain0}/fullchain.pem";
|
||||
key = "${sslPath}/${vaultwardenName}.${domain0}/key.pem";
|
||||
};
|
||||
}
|
18
config/instances/config/web.nix
Normal file
18
config/instances/config/web.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain0 domain1 domain2;
|
||||
in {
|
||||
domains = {
|
||||
url0 = domain0;
|
||||
url1 = domain1;
|
||||
url2 = domain2;
|
||||
};
|
||||
dns = {
|
||||
provider0 = "namecheap";
|
||||
};
|
||||
localhost = {
|
||||
address0 = "127.0.0.1"; # Local
|
||||
address1 = "0.0.0.0"; # All
|
||||
address2 = "192.168.50.1"; # Router
|
||||
address3 = "192.168.50.0"; # Router
|
||||
};
|
||||
}
|
26
config/instances/config/wiki.nix
Normal file
26
config/instances/config/wiki.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath varLib;
|
||||
|
||||
wikiLabel = "Wiki-js";
|
||||
wikiName = "wiki-js";
|
||||
wikiSubdomain = "vault";
|
||||
in {
|
||||
label = wikiLabel;
|
||||
name = wikiName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${wikiName}";
|
||||
};
|
||||
subdomain = wikiSubdomain;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${wikiLabel}";
|
||||
path1 = "${varLib}/DataDir";
|
||||
};
|
||||
ports = {
|
||||
port0 = 3000;
|
||||
port1 = 5432;
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${wikiSubdomain}.${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/${wikiSubdomain}.${domain1}/key.pem";
|
||||
};
|
||||
}
|
24
config/instances/config/writefreely.nix
Normal file
24
config/instances/config/writefreely.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{instancesFunctions}: let
|
||||
inherit (instancesFunctions) domain1 servicePath sslPath sopsPath;
|
||||
|
||||
writefreelyLabel = "WriteFreely";
|
||||
writefreelyName = "writefreely";
|
||||
writefreelySubdomain = "blog";
|
||||
in {
|
||||
label = writefreelyLabel;
|
||||
name = writefreelyName;
|
||||
sops = {
|
||||
path0 = "${sopsPath}/${writefreelyName}";
|
||||
};
|
||||
subdomain = writefreelySubdomain;
|
||||
paths = {
|
||||
path0 = "${servicePath}/${writefreelyLabel}/BackupDir";
|
||||
};
|
||||
ports = {
|
||||
port0 = 8093;
|
||||
};
|
||||
ssl = {
|
||||
cert = "${sslPath}/${writefreelySubdomain}.${domain1}/fullchain.pem";
|
||||
key = "${sslPath}/${writefreelySubdomain}.${domain1}/key.pem";
|
||||
};
|
||||
}
|
25
config/instances/default.nix
Executable file
25
config/instances/default.nix
Executable file
|
@ -0,0 +1,25 @@
|
|||
let
|
||||
configPath = ./config;
|
||||
|
||||
instancesFunctions = {
|
||||
jellyfinLabel = "Jellyfin";
|
||||
jellyfinName = "jellyfin";
|
||||
domain0 = "cloudbert.fun";
|
||||
domain1 = "the-nutrivore.social";
|
||||
domain2 = "the-nutrivore.com";
|
||||
servicePath = "/mnt/media/NAS1";
|
||||
sopsPath = "/var/lib/secrets";
|
||||
sslPath = "/var/lib/acme";
|
||||
varLib = "/var/lib";
|
||||
};
|
||||
|
||||
instances = builtins.listToAttrs (map (name: {
|
||||
name = builtins.substring 0 (builtins.stringLength name - 4) name; # Remove the last 4 characters (".nix")
|
||||
value = import (configPath + "/${name}") {inherit instancesFunctions;};
|
||||
})
|
||||
(builtins.filter (name:
|
||||
builtins.match ".*\\.nix$" name != null) (builtins.attrNames
|
||||
(builtins.readDir configPath))));
|
||||
in {
|
||||
instances = instances;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue