NixOS에서 `git gui`를 활성화하는 방법은 무엇입니까?

NixOS에서 `git gui`를 활성화하는 방법은 무엇입니까?

나는 설치했다git그리고tk, 실행하여 git citoolGit GUI를 표시하고하나의제출하면 애플리케이션이 종료됩니다. 불행히도 git gui명령 자체는 다음과 같습니다.

git: 'gui'는 git 명령이 아닙니다. "git --help"를 참조하세요.

그래서 나는 붙어 있습니다. 내가 어떻게 할

  1. git gui명령으로 활성화
  2. 종료하고 싶을 때까지 Git GUI를 표시하시겠습니까?

답변1

설치 git후에 tk는 NixOS에서 작동하지 않습니다 git.바라보다tk. 대부분의 Linux 배포판과 달리 NixOS에는 라이브러리에 대한 전역 위치가 없습니다 /usr/lib(예:). 대신 실행 파일이 수정되어 /nix/storeNix 스토어( )에서 필요한 라이브러리를 찾습니다.

대신 git guiinstall 을 사용하세요 .gitFullgit

두 패키지 모두 실제로 동일한 Nix 표현식에서 나오지만 gitFull해당 표현식이 사용되면 git gui.

답변2

home-manager/를 사용하는 경우 다음 home.nix을 설정해야 합니다 package = pkgs.gitFull.

  programs.git = {
    enable = true;
    userName = "Firstname Lastname";
    userEmail = "[email protected]";
    package = pkgs.gitFull;
  };

참고 사항: 원하는 경우 더 많은 옵션을 설정할 수 있습니다.

    extraConfig = {
      push = {
        # Source: https://stackoverflow.com/a/72401899/873282
        autoSetupRemote = true;
    
        # Always push to the branch we pulled from
        # See https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault for details
        default = "current";
      };

      # Use SVN's ||| also in git - and remove matching lines in the conflict region
      #  See https://git-scm.com/docs/git-config#Documentation/git-config.txt-mergeconflictStyle for details
      merge = { configStyle = "zdiff3"; };

      # Colors in output
      # Source: https://unix.stackexchange.com/a/44297/18033
      color = { ui = "auto"; };
     
      # Sort branches at "git branch -v" by committer date
      branch = { sort = "-committerdate"; };

      # tabs are 4 spaces wide
      gui = { tabsize = 4; };
    };

관련 정보