47 lines
933 B
Nix
47 lines
933 B
Nix
{
|
|
self,
|
|
hostPath,
|
|
tree,
|
|
inputs,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
|
|
hostIP = containerAddresses.host;
|
|
containerIP = containerAddresses.containers.postgresql;
|
|
in {
|
|
containers.postgresql = {
|
|
autoStart = true;
|
|
privateNetwork = true;
|
|
hostAddress = hostIP;
|
|
localAddress = containerIP;
|
|
|
|
specialArgs = {
|
|
inherit inputs;
|
|
inherit tree;
|
|
inherit self;
|
|
inherit hostPath;
|
|
};
|
|
|
|
config = {...}: {
|
|
nixpkgs.pkgs = pkgs;
|
|
|
|
imports = with tree;
|
|
[
|
|
presets.nixos.containerBase
|
|
./secrets.nix
|
|
]
|
|
++ (with hosts.hetzner-arm.containers.postgresql.profiles; [
|
|
postgres
|
|
restic
|
|
]);
|
|
|
|
networking.firewall.allowedTCPPorts = [5432];
|
|
|
|
home-manager.users.root.home.stateVersion = "23.05";
|
|
system.stateVersion = "23.05";
|
|
};
|
|
};
|
|
}
|