feat: trying out grocy

This commit is contained in:
arcnmx 2024-03-19 20:48:21 -07:00
parent a7e35fbc88
commit c27a8da537
5 changed files with 34 additions and 2 deletions

23
nixos/grocy.nix Normal file
View file

@ -0,0 +1,23 @@
{config, lib, ...}: let
inherit (lib.modules) mkDefault;
in {
config = {
services.grocy = {
enable = mkDefault true;
hostName = "grocy";
nginx.enableSSL = false;
settings = {
currency = mkDefault "CAD";
};
};
services.nginx = let
name.shortServer = mkDefault "grocy";
in {
virtualHosts = {
grocy = {
inherit name;
};
};
};
};
}

View file

@ -8,6 +8,7 @@
inherit (lib.attrsets) listToAttrs nameValuePair;
inherit (access) nixosFor;
inherit (config.networking) hostName;
inherit (config.services) nginx;
cfg = config.services.cloudflared;
apartment = "5e85d878-c6b2-4b15-b803-9aeb63d63543";
accessHostFor = {
@ -49,11 +50,15 @@ in {
default = "http_status:404";
ingress = listToAttrs [
(ingressForNginx {
host = config.services.zigbee2mqtt.domain;
host = nginx.virtualHosts.zigbee2mqtt.serverName;
inherit hostName;
})
(ingressForNginx {
host = config.services.nginx.access.unifi.domain;
host = nginx.access.unifi.domain;
inherit hostName;
})
(ingressForNginx {
host = nginx.virtualHosts.grocy.serverName;
inherit hostName;
})
(ingressForHass {inherit hostName;})

View file

@ -23,12 +23,14 @@ in {
nixos.home-assistant
nixos.zigbee2mqtt
nixos.syncplay
nixos.grocy
./cloudflared.nix
];
services.nginx = {
virtualHosts = {
zigbee2mqtt.proxied.enable = "cloudflared";
grocy.proxied.enable = "cloudflared";
};
};

View file

@ -27,6 +27,7 @@ module "hakurei_system_records" {
"smb",
"kitchen",
"home",
"grocy",
"yt",
]
global_subdomains = [

View file

@ -74,6 +74,7 @@ module "tewi" {
"id",
"z2m",
"unifi",
"grocy",
]
}