Configuration which I use for my daily development purposes.
- Installation and building is fully managed by
nix
. - Powered by jandamm/zgenom plugin manager (see
zsh/.zshrc
for all used plugins) lightweightzsh
shell. - subnixr/minimal theme.
- rupa/z to jump around most used directories (mapped to
j
command). - Automatically starts
tmux
using predefinedtmuxinator
config. - Automatically inits
gpg
andssh-agent
sessions. - Store sensitive settings under untracked
zsh/machine-based.zsh
file. - Comes with many development utils, like exa, rg, jq, yq, ouch (see
home.nix
for complete list). - nix-community/comma to run software without installation (like
, tree
to download and runtree
). - Customized AstroNvim community distribution.
Some overview is also available in my article ⚙️ Managing dotfiles with Nix.
To try this configuration, you can either start it in Docker container or using nix develop
shell:
Docker
nix build github:seroperson/dotfiles#docker
docker load < ./result
docker run --rm -it seroperson.me/dotfiles
nix develop
You'll also need to redefine your HOME
and USER
environment variables:
mkdir -p /tmp/test
USER=seroperson-preview HOME=/tmp/test nix develop --impure github:seroperson/dotfiles
Initially, only nix
and git
must be installed. Be sure that nix is up-to-date:
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
Clone the repository:
git clone https://github.com/seroperson/dotfiles $HOME/.dotfiles/
And then let the home-manager
do the rest:
home-manager init --switch $HOME/.dotfiles/ --flake $HOME/.dotfiles/
or using nix
, if home-manager
is unavailable:
export NIX_CONFIG="extra-experimental-features = nix-command flakes"
nix run github:nix-community/home-manager -- init --switch $HOME/.dotfiles/ --flake $HOME/.dotfiles/
Next, you should do chsh $USER -s $HOME/.nix-profile/bin/zsh
and re-login.
Finally, be sure to install Nerd Font and Catpuccin theme (mocha
variant) for your terminal.
In order to update installed packages, use the following commands:
nix-channel --update
nix-env -u --always
nix flake update
And then re-init home-manager
with command from section above.
Usually nix doesn't work as expected and you don't know what to do. It is good idea to start your troubleshooting with global cleanup:
nix-channel --update
nix-env -u --always
rm /nix/var/nix/gcroots/auto/*
rm -rf $HOME/.cache/nix
nix-collect-garbage -d
Also it's possible to debug nix variables using nix repl
. For example, to
load flake into repl, you can do the following:
nix repl
nix-repl> :lf ./
nix-repl> builtins.attrNames homeConfigurations.seroperson
nix
is not easy thing to get started with, but luckily it has a lot of guides available across the web.
Here are some of them: