{
  lib,
  pkgs,
  config,
  ...
}: let
  cfg = config.alqueva.shells.nushell;
in {
  options.alqueva.shells.nushell = {
    enable = lib.mkEnableOption "Nushell";
    package = lib.mkPackageOption pkgs "nushell" {};
  };

  config = lib.mkIf cfg.enable {
    environment = {
      systemPackages = [cfg.package];
      shells = [
        (lib.getExe' cfg.package "nu")
        "/run/current-system/sw/bin/nu"
      ];
    };
  };
}
