summaryrefslogtreecommitdiffstats
path: root/lass/2configs/hass/pyscript/default.nix
blob: c56967e4b143b1698ec42124ddd297d67d771582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ config, lib, pkgs, ... }:
{
  systemd.tmpfiles.rules = [
    "L+ /var/lib/hass/custom_components/pyscript - - - - ${pkgs.fetchzip {
      url = "https://github.com/custom-components/pyscript/releases/download/1.3.2/hass-custom-pyscript.zip";
      sha256 = "0cqdjj46s5xp4mqxb0ic790jm1xp3z0zr2n9f7bsfl5zpvdshl8z";
      stripRoot = false;
    }}"
  ];

  services.home-assistant = {
    package = (pkgs.home-assistant.overrideAttrs (old: {
      doInstallCheck = false;
    })).override {
      extraPackages = pp: [ pp.croniter ];
    };
    config.pyscript = {
      allow_all_imports = true;
      hass_is_global = true;
    };
  };

  networking.firewall.interfaces.retiolum.allowedTCPPortRanges = [
    { from = 50321; to = 50341; } # for ipython interactive debugging
  ];
}