Commit fe7065bf authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt
Browse files

thefuck: drop

It was pinned to python311 last summer due to two uses of the removed module 'imp'.
One of the uses are fixed on the upstream master branch but is unreleased, and the second use is fixed by two separate open PRs. The author is unresponsive and has been inactive since january 2024.
Rather than rebase and apply the two fixes I feel it makes more sense to drop the package.
parent f880c595
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -316,7 +316,6 @@
  ./programs/systemtap.nix
  ./programs/tcpdump.nix
  ./programs/television.nix
  ./programs/thefuck.nix
  ./programs/thunar.nix
  ./programs/thunderbird.nix
  ./programs/tmux.nix
+0 −43
Original line number Diff line number Diff line
{
  config,
  pkgs,
  lib,
  ...
}:

let
  prg = config.programs;
  cfg = prg.thefuck;

  bashAndZshInitScript = ''
    eval $(${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias})
  '';
  fishInitScript = ''
    ${pkgs.thefuck}/bin/thefuck --alias ${cfg.alias} | source
  '';
in
{
  options = {
    programs.thefuck = {
      enable = lib.mkEnableOption "thefuck, an app which corrects your previous console command";

      alias = lib.mkOption {
        default = "fuck";
        type = lib.types.str;

        description = ''
          `thefuck` needs an alias to be configured.
          The default value is `fuck`, but you can use anything else as well.
        '';
      };
    };
  };

  config = lib.mkIf cfg.enable {
    environment.systemPackages = with pkgs; [ thefuck ];

    programs.bash.interactiveShellInit = bashAndZshInitScript;
    programs.zsh.interactiveShellInit = lib.mkIf prg.zsh.enable bashAndZshInitScript;
    programs.fish.interactiveShellInit = lib.mkIf prg.fish.enable fishInitScript;
  };
}
+4 −0
Original line number Diff line number Diff line
@@ -66,6 +66,10 @@ in
      pantheon-tweaks is no longer a switchboard plugin but an independent app,
      adding the package to environment.systemPackages is sufficient.
    '')
    (mkRemovedOptionModule [ "programs" "thefuck" ] ''
      The corresponding package was removed from nixpkgs,
      consider using `programs.pay-respects` instead.
    '')
    (mkRemovedOptionModule [ "programs" "tilp2" ] "The corresponding package was removed from nixpkgs.")
    (mkRemovedOptionModule [ "programs" "way-cooler" ] (
      "way-cooler is abandoned by its author: "
+0 −59
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  python311Packages,
  go,
}:

python311Packages.buildPythonApplication rec {
  pname = "thefuck";
  version = "3.32";

  src = fetchFromGitHub {
    owner = "nvbn";
    repo = "thefuck";
    tag = version;
    hash = "sha256-bRCy95owBJaxoyCNQF6gEENoxCkmorhyKzZgU1dQN6I=";
  };

  dependencies = with python311Packages; [
    colorama
    decorator
    psutil
    pyte
    six
  ];

  nativeCheckInputs =
    [ go ]
    ++ (with python311Packages; [
      mock
      pytest7CheckHook
      pytest-mock
    ]);

  disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
    "test_settings_defaults"
    "test_from_file"
    "test_from_env"
    "test_settings_from_args"
    "test_get_all_executables_exclude_paths"
    "test_with_blank_cache"
    "test_with_filled_cache"
    "test_when_etag_changed"
    "test_for_generic_shell"
    "test_on_first_run"
    "test_on_run_after_other_commands"
    "test_when_cant_configure_automatically"
    "test_when_already_configured"
    "test_when_successfully_configured"
  ];

  meta = {
    homepage = "https://github.com/nvbn/thefuck";
    description = "Magnificent app which corrects your previous console command";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ marcusramberg ];
  };
}
+1 −0
Original line number Diff line number Diff line
@@ -1884,6 +1884,7 @@ mapAliases {
  testVersion = testers.testVersion; # Added 2022-04-20
  tfplugindocs = terraform-plugin-docs; # Added 2023-11-01
  thiefmd = throw "'thiefmd' has been removed due to lack of maintenance upstream and incompatible with newer Pandoc. Please use 'apostrophe' or 'folio' instead"; # Added 2025-02-20
  thefuck = throw "'thefuck' has been removed due to lack of maintenance upstream and incompatible with python 3.12+. Consider using 'pay-respects' instead"; # Added 2025-05-30
  invalidateFetcherByDrvHash = testers.invalidateFetcherByDrvHash; # Added 2022-05-05
  tijolo = throw "'tijolo' has been removed due to being unmaintained"; # Added 2024-12-27
  timescale-prometheus = throw "'timescale-prometheus' has been renamed to/replaced by 'promscale'"; # Converted to throw 2024-10-17