anchor.diff:            CPUSchedulingPriority = 99;
             IOSchedulingClass = "realtime";
             IOSchedulingPriority = 0;
  +          UMask = "0002";
           } // (if cfg.user != null then {
             Group = cfg.group;
             User = cfg.user;
  
positive.code:           (mcu: firmware: pkgs.klipper-flash.override {
              mcu = lib.strings.sanitizeDerivationName mcu;
              klipper-firmware = firmware;
              flashDevice = cfg.settings."${mcu}".serial;
              firmwareConfig = cfg.firmwares."${mcu}".configFile;
            })
            firmwares;
        in
        [ klipper-genconf ] ++ firmwareFlasher ++ attrValues firmwares;
    };
  }
  
negative.code:     assertions = [
        {
          assertion = cfg.octoprintIntegration -> config.services.octoprint.enable;
          message = "Option services.klipper.octoprintIntegration requires Octoprint to be enabled on this system. Please enable services.octoprint to use it.";
        }
        {
          assertion = cfg.user != null -> cfg.group != null;
          message = "Option services.klipper.group is not set when services.klipper.user is specified.";
        }
        {
          assertion = cfg.settings != null -> foldl (a: b: a && b) true (mapAttrsToList (mcu: _: mcu != null -> (hasAttrByPath [ "${mcu}" "serial" ] cfg.settings)) cfg.firmwares);
          message = "Option services.klipper.settings.$mcu.serial must be set when settings.klipper.firmware.$mcu is specified";
        }
        {
          assertion = (cfg.configFile != null) != (cfg.settings != null);
          message = "You need to either specify services.klipper.settings or services.klipper.defaultConfig.";
        }
      ];
  
      environment.etc = mkIf (!cfg.mutableConfig) {
        "klipper.cfg".source = if cfg.settings != null then format.generate "klipper.cfg" cfg.settings else cfg.configFile;
      };
  
      services.klipper = mkIf cfg.octoprintIntegration {
        user = config.services.octoprint.user;
  