From e921a66d8f47205b673147d521b5fee7bed60a0f Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 21 Aug 2023 15:08:11 +0900 Subject: [PATCH] Split alacritty config for non preinstalled PowerShell 7 in Windows --- .github/workflows/ci-home.yml | 1 + home-manager/home.nix | 3 ++- home-manager/packages.nix | 1 + .../{alacritty.yml => alacritty-common.yml} | 0 home/.config/alacritty/alacritty-unix.yml | 12 +++++++++ home/.config/alacritty/alacritty-windows.yml | 27 +++++++++++++++++++ windows/README.md | 4 ++- 7 files changed, 46 insertions(+), 2 deletions(-) rename home/.config/alacritty/{alacritty.yml => alacritty-common.yml} (100%) create mode 100644 home/.config/alacritty/alacritty-unix.yml create mode 100644 home/.config/alacritty/alacritty-windows.yml diff --git a/.github/workflows/ci-home.yml b/.github/workflows/ci-home.yml index 299ad6d4..1412fc18 100644 --- a/.github/workflows/ci-home.yml +++ b/.github/workflows/ci-home.yml @@ -61,6 +61,7 @@ jobs: zsh -c 'which dprint' zsh -c 'ruby --version' zsh -c 'irb --version' + zsh -c 'alacritty --version' zsh -c 'ssh -V' - name: Run homemade commands run: zsh -c 'la' diff --git a/home-manager/home.nix b/home-manager/home.nix index 170e6fe7..5c6122e8 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -101,7 +101,8 @@ # Do not alias home.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/home.nix` - xdg.configFile."alacritty/alacritty.yml".source = ../home/.config/alacritty/alacritty.yml; + xdg.configFile."alacritty/alacritty-common.yml".source = ../home/.config/alacritty/alacritty-common.yml; + xdg.configFile."alacritty/alacritty.yml".source = ../home/.config/alacritty/alacritty-unix.yml; # Not under "starship/starship.toml" xdg.configFile."starship.toml".source = ../home/.config/starship.toml; diff --git a/home-manager/packages.nix b/home-manager/packages.nix index c04e3a8e..f5ccc88b 100644 --- a/home-manager/packages.nix +++ b/home-manager/packages.nix @@ -58,6 +58,7 @@ bottom tig zellij + alacritty typos hyperfine difftastic diff --git a/home/.config/alacritty/alacritty.yml b/home/.config/alacritty/alacritty-common.yml similarity index 100% rename from home/.config/alacritty/alacritty.yml rename to home/.config/alacritty/alacritty-common.yml diff --git a/home/.config/alacritty/alacritty-unix.yml b/home/.config/alacritty/alacritty-unix.yml new file mode 100644 index 00000000..5e7a3e05 --- /dev/null +++ b/home/.config/alacritty/alacritty-unix.yml @@ -0,0 +1,12 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +import: + - ~/.config/alacritty/alacritty-common.yml diff --git a/home/.config/alacritty/alacritty-windows.yml b/home/.config/alacritty/alacritty-windows.yml new file mode 100644 index 00000000..7220ae25 --- /dev/null +++ b/home/.config/alacritty/alacritty-windows.yml @@ -0,0 +1,27 @@ +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +import: + - ~/.config/alacritty/alacritty-common.yml + +# Shell +# +# You can set `shell.program` to the path of your favorite shell, e.g. +# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the +# shell. +# +# Default: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (Windows) powershell +shell: + program: pwsh + args: + - -WorkingDirectory + - '~/' diff --git a/windows/README.md b/windows/README.md index 2e065b6e..86c290cc 100644 --- a/windows/README.md +++ b/windows/README.md @@ -8,9 +8,11 @@ 1. On powershell ```powershell mkdir -p ~/.config + mkdir -p ~/.config/alacritty mkdir -p "$($env:APPDATA)/alacritty" Copy-Item "\\wsl.localhost\Ubuntu\home\kachick\repos\dotfiles\home\.config/starship.toml" -Destination ~/.config - Copy-Item "\\wsl.localhost\Ubuntu\home\kachick\repos\dotfiles\home\.config/alacritty/alacritty.yml" -Destination "$($env:APPDATA)/alacritty/alacritty.yml" + Copy-Item "\\wsl.localhost\Ubuntu\home\kachick\repos\dotfiles\home\.config/alacritty/alacritty-common.yml" -Destination ~/.config/alacritty + Copy-Item "\\wsl.localhost\Ubuntu\home\kachick\repos\dotfiles\home\.config/alacritty/alacritty-windows.yml" -Destination "$($env:APPDATA)/alacritty/alacritty.yml" Copy-Item "\\wsl.localhost\Ubuntu\home\kachick\repos\dotfiles\windows\Microsoft.PowerShell_profile.ps1" -Destination "$PROFILE" ``` 1. Enable Bitlocker and backup the restore key