home-manager

Switchyard’s flake exposes a home-manager module that installs the package, optionally writes ~/.config/switchyard/config.toml, and registers Switchyard as the default handler for http(s)/text/html.

Setup

Add the flake to your inputs and import the module:

# flake.nix
{
  inputs.switchyard.url = "github:alyraffauf/switchyard";
  # ...
  outputs = { self, nixpkgs, home-manager, switchyard, ... }: {
    homeConfigurations.you = home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
      modules = [
        switchyard.homeManagerModules.switchyard
        ./home.nix
      ];
    };
  };
}
# home.nix
{ ... }: {
  programs.switchyard = {
    enable = true;
    setAsDefaultBrowser = true;
  };
}

Options

Declarative Configuration

settings is a freeform TOML value — any key Switchyard understands is accepted, and new fields added to Switchyard’s Config struct work without changes to the module:

programs.switchyard.settings = {
  favorite_browser = "firefox";
  remove_tracking_parameters = true;
  rules = [
    {
      name = "work";
      browser = "chromium";
      conditions = [ { type = "domain"; pattern = "corp.example.com"; } ];
    }
  ];
};

Warning: Switchyard overwrites config.toml on every in-app config change. Edits made through the GUI will be lost on the next home-manager switch. Treat settings as declarative: pick one source of truth.

See the configuration reference for the full schema.