feat: add zwift integration to home-assistant

This commit is contained in:
Nickolaj Jepsen 2026-01-20 00:22:18 +01:00
parent 04c85ec904
commit f1d4ea06fc
8 changed files with 47 additions and 13 deletions

View file

@ -1,7 +1,7 @@
_: {
monitors = [
{
name = "DP-2";
name = "DP-3";
resolution = {
width = 2560;
height = 1440;
@ -14,7 +14,7 @@ _: {
};
}
{
name = "DP-3";
name = "DP-2";
resolution = {
width = 2560;
height = 1440;

View file

@ -39,6 +39,7 @@ switch hostname=`hostname -s` target='':
else
{{ nixcmd }} run nixpkgs#nixos-rebuild -- switch \
--flake .#{{ hostname }} \
--use-substitutes \
--target-host {{ target }} \
--sudo
fi

View file

@ -79,6 +79,36 @@ in {
hash = "sha256-W9xO3JjnRKHk/dlXMA6y5nEJl/KsGzPvJoumGw+nohw=";
};
})
(pkgs.buildHomeAssistantComponent rec {
owner = "snicker";
domain = "zwift";
version = "v3.3.5";
src = pkgs.fetchFromGitHub {
inherit owner;
repo = "zwift_hass";
rev = version;
hash = "sha256-+lJ6Otp8lT+xVtjiQLSQrqT5cVinRTRPTzS+HB1AxB0=";
};
propagatedBuildInputs = [
(pkgs.python313.pkgs.buildPythonPackage rec {
pname = "zwift-client";
version = "0.2.0";
pyproject = true;
src = pkgs.fetchFromGitHub {
owner = "nickolaj-jepsen";
repo = "zwift-client";
rev = "882fb881f1271dc104fd0250cab4ceb6e3710a59";
hash = "sha256-4gOlWG+QVwODlIhiNH7rhiD0rzNv2WxY2ty9o/51eHU=";
};
doCheck = false;
propagatedBuildInputs = with pkgs.python313.pkgs; [
hatchling
requests
protobuf
];
})
];
})
];
extraComponents = [
"default_config"
@ -110,8 +140,14 @@ in {
"127.0.0.1"
"::1"
];
# base_url = "https://ha.nickolaj.com";
};
sensor = [
{
platform = "zwift";
username = "!secret zwift_username";
password = "!secret zwift_password";
}
];
automation = "!include automations.yaml";
script = "!include scripts.yaml";

View file

@ -108,4 +108,9 @@ in {
cookie-domain = ".${rootDomain}";
};
};
systemd.services.oauth2-proxy.serviceConfig = {
Restart = "always";
RestartSec = "5s";
};
})

View file

@ -7,8 +7,8 @@
}: {
config = lib.mkIf config.fireproof.dev.enable {
environment.systemPackages = with inputs.opencode.packages.${pkgs.stdenv.hostPlatform.system}; [
opencode
desktop
# opencode
# desktop
];
};
}

View file

@ -1,8 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 uxq+Zw reTHDLwj8jaI7giq5hw77+cvVurKP2vR8KeonjAJ+nY
Pe6Df2WQawEnCp5GVCzegzEJaK868bhwZm2hEEwAc/I
-> 6`Rk-grease K=O ttrh.^ [o4vdGR
9xDUT+18cwMzzTgWlQzWBAniL9GAv+e4rmhwu3Vdwdh/mBeXJdfgEMxTqyRZk9TX
BSW+CifV9iGZXmYm9b+NzKwWJUQ
--- /NXPE/9QIghJoaXFNtmPMvs78dD2RdXbDWiBnwgXIzo
£äÂe’Û•r³ü12„G­ªˆ ¸[îsM[#¶Ô<C2B6>±ª,»ÁI< ö<>ÿ*~aýÎY³vYX½éŽOQÒøKÎ:°#g&:£õmÖHÀççKÇ· žEZ·-þúpjËà˜Ý!¿]

Binary file not shown.