{ config, lib, pkgs, ... }:

let cfg = config.sydnix.drawing-tablet;
in {
  options.sydnix.drawing-tablet = {
    enable = lib.mkEnableOption "drawing tablet support";
  };

  # Also see the NixOS module!!
  config = lib.mkIf cfg.enable {
    # Mutable config.
    sydnix.impermanence.directories =
      let xdg-config-home =
        lib.removePrefix "${config.home.homeDirectory}"
          (lib.removePrefix "~"
            (config.xdg.configHome));
      in [ "${xdg-config-home}/OpenTabletDriver" ];
  };
}
