From 398133fa93057720cf57a3a321b0a9b58bf963bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 21 Aug 2022 22:10:01 +0200 Subject: [PATCH] Don't error if octoprint is disabled for testing --- hosts/pulsebert/default.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) 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: