summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/powerraw.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2020-12-30 09:24:39 +0100
committerlassulus <lassulus@lassul.us>2020-12-30 09:24:39 +0100
commita180af5b08160f50300769062c120edab3372d81 (patch)
tree19293e02d54c55686d0bc31cef211e77787df688 /krebs/2configs/shack/powerraw.nix
parente0bb61d3d3c2e053ab8c8c22f9cdded409ecece7 (diff)
parentdb80207267dd750d6e5fce0a4c15961aa324627b (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/2configs/shack/powerraw.nix')
-rw-r--r--krebs/2configs/shack/powerraw.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/krebs/2configs/shack/powerraw.nix b/krebs/2configs/shack/powerraw.nix
index 3cf6beb28..cc3692e85 100644
--- a/krebs/2configs/shack/powerraw.nix
+++ b/krebs/2configs/shack/powerraw.nix
@@ -8,20 +8,25 @@ let
pkg = pkgs.python3.pkgs.callPackage (
pkgs.fetchgit {
url = "https://git.shackspace.de/rz/powermeter.git";
- rev = "96609f0d632e0732afa768ddd7b3f8841ca37c1b";
- sha256 = "sha256:0wfpm3ik5r081qv2crmpjwylgg2v8ximq347qh0fzq1rwv0dqbnn";
+ rev = "438b08f";
+ sha256 = "0c5czmrwlw985b7ia6077mfrvbf2fq51iajb481pgqbywgxqis5m";
}) {};
in {
# receive response from light.shack / standby.shack
networking.firewall.allowedUDPPorts = [ 11111 ];
users.users.powermeter.extraGroups = [ "dialout" ];
+ # we make sure that usb-ttl has the correct permissions
+ # creates /dev/powerraw
+ services.udev.extraRules = ''
+ SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="powerraw", MODE="0660", GROUP="dialout"
+ '';
systemd.services.powermeter-serial2mqtt = {
description = "powerraw Serial -> mqtt";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "powermeter";
- ExecStart = "${pkg}/bin/powermeter-serial2mqtt";
+ ExecStart = "${pkg}/bin/powermeter-serial2mqtt /dev/powerraw";
PrivateTmp = true;
Restart = "always";
RestartSec = "15";