{ final, prev, ... }: {
  persistent-nix-shell = prev.stdenv.mkDerivation {
    name = "persistent-nix-shell";
    src = ./persistent-nix-shell;

    phases = [ "buildPhase" "installPhase" ];

    inherit (final) zsh;

    buildPhase = ''
      substituteAll $src persistent-nix-shell
    '';

    installPhase = ''
      install -m 0755 -D -t $out/bin \
        persistent-nix-shell
    '';
  };
}