chore: nf-fmt-nix

This commit is contained in:
arcnmx 2024-05-26 14:05:14 -07:00
parent 0947ca0532
commit fef4f25ca4
8 changed files with 123 additions and 104 deletions

View file

@ -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
)
];

View file

@ -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;

View file

@ -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;

View file

@ -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}";

View file

@ -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

View file

@ -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; {

View file

@ -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;