mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(grocy): barcode buddy
This commit is contained in:
parent
a157150956
commit
dc0c84c0a0
13 changed files with 391 additions and 1 deletions
38
nixos/barcodebuddy.nix
Normal file
38
nixos/barcodebuddy.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{config, lib, ...}: let
|
||||
inherit (lib.modules) mkDefault;
|
||||
inherit (config.services) nginx;
|
||||
cfg = config.services.barcodebuddy;
|
||||
in {
|
||||
config.services.barcodebuddy = {
|
||||
enable = mkDefault true;
|
||||
hostName = mkDefault "barcodebuddy";
|
||||
reverseProxy.enable = mkDefault true;
|
||||
settings = {
|
||||
EXTERNAL_GROCY_URL = "https://grocy.${config.networking.domain}";
|
||||
DISABLE_AUTHENTICATION = true;
|
||||
};
|
||||
nginxPhpConfig = ''
|
||||
include ${config.sops.secrets.barcodebuddy-fastcgi-params.path};
|
||||
'';
|
||||
};
|
||||
config.services.nginx.virtualHosts.barcodebuddy = {
|
||||
vouch = {
|
||||
enable = true;
|
||||
requireAuth = false;
|
||||
};
|
||||
name.shortServer = mkDefault "bbuddy";
|
||||
locations = {
|
||||
"= /api/index.php" = {
|
||||
vouch.requireAuth = false;
|
||||
extraConfig = cfg.nginxPhpConfig;
|
||||
};
|
||||
"~ \\.php$" = {
|
||||
vouch.requireAuth = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
config.sops.secrets.barcodebuddy-fastcgi-params = {
|
||||
sopsFile = mkDefault ./secrets/barcodebuddy.yaml;
|
||||
owner = mkDefault nginx.user;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue