My configuration files and scripts for a Neovim/LazyVim integrated development environment in a docker container (fedora).
- Clipboard solution relying on OSC52
- UI solution based on X11, mainly used for browser preview using xdg-open under the hood
- Install and configure everything as a non-root user
- Docker in Docker (dnd)
- Tested on macOS Sonoma
- Docker
- Kitty (or any OSC52 compliant terminal)
- xQuartz (or any X11 server)
Create your ssh keys
felix@macos ~ % ssh-keygen -t ed25519 -C "[email protected]"
felix@macos ~ % ssh-add --apple-use-keychain ~/.ssh/id_ed25519
Test your github access
felix@macos ~ % ssh -T [email protected]
Hi sysadmin4j! You've successfully authenticated, but GitHub does not provide shell access.
Make sure the ssh-agent is used
felix@macos ~ % ssh-add -l
256 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [email protected] (ED25519)
Ref:
Setting up the git config ~/.gitconfig
, creating the IDE_WORKSPACE
folder, and cloning the dotfiles repository
felix@macos ~ % git config --global user.name "Mona Lisa"
felix@macos ~ % git config --global user.email [email protected]
felix@macos ~ % mkdir Repos
felix@macos ~ % cd Repos
felix@macos Repos % git clone [email protected]:sysadmin4j/dotfiles.git
felix@macos Repos % cd dotfiles
felix@macos dotfiles % git status
Ref:
- Github documentation - Setting your username in Git
- Github documentation - Setting your commit email address
TODO
Ref:
- Github documentation - Generating a new GPG key
- Github documentation - Telling Git about your signing key
Install the fonts MesloLGL Nerd Font Mono in the macOS user Library folder
felix@macos dotfiles % ./scripts/install-nerd-fonts.sh
The script test-fonts.sh can be usefull to test your fonts installation in the ide container we will use later on
Apply the Kitty configuration ~/.config/kitty/kitty.conf
as well as the startup session configuration ~/.config/kitty/startup.session
on the masOS host
felix@macos dotfiles % ./scripts/apply-kitty-config.sh
Make sure the Nerd font is available for kitty
felix@macos ~ % kitty +list-fonts | grep "MesloLGL Nerd Font Mono"
The following script will create the folder ~/.local/state/zsh
used to share the .zsh_history
file and copy the .zshrc.macos
to ~/.zshrc
on the macOS host
felix@macos dotfiles % ./scripts/apply-zsh-config.sh
The following script will simply copy the script ./scripts/docker-run-ide.sh
to ~/.local/bin/ide
on the macOS host so you can use the ide
command
felix@macos dotfiles % ./scripts/install-ide.sh
Note: You can also use the install-ide
alias
Don't forget to rebuild the ide docker image to apply Neovim configuration changes
felix@macos dotfiles % ./scripts/docker-build-ide.sh
Note: You can also use the build-ide
alias
ENV | Default value (in ./scripts/docker-build-ide.sh) | Description |
---|---|---|
IDE_USERNAME | felix | username of the docker image non-root user |
IDE_GROUPNAME | staff | groupname of the docker image non-root user |
IDE_UID | 501 | uid of the docker image non-root user, must match the uid of the user running the ide command on the docker host |
IDE_GID | 20 | gid of the docker image non-root user, must match the primary gid of the user running the ide command on the docker host |
IDE_HOME_DIR | /Users/${IDE_USERNAME} | home directory of the docker image non-root user, must match the your $HOME folder of the user runnung the ide command on the docker host |
To find the loaded LazyVim configuration within neovim
<Leader>fc
To reload the current lua configuration within neovim
:source %
See the config files:
~/.config/nvim/lua/config/options.lua
For docker-desktop on macOS make sure the Enable host networking option is enable
ENV | Default value (in ./scripts/docker-run-ide.sh) | Description |
---|---|---|
IDE_IMAGE_NAME | ide | image name to use |
IDE_IMAGE_VERISON | latest | image version to use |
IDE_X11 | false | start a x11 session, used mainly for browser preview <Leader>cp |
IDE_DEBUG | false | print debug messages at the console |
IDE_WORKSPACE | ${HOME}/Repos | your workspace directory, the location of your git repositories |
The following command will start a shell in the ide container.
ide
export IDE_X11=true; ide