murex: initialize gpio
This commit is contained in:
parent
f35353812a
commit
c15d04479e
15
murex.nix
15
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
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user