diff --git a/murex.nix b/murex.nix index ad75308..f5c5e69 100644 --- a/murex.nix +++ b/murex.nix @@ -64,7 +64,7 @@ users.extraUsers.gebner = { isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "audio" "transmission" ]; + extraGroups = [ "wheel" "networkmanager" "audio" "dialout" ]; shell = pkgs.fish; # password = if config.virtualisation != null then "" else null; }; @@ -135,6 +135,19 @@ }) ]; }; + systemd.services.setupGpioForRelais = rec { + wantedBy = [ "octoprint.service" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = "yes"; + }; + script = '' + if echo 17 > /sys/class/gpio/export; then + echo high > /sys/class/gpio/gpio17/direction + fi + chgrp dialout /sys/class/gpio/gpio17/value + ''; + }; users.users.${config.services.octoprint.user}.extraGroups = [ "dialout" # ttyUSB access ];