2024-02-08 20:21:35 +00:00
|
|
|
{
|
|
|
|
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];
|
|
|
|
|
2024-05-25 21:10:26 +01:00
|
|
|
home-manager.users.root.home.stateVersion = "24.05";
|
|
|
|
system.stateVersion = "24.05";
|
2024-02-08 20:21:35 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."grocy.owo.monster" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://${containerIP}:80";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|