Home-assistant setup
This commit is contained in:
parent
2bdccc9fdb
commit
e54fd18fbb
17
flake.lock
17
flake.lock
@ -413,6 +413,7 @@
|
||||
"nixpkgs-wayland": "nixpkgs-wayland",
|
||||
"simple-nixos-mailserver": "simple-nixos-mailserver",
|
||||
"simple-osd-daemons": "simple-osd-daemons",
|
||||
"sonoff-lan": "sonoff-lan",
|
||||
"wee-slack": "wee-slack",
|
||||
"weechat-notify-send": "weechat-notify-send",
|
||||
"weechat-scripts": "weechat-scripts",
|
||||
@ -454,6 +455,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"sonoff-lan": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1615813622,
|
||||
"narHash": "sha256-05KhxvwHm3hya/9uibSggnRjmU1QOxJNzUacfsoYQ64=",
|
||||
"owner": "AlexxIT",
|
||||
"repo": "SonoffLAN",
|
||||
"rev": "412b1b709c5f5de6f1266cf4e6f0b4795a827976",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AlexxIT",
|
||||
"repo": "SonoffLAN",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"locked": {
|
||||
"lastModified": 1610051610,
|
||||
|
@ -55,6 +55,10 @@
|
||||
nix-zsh-completions.url = "github:Ma27/nix-zsh-completions/flakes";
|
||||
nix-zsh-completions.flake = false;
|
||||
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||
sonoff-lan = {
|
||||
url = "github:AlexxIT/SonoffLAN";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, nix, self, deploy-rs, ... }@inputs: {
|
||||
|
@ -10,6 +10,7 @@
|
||||
nextcloud
|
||||
nginx
|
||||
vsftpd
|
||||
home-assistant
|
||||
];
|
||||
|
||||
services.logind.lidSwitch = "ignore";
|
||||
|
@ -32,6 +32,7 @@ builtins.listToAttrs (builtins.map (path: {
|
||||
./servers/nextcloud.nix
|
||||
./servers/nginx.nix
|
||||
./servers/vsftpd.nix
|
||||
./servers/home-assistant.nix
|
||||
./services.nix
|
||||
./themes.nix
|
||||
./virtualisation.nix
|
||||
|
50
modules/servers/home-assistant.nix
Normal file
50
modules/servers/home-assistant.nix
Normal file
@ -0,0 +1,50 @@
|
||||
{ config, pkgs, lib, inputs, ... }: {
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
package = (pkgs.home-assistant.override {
|
||||
extraPackages = py: with py; [ aiohttp-cors zeroconf pycrypto ];
|
||||
}).overrideAttrs (_: {
|
||||
tests = [];
|
||||
doInstallCheck = false;
|
||||
});
|
||||
config = {
|
||||
homeassistant = {
|
||||
name = "Home";
|
||||
time_zone = "Europe/Moscow";
|
||||
latitude = 1;
|
||||
longitude = 1;
|
||||
elevation = 1;
|
||||
unit_system = "metric";
|
||||
temperature_unit = "C";
|
||||
};
|
||||
# Enable the frontend
|
||||
frontend = { };
|
||||
sonoff = {
|
||||
default_class = "light";
|
||||
};
|
||||
mobile_app = { };
|
||||
};
|
||||
};
|
||||
systemd.tmpfiles.rules = [
|
||||
"C /var/lib/hass/custom_components/sonoff - - - - ${inputs.sonoff-lan}/custom_components/sonoff"
|
||||
"Z /var/lib/hass 770 hass hass - -"
|
||||
];
|
||||
services.nginx = {
|
||||
virtualHosts."hass.balsoft.ru" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
extraConfig = ''
|
||||
proxy_buffering off;
|
||||
'';
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8123";
|
||||
proxyWebsockets = true;
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user