diff --git a/home-manager/common.nix b/home-manager/common.nix index d5bef98d..8b4e332c 100644 --- a/home-manager/common.nix +++ b/home-manager/common.nix @@ -16,6 +16,7 @@ ./ssh.nix ./git.nix ./editors.nix + ./terminals.nix ./fzf.nix ./firefox.nix ./linux.nix @@ -116,25 +117,6 @@ # Use same nixpkgs channel as same as fzf }; - # https://nixos.wiki/wiki/Home_Manager - # - Prefer XDG_* - # - If can't write the reason as a comment - - # Do not alias *.nix into `xdg.configFile`, it actually cannot be used because of using many relative dirs - # So you should call `home-manager switch` with `-f ~/repos/dotfiles/USER_NAME.nix` - - xdg.configFile."alacritty/alacritty.toml".source = ../config/alacritty/alacritty-unix.toml; - xdg.configFile."alacritty/unix.toml".source = - if pkgs.stdenv.isDarwin then ../config/alacritty/macos.toml else ../config/alacritty/linux.toml; - xdg.configFile."alacritty/common.toml".source = ../config/alacritty/common.toml; - xdg.configFile."alacritty/themes" = { - source = ../config/alacritty/themes; - recursive = true; - }; - - # Not under "starship/starship.toml" - xdg.configFile."starship.toml".source = ../config/starship/starship.toml; - # No home-manager module exists https://github.com/nix-community/home-manager/issues/2890 # TODO: Automate that needs to call `Install-Module -Name PSFzfHistory` first xdg.configFile."powershell/Microsoft.PowerShell_profile.ps1".source = ../config/powershell/Profile.ps1; @@ -173,6 +155,9 @@ enable = true; }; + # Not under "starship/starship.toml" + xdg.configFile."starship.toml".source = ../config/starship/starship.toml; + # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/yazi.nix # TODO: Use shell integrations for `y` after release-24.11. 24.05 is using fixed old `ya` programs.yazi = { diff --git a/home-manager/terminals.nix b/home-manager/terminals.nix new file mode 100644 index 00000000..387492f5 --- /dev/null +++ b/home-manager/terminals.nix @@ -0,0 +1,38 @@ +{ pkgs, lib, ... }: + +{ + xdg = { + configFile = { + "alacritty/alacritty.toml".source = ../config/alacritty/alacritty-unix.toml; + "alacritty/unix.toml".source = + if pkgs.stdenv.isDarwin then ../config/alacritty/macos.toml else ../config/alacritty/linux.toml; + "alacritty/common.toml".source = ../config/alacritty/common.toml; + "alacritty/themes" = { + source = ../config/alacritty/themes; + recursive = true; + }; + }; + }; + + # https://github.com/nix-community/home-manager/blob/release-24.05/modules/programs/kitty.nix + programs.kitty = { + enable = true; + theme = "zenwritten_dark"; + settings = { + shell = lib.getExe pkgs.zsh; + cursor_shape = "beam"; + cursor_blink_interval = 0; + copy_on_select = "clipboard"; + tab_bar_edge = "top"; + # tab_bar_style = "separator"; + # tab_separator = " | "; + tab_bar_style = "slant"; + }; + + # Avoiding a home-manager definition bug for rejecting all float. + # https://github.com/nix-community/home-manager/issues/4850 + extraConfig = '' + background_opacity 0.85 + ''; + }; +}