{ lib, config, pkgs, ... }: let cfg = config.my.home.rust; in { options.my.home.rust = with lib; { enable = mkEnableOption "rust configuration"; }; config = lib.mkIf cfg.enable { home.packages = with pkgs; [ rust-bin.beta.latest.default rust-analyzer ]; home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo"; home.sessionPath = [ "$CARGO_HOME/bin" ]; }; }