59 lines
1.1 KiB
Nix
59 lines
1.1 KiB
Nix
|
{
|
||
|
self,
|
||
|
hostPath,
|
||
|
tree,
|
||
|
inputs,
|
||
|
pkgs,
|
||
|
config,
|
||
|
...
|
||
|
}: let
|
||
|
containerName = "grocy";
|
||
|
|
||
|
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
|
||
|
|
||
|
hostIP = containerAddresses.host;
|
||
|
containerIP = containerAddresses.containers.${containerName};
|
||
|
in {
|
||
|
containers.grocy = {
|
||
|
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.grocy.profiles; [
|
||
|
grocy
|
||
|
restic
|
||
|
]);
|
||
|
|
||
|
networking.firewall.allowedTCPPorts = [80];
|
||
|
|
||
|
home-manager.users.root.home.stateVersion = "23.05";
|
||
|
system.stateVersion = "23.05";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
services.nginx.virtualHosts."grocy.owo.monster" = {
|
||
|
forceSSL = true;
|
||
|
enableACME = true;
|
||
|
locations."/" = {
|
||
|
proxyPass = "http://${containerIP}:80";
|
||
|
proxyWebsockets = true;
|
||
|
};
|
||
|
};
|
||
|
}
|