Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install iTerm2 with home-manager #250

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions home-manager/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,13 @@
# https://github.com/LnL7/nix-darwin/blob/16c07487ac9bc59f58b121d13160c67befa3342e/modules/system/defaults/finder.nix#L8-L14

# https://github.com/nix-community/home-manager/issues/414#issuecomment-427163925
let
iterm2Repository = pkgs.fetchFromGitHub
{
owner = "gnachman";
repo = "iTerm2";
rev = "e7c4c4b1ba6b21a19a48be2dad67048099be176e";
sha256 = "sha256-7F8l2QEnTMJlOCpT2WQ8f7iv8I96fMqDa5MM4oQAvYQ=";
};
in
lib.mkMerge [
(lib.mkIf pkgs.stdenv.isDarwin {
xdg.configFile."iterm2/com.googlecode.iterm2.plist".source = ../home/.config/iterm2/com.googlecode.iterm2.plist;

# Do not use `programs.zsh.dotDir`, it does not refer xdg module
xdg.configFile."zsh/.zshrc.darwin".text = ''
source ${iterm2Repository + "/Resources/shell_integration/iterm2_shell_integration.zsh"}
source ${pkgs.iterm2 + "/Applications/iTerm2.app/Contents/Resources/iterm2_shell_integration.zsh"}
'';

# Just putting the refererenced file to easy import, applying should be done via GUI and saving to plist
Expand Down
11 changes: 11 additions & 0 deletions home-manager/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
# { };
# in

# FAQ
#
# A. How to know and get the paths inside a pkg?
# Q. `nix path-info` is a way, installing iTerm2 shell integration used it. Access /nix/store~ path, and `ls` helps you.


{
home.packages = with pkgs; [
# Use `bashInteractive`, don't `bash` - https://github.com/NixOS/nixpkgs/issues/29960, https://github.com/NixOS/nix/issues/730
Expand Down Expand Up @@ -96,5 +102,10 @@
# Fix missing locales as `locale: Cannot set LC_CTYPE to default locale`
glibc
]
) ++ (lib.optionals stdenv.isDarwin
[
# https://github.com/NixOS/nixpkgs/commit/3ea22dab7d906f400cc5983874dbadeb8127c662#diff-32e42fa095503d211e9c2894de26c22166cafb875d0a366701922aa23976c53fL21-L33
iterm2
]
);
}