diff --git a/hosts/pulsebert/default.nix b/hosts/pulsebert/default.nix index e06d3a40..fa99543e 100644 --- a/hosts/pulsebert/default.nix +++ b/hosts/pulsebert/default.nix @@ -83,15 +83,19 @@ RestartSec = "1s"; }; - users.users = { - # Allow access to printer serial port and GPIO - "${config.services.octoprint.user}".extraGroups = [ "dialout" ]; - # Allow gpio group to access GPIO devices - gpio = { - isNormalUser = true; - group = "gpio"; - }; - }; + users.users = lib.mkMerge [ + (lib.optionalAttrs config.services.octoprint.enable { + # Allow access to printer serial port and GPIO + "${config.services.octoprint.user}".extraGroups = [ "dialout" ]; + }) + { + # Allow gpio group to access GPIO devices + gpio = { + isNormalUser = true; + group = "gpio"; + }; + } + ]; services = { # Do not log to flash: