{ pkgs
, lib
, config
, ... }: with lib; let
  cfg = config.home.gyroflow;
in {
  options.home.gyroflow = {
    enable = mkEnableOption "gyroflow stabilisation software";
  };

  config = {
    users.homeModules = [
      # this module passes gyroflow configuration to home-manager
      { passthrough.gyroflow = cfg; }
    ];

    users.home.persist.directories = mkIf cfg.enable [ ".config/Gyroflow" ];
  };
}