mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore: nf-fmt-nix
This commit is contained in:
parent
0947ca0532
commit
fef4f25ca4
8 changed files with 123 additions and 104 deletions
|
|
@ -306,7 +306,8 @@ in {
|
|||
(map ({platform, ...}: platform) cfg.config.tts or [])
|
||||
];
|
||||
customComponents = [
|
||||
(mkIf (cfg.reverseProxy.enable && cfg.reverseProxy.auth.enable)
|
||||
(
|
||||
mkIf (cfg.reverseProxy.enable && cfg.reverseProxy.auth.enable)
|
||||
pkgs.home-assistant-custom-components.auth-header
|
||||
)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -60,7 +60,11 @@ in {
|
|||
};
|
||||
};
|
||||
# TODO: restrict to "/auth/authorize" and "/auth/login_flow" only..?
|
||||
"/auth/" = { virtualHost, config, ... }: {
|
||||
"/auth/" = {
|
||||
virtualHost,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
proxy = {
|
||||
inherit headers;
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -65,14 +65,17 @@ in {
|
|||
address4
|
||||
#address6
|
||||
];
|
||||
guest = logistics ++ [
|
||||
guest =
|
||||
logistics
|
||||
++ [
|
||||
# bedroom tv
|
||||
"10.1.1.67"
|
||||
];
|
||||
kat = koishi;
|
||||
arc = shanghai ++ nue;
|
||||
enableTrustedAuth = false;
|
||||
in mkIf enableTrustedAuth [
|
||||
in
|
||||
mkIf enableTrustedAuth [
|
||||
{
|
||||
type = "trusted_networks";
|
||||
#allow_bypass_login = true;
|
||||
|
|
|
|||
|
|
@ -13,10 +13,12 @@ in {
|
|||
services.vouch-proxy = {
|
||||
enable = mkDefault true;
|
||||
package = mkIf hassVouch (pkgs.vouch-proxy.overrideAttrs (old: {
|
||||
postPatch = ''
|
||||
postPatch =
|
||||
''
|
||||
sed -i handlers/login.go \
|
||||
-e 's/badStrings *=.*$/badStrings = []string{}/'
|
||||
'' + old.postPatch or "";
|
||||
''
|
||||
+ old.postPatch or "";
|
||||
doCheck = false;
|
||||
}));
|
||||
domain = mkDefault "login.${config.networking.domain}";
|
||||
|
|
|
|||
|
|
@ -1,24 +1,26 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, backports-zoneinfo
|
||||
, deprecation
|
||||
, pydantic
|
||||
, requests
|
||||
, responses
|
||||
, pre-commit
|
||||
, isort
|
||||
, vcrpy
|
||||
, pytest
|
||||
, pytest-recording
|
||||
, pytest-mock
|
||||
, pythonOlder
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
backports-zoneinfo,
|
||||
deprecation,
|
||||
pydantic,
|
||||
requests,
|
||||
responses,
|
||||
pre-commit,
|
||||
isort,
|
||||
vcrpy,
|
||||
pytest,
|
||||
pytest-recording,
|
||||
pytest-mock,
|
||||
pythonOlder,
|
||||
# requires an instance of grocy api running...
|
||||
, doCheckGrocy ? false
|
||||
doCheckGrocy ? false,
|
||||
}: let
|
||||
inherit (lib.lists) optional optionals;
|
||||
inherit (lib.strings) optionalString;
|
||||
in buildPythonPackage rec {
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
pname = "pygrocy";
|
||||
version = "2.1.0";
|
||||
format = "setuptools";
|
||||
|
|
@ -34,21 +36,25 @@ in buildPythonPackage rec {
|
|||
rm test/test_grocy.py
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [
|
||||
propagatedBuildInputs =
|
||||
[
|
||||
requests
|
||||
deprecation
|
||||
pydantic
|
||||
] ++ optional (pythonOlder "3.9") backports-zoneinfo;
|
||||
]
|
||||
++ optional (pythonOlder "3.9") backports-zoneinfo;
|
||||
|
||||
pythonImportsCheck = [
|
||||
"pygrocy"
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
checkInputs =
|
||||
[
|
||||
pytest
|
||||
pytest-recording
|
||||
pytest-mock
|
||||
] ++ optionals doCheckGrocy [
|
||||
]
|
||||
++ optionals doCheckGrocy [
|
||||
responses
|
||||
pre-commit
|
||||
isort
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ in {
|
|||
(nginx.virtualHosts.zigbee2mqtt.proxied.cloudflared.getIngress {})
|
||||
(nginx.virtualHosts.grocy.proxied.cloudflared.getIngress {})
|
||||
(nginx.virtualHosts.barcodebuddy.proxied.cloudflared.getIngress {})
|
||||
(if home-assistant.reverseProxy.auth.enable
|
||||
(
|
||||
if home-assistant.reverseProxy.auth.enable
|
||||
then (nginx.virtualHosts.home-assistant.proxied.cloudflared.getIngress {})
|
||||
else {
|
||||
${home-assistant.domain} = assert home-assistant.enable && home-assistant.reverseProxy.enable; {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
in {
|
||||
imports = let
|
||||
inherit (meta) nixos;
|
||||
in [
|
||||
in
|
||||
[
|
||||
nixos.reisen-ct
|
||||
nixos.sops
|
||||
nixos.tailscale
|
||||
|
|
@ -27,7 +28,8 @@ in {
|
|||
nixos.grocy
|
||||
nixos.barcodebuddy
|
||||
./cloudflared.nix
|
||||
] ++ optional hassVouchAuth nixos.access.home-assistant;
|
||||
]
|
||||
++ optional hassVouchAuth nixos.access.home-assistant;
|
||||
|
||||
services.nginx = {
|
||||
proxied.enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue