This repository contains configuration that is used to set-up a ready-to-use development environment according to my needs.
It can be used on a local desktop, laptop or on a cloud desktop.
The configuration is made portable with the use of the Nix Home Manager
Some of the tools installed by this configuration include:
A cat
clone with a fancy style (and wings)
zoxide is a smarter cd command, inspired by z and autojump.
It remembers which directories you use most frequently, so you can "jump" to them in just a few keystrokes. zoxide works on all major shells.
- Go
- NodeJS 20
- Python 3.11 with
pip
,setuptools
andwheel
- Rust (rustc + rustfmt + cargo)
- zig
- clang (not on MacOS)
- gnumake (not on MacOS)
- delta (used for a fancy git diff)
- thefuck
- unzip
- wget
In order to use this configuration you'll need to first install the following tools:
Nix Package Manager
Before you're able to install the Nix Home Manager you need to install the Nix Package manager.
The instructions depend on the OS you're on. For NixOS you don't need to do anything as it comes with the package manager, but on other OS here are the instructions:
Additional step on AL2
On AL2 you'll need to also run the following commands after installing Nix Package Manager in order to create the right user group and add you to it:
sudo groupadd -r nixbld
Then run to add all users to the nixbld
group:
for n in $(seq 1 10); do sudo useradd -c "Nix build user $n" \
-d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" \
nixbld$n; done
Nix Home Manager
To install it, simply follow the steps from Standalone Installation page, copied here for simplicity:
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
nix-channel --update
nix-shell '<home-manager>' -A install
Once you have the Home Manager installed, simply clone this repository in ~/.config/home-manager
and run home-manager switch
cd ~/.config/
rm -rf home-manager # Remove prior Home Manager configuration
nix-shell -p git # Open a new shell with git enabled
git clone https://github.com/tmikus/nix-config.git home-manager
exit # exit the git-enabled shell
home-manager switch
From experience the main reason why the initial home-manager switch
fails is because you already have some files that would clash with new configuration.
For example, you might already have a .zshrc
, .zprofile
or .zshenv
files in your home folder.
To fix this please make a backup of these files by renaming them to something like .zshrc.backup-before-nix
and try again.
Sometimes upating MacOS can result in Nix being removed from the /etc/zshrc
file. To recover it simply add the following at the back of the /etc/zshrc
file:
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nixs