anchor.diff:          gid = config.ids.gids.octoprint;
         });
   
  +    systemd.tmpfiles.rules = [
  +      "d '${cfg.stateDir}' - ${cfg.user} ${cfg.group} - -"
  +    ];
  +
       systemd.services.octoprint = {
         description = "OctoPrint, web interface for 3D printers";
         wantedBy = [ "multi-user.target" ];
  
positive.code:       environment.PYTHONPATH = makeSearchPathOutput "lib" pkgs.python.sitePackages [ pluginsEnv ];
  
        preStart = ''
          mkdir -p "${cfg.stateDir}"
          if [ -e "${cfg.stateDir}/config.yaml" ]; then
            ${pkgs.yaml-merge}/bin/yaml-merge "${cfg.stateDir}/config.yaml" "${cfgUpdate}" > "${cfg.stateDir}/config.yaml.tmp"
            mv "${cfg.stateDir}/config.yaml.tmp" "${cfg.stateDir}/config.yaml"
  
negative.code:           cp "${cfgUpdate}" "${cfg.stateDir}/config.yaml"
            chmod 600 "${cfg.stateDir}/config.yaml"
          fi
        '';
  
        serviceConfig = {
          ExecStart = "${pkgs.octoprint}/bin/octoprint serve -b ${cfg.stateDir}";
          User = cfg.user;
          Group = cfg.group;
        };
      };
  
  