diff options
-rw-r--r-- | makefu/2configs/homeautomation/google-muell.nix | 15 | ||||
-rw-r--r-- | makefu/5pkgs/ampel/default.nix | 6 |
2 files changed, 14 insertions, 7 deletions
diff --git a/makefu/2configs/homeautomation/google-muell.nix b/makefu/2configs/homeautomation/google-muell.nix index 235cc1546..5870f298d 100644 --- a/makefu/2configs/homeautomation/google-muell.nix +++ b/makefu/2configs/homeautomation/google-muell.nix @@ -3,13 +3,20 @@ with import <stockholm/lib>; let pkg = pkgs.ampel; home = "/var/lib/ampel"; - sec = "${toString <secrets>}/google-muell.json"; + sec = "${toString <secrets>}/ampel/google-muell.json"; ampelsec = "${home}/google-muell.json"; - cred = "${toString <secrets>}/google-muell-creds.json"; + cred = "${toString <secrets>}/ampel/google-muell-creds.json"; # TODO: generate this credential file locally ampelcred = "${home}/google-muell-creds.json"; - esp = "192.168.8.204"; sleepval = "1800"; + default-color = "244,220,66"; + config_json = toFile "config.json" (toJSON { + mq_hostname = "localhost"; + mq_port = 1883; + mq_username = "sensor"; + mq_topic = "/ham/flurlicht/cmnd/MEM1"; + mq_password = replaceChars ["\n"] [""] (readFile "${toString <secrets>}/mqtt/sensor"); + }); in { users.users.ampel = { uid = genid "ampel"; @@ -27,7 +34,7 @@ in { install -m600 -o ampel ${sec} ${ampelsec} install -m600 -o ampel ${cred} ${ampelcred} ''; - ExecStart = "${pkg}/bin/google-muell --esp=${esp} --client-secrets=${ampelsec} --credential-path=${ampelcred} --sleepval=${sleepval}"; + ExecStart = "${pkg}/bin/google-muell --config ${config_json} --default-color=${default-color} --client-secrets=${ampelsec} --credential-path=${ampelcred} --sleepval=${sleepval}"; PermissionsStartOnly = true; Restart = "always"; RestartSec = 10; diff --git a/makefu/5pkgs/ampel/default.nix b/makefu/5pkgs/ampel/default.nix index 9792c2c59..70fdfda78 100644 --- a/makefu/5pkgs/ampel/default.nix +++ b/makefu/5pkgs/ampel/default.nix @@ -2,7 +2,7 @@ with pkgs.python3Packages;buildPythonPackage rec { name = "ampel-${version}"; - version = "0.2.1"; + version = "0.2.4"; propagatedBuildInputs = [ docopt @@ -16,8 +16,8 @@ with pkgs.python3Packages;buildPythonPackage rec { src = pkgs.fetchgit { url = "http://cgit.euer.krebsco.de/ampel"; - rev = "92321d7"; - sha256 = "0mvpbpf1rx8sc589qjb73gl8z6fir2zs3gl3br1pbhg5jgn0ij4n"; + rev = "04e1c8c38ffe53175ae719121ad88534a8a662db"; + sha256 = "00jgr3jg2yi91hd7388v8rncfbq8fx8dvr03sg749dzpsg58hfxn"; }; meta = { homepage = http://cgit.euer.krebsco.de/ampel; |