mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
feat: refactored abstractions
This commit is contained in:
parent
f3897c1e0c
commit
2e0ba5f89e
23 changed files with 324 additions and 310 deletions
|
@ -1,11 +1,13 @@
|
|||
{flake, ...}: let
|
||||
inherit (flake.config.service.instance.postgresql) name paths ports;
|
||||
inherit (flake.config.system.device) server;
|
||||
inherit (flake.config.service.instance) postgresql;
|
||||
|
||||
service = postgresql;
|
||||
in {
|
||||
services = {
|
||||
postgresqlBackup = {
|
||||
enable = true;
|
||||
location = paths.path0;
|
||||
location = service.paths.path0;
|
||||
databases = ["mastodon" "nextcloud" "peertube" "forgejo" "wiki"];
|
||||
};
|
||||
postgresql = {
|
||||
|
@ -15,23 +17,23 @@ in {
|
|||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
ports.port0
|
||||
service.ports.port0
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems."/var/lib/postgresql" = {
|
||||
device = paths.path0;
|
||||
device = service.paths.path0;
|
||||
fsType = "none";
|
||||
options = ["bind"];
|
||||
depends = [server.storage0.mount];
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = ["Z ${paths.path0} 700 ${name} ${name} -"];
|
||||
systemd.tmpfiles.rules = ["Z ${service.paths.path0} 700 ${service.name} ${service.name} -"];
|
||||
|
||||
users.users.${name}.extraGroups = ["nextcloud" "mastodon" "forgejo"];
|
||||
users.users.${service.name}.extraGroups = ["nextcloud" "mastodon" "forgejo"];
|
||||
|
||||
system.activationScripts.postgresCommands = ''
|
||||
chown -R ${name}:${name} ${paths.path0}
|
||||
chown -R ${service.name}:${service.name} ${service.paths.path0}
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue