Merge remote-tracking branch 'gum/master'

This commit is contained in:
lassulus 2019-10-31 08:43:51 +01:00
commit 36fb248f88
13 changed files with 61 additions and 85 deletions

View file

@ -6,7 +6,7 @@ let
url = "https://git.shackspace.de/rz/muellshack"; url = "https://git.shackspace.de/rz/muellshack";
rev = "d8a5e2d4c0a22804838675ac42b468299dcd9a76"; rev = "d8a5e2d4c0a22804838675ac42b468299dcd9a76";
sha256 = "0ff6q64dgdxmpszp94z100fdic175b1vvxn4crg8p0jcabzxsv0m"; sha256 = "0ff6q64dgdxmpszp94z100fdic175b1vvxn4crg8p0jcabzxsv0m";
}) {}; }) { mkYarnPackage = pkgs.yarn2nix-moretea.mkYarnPackage; };
home = "/var/lib/muellshack"; home = "/var/lib/muellshack";
port = "8081"; port = "8081";
in { in {

View file

@ -8,7 +8,7 @@ let
nginx-user = config.services.nginx.user; nginx-user = config.services.nginx.user;
nginx-group = config.services.nginx.group; nginx-group = config.services.nginx.group;
fpm-socket = "/var/run/php5-fpm-rutorrent.sock"; fpm-socket = config.services.phpfpm.pools.rutorrent.socket;
webdir = rucfg.webdir; webdir = rucfg.webdir;
systemd-logfile = cfg.workDir + "/rtorrent-systemd.log"; systemd-logfile = cfg.workDir + "/rtorrent-systemd.log";
@ -332,12 +332,11 @@ let
rutorrent-imp = { rutorrent-imp = {
services.phpfpm = { services.phpfpm = {
# phpfpm does not have an enable option
pools.rutorrent = { pools.rutorrent = {
user = nginx-user; user = nginx-user;
group = nginx-group; group = nginx-group;
listen = fpm-socket;
settings = { settings = {
"listen.owner" = nginx-user;
"pm" = "dynamic"; "pm" = "dynamic";
"pm.max_children" = 5; "pm.max_children" = 5;
"pm.start_servers" = 2; "pm.start_servers" = 2;

View file

@ -33,8 +33,7 @@ in {
extraPackages = ps: with ps; [ extraPackages = ps: with ps; [
pkgs.pico2wave pkgs.pico2wave
python-forecastio jsonrpc-async jsonrpc-websocket mpd2 python-forecastio jsonrpc-async jsonrpc-websocket mpd2
(callPackage ./deps/gtts-token.nix { }) (callPackage ./deps/openwrt-luci-rpc.nix { })
(callPackage ./deps/pyhaversion.nix { })
]; ];
}; };
autoExtraComponents = true; autoExtraComponents = true;
@ -47,8 +46,16 @@ in {
elevation = 303; elevation = 303;
auth_providers = [ auth_providers = [
{ type = "homeassistant";} { type = "homeassistant";}
{ type = "legacy_api_password";} { type = "legacy_api_password";
api_password = "sistemas";
}
{ type = "trusted_networks"; { type = "trusted_networks";
trusted_networks = [
"127.0.0.1/32"
"192.168.8.0/24"
"::1/128"
"fd00::/8"
];
# allow_bypass_login = true; # allow_bypass_login = true;
} }
]; ];
@ -119,7 +126,7 @@ in {
aramark.binary_sensor; aramark.binary_sensor;
sensor = sensor =
[{ platform = "version"; }] ++ # [{ platform = "version"; }] ++ # pyhaversion
(import ./sensor/pollen.nix) ++ (import ./sensor/pollen.nix) ++
(import ./sensor/espeasy.nix) ++ (import ./sensor/espeasy.nix) ++
(import ./sensor/airquality.nix) ++ (import ./sensor/airquality.nix) ++
@ -140,20 +147,15 @@ in {
http = { http = {
# TODO: https://github.com/home-assistant/home-assistant/issues/16149 # TODO: https://github.com/home-assistant/home-assistant/issues/16149
base_url = "http://192.168.8.11:8123"; base_url = "http://192.168.8.11:8123";
api_password = "sistemas";
trusted_networks = [
"127.0.0.1/32"
"192.168.8.0/24"
"::1/128"
"fd00::/8"
];
}; };
conversation = {}; conversation = {};
history = {}; history = {};
logbook = {}; logbook = {};
tts = [ tts = [
{ platform = "google"; { platform = "google_translate";
language = "de"; language = "de";
time_memory = 57600;
service_name = "google_say";
} }
{ platform = "voicerss"; { platform = "voicerss";
api_key = builtins.readFile <secrets/hass/voicerss.apikey>; api_key = builtins.readFile <secrets/hass/voicerss.apikey>;

View file

@ -1,27 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, requests
}:
buildPythonPackage rec {
pname = "gtts-token";
version = "1.1.3";
src = fetchPypi {
pname = "gTTS-token";
inherit version;
sha256 = "9d6819a85b813f235397ef931ad4b680f03d843c9b2a9e74dd95175a4bc012c5";
};
propagatedBuildInputs = [
requests
];
meta = with lib; {
description = "Calculates a token to run the Google Translate text to speech";
homepage = https://github.com/boudewijn26/gTTS-token;
license = licenses.mit;
# maintainers = [ maintainers. ];
};
}

View file

@ -0,0 +1,34 @@
{ lib
, buildPythonPackage
, fetchPypi
, click
, requests
, packaging
}:
buildPythonPackage rec {
pname = "openwrt-luci-rpc";
version = "1.1.2";
src = fetchPypi {
inherit pname version;
sha256 = "174a1f6c0bb2a2ed76e5299d14e2be05c612e8bcd4c15b9a9aedee1ef8e18b90";
};
patchPhase = ''
sed -i -e "s/requests==2.21.0/requests/" -e "s/packaging==19.1/packaging/" setup.py
'';
propagatedBuildInputs = [
click
requests
packaging
];
meta = with lib; {
description = "Module for interacting with OpenWrt Luci RPC interface";
homepage = https://github.com/fbradyirl/openwrt-luci-rpc;
license = licenses.asl20;
maintainers = [ maintainers.makefu ];
};
}

View file

@ -1,33 +0,0 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, aiohttp
, async-timeout
}:
buildPythonPackage rec {
pname = "pyhaversion";
version = "2.2.1";
src = fetchPypi {
inherit pname version;
sha256 = "72b65aa25d7b2dbb839a4d0218df2005c2335e93526035904d365bb668030b9f";
};
patches = [
(fetchpatch { url = "https://github.com/makefu/pyhaversion/commit/f3bdc38970272cd345c2cfbde3037ea492ca27c4.patch";
sha256 =
"1rhq4z7mdgnwhwpf5fmarnbc1ba3qysk1wqjdr0hvbzi8vmvbfcc";})
];
doCheck = false;
propagatedBuildInputs = [
aiohttp
async-timeout
];
meta = with lib; {
description = "";
homepage = https://github.com/ludeeus/pyhaversion;
# maintainers = [ maintainers. ];
};
}

View file

@ -3,7 +3,6 @@
[ [
{ platform = "luci"; { platform = "luci";
name = "router";
host = "192.168.8.1"; host = "192.168.8.1";
username = "root"; username = "root";
password = import <secrets/hass/router.nix>; password = import <secrets/hass/router.nix>;

View file

@ -24,13 +24,13 @@ let
brightness_command_topic = "/bam/${topic}/cmnd/Dimmer"; brightness_command_topic = "/bam/${topic}/cmnd/Dimmer";
brightness_scale = 100; brightness_scale = 100;
# color # color
rgb_state_topic = "/bam/${topic}/stat/Color"; rgb_state_topic = "/bam/${topic}/stat/RESULT";
rgb_command_topic = "/bam/${topic}/cmnd/Color2"; rgb_command_topic = "/bam/${topic}/cmnd/Color2";
rgb_command_mode = "hex"; rgb_value_template = "{{(value_json.Channel[0]*2.55)|int}},{{(value_json.Channel[1]*2.55)|int}},{{(value_json.Channel[2]*2.55)|int}}";
rgb_command_template = "{{ '%02x%02x%02x' | format(red, green, blue)}}";
# effects # effects
effect_state_topic = "/bam/${topic}/tele/STATE"; effect_state_topic = "/bam/${topic}/tele/STATE";
effects_value_template = "{{value_json.Scheme|default(0)}}"; effect_value_template = "{{value_json.Scheme|default(0)}}";
effect_command_topic = "/bam/${topic}/cmnd/Scheme"; effect_command_topic = "/bam/${topic}/cmnd/Scheme";
effect_list = [ effect_list = [
0 # single color for LED light 0 # single color for LED light

View file

@ -15,7 +15,7 @@
"uv_index" "uv_index"
]; ];
units = "si" ; units = "si" ;
update_interval = { days = 0; hours = 0; minutes = 30; seconds = 0; }; scan_interval = "00:30:00";
} }
{ platform = "luftdaten"; { platform = "luftdaten";
name = "Ditzingen"; name = "Ditzingen";

View file

@ -1,6 +1,6 @@
[ { [ {
platform = "dwd_pollen"; platform = "dwd_pollen";
partsregion_ids = [ partregion_ids = [
112 112
]; ];
} }

View file

@ -127,6 +127,7 @@ let
group = "nginx"; group = "nginx";
listen = socket; listen = socket;
settings = { settings = {
"listen.owner" = "nginx";
"pm" = "dynamic"; "pm" = "dynamic";
"pm.max_children" = 32; "pm.max_children" = 32;
"pm.max_requests" = 500; "pm.max_requests" = 500;

View file

@ -27,6 +27,7 @@ in {
inherit user group; inherit user group;
listen = fpm-socket; listen = fpm-socket;
settings = { settings = {
"listen.owner" = user;
"pm" = "dynamic"; "pm" = "dynamic";
"pm.max_children" = 5; "pm.max_children" = 5;
"pm.start_servers" = 2; "pm.start_servers" = 2;

View file

@ -1,11 +1,11 @@
{ stdenv, lib, fetchFromGitHub, mbedtls, python2, perl }: { stdenv, lib, fetchFromGitHub, mbedtls, python2, perl }:
let let
version = "1.35"; version = "4.03";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "The-4n"; owner = "The-4n";
repo = "4NXCI"; repo = "4NXCI";
rev = "v${version}"; rev = "v${version}";
sha256 = "0yq0irxzi4wi71ajw8ld01zfpkrgknpq7g3m76pbnwmdzkm7dra6"; sha256 = "0n49sqv6s8cj2dw1dbcyskfc2zr92p27f1bdd6jqfbawv0fqr1wf";
}; };
mymbedtls = stdenv.mkDerivation { mymbedtls = stdenv.mkDerivation {