A simple Home Manager configuration
unvX is a standalone Home Manager configuration using pure Nix flakes to install software and manage dotfiles. It employs symlinks for dotfile management, allowing immediate feedback on any change made.
Important
unvX serves as a source of inspiration. If it receives enough stars, I'll create a unvX builder tool to help you easily configure and manage your Home Manager.
To use unvX, you will need:
- Nix with the Nix flake experimental feature enabled.
Tip
Use the Nix installer by Determinate Systems to install Nix with the Nix flake feature enabled by default.
To install, use the following command inside the unvX folder:
./install
Note
This command will do three things:
- Configure your Git Hooks to invoke pre-commit using Nix.
- Generate a
unvX.nixfile. - Link the Home Manager flakes regardless of the location of your unvX folder.
For first-time installation, call the following command:
nix run home-manager -- switch
Note
This will make the home-manager command available system-wide and apply the Home Manager profile matching your machine.
Otherwise, as any Home Manager configuration, call the following command to apply the Home Manager profile matching your machine:
home-manager switch
Here is a brief description of the structure:
flake.nix: Entrypoint for profiles and Home Manager configurations. Home Manager will by default match first a$USER@$(hostname)profile. If not found, it will then default to a$USERprofile.host: Home Manager configurations for specific machines and users, specifying which Nix module in themodulefolder to use.module: Nix modules dedicated to a specific software. These modules handle both the installation and configuration of the software and its extensions.unvX.nix: Generated during the installation, a file that contains information about your unvX installation, such as the unvX location on your host machine. The content of that file is configured to be read by Home Manager and to be passed into all your Nix module under theunvXattribute name.unvX.nixis mainly used to symlink your dotfiles.
Note
Since Homebrew is better suited to install applications for macOS (e.g. Raycast), a homebrew Nix module using it behind the scenes is available in the module folder. Thus, you don't have to worry about managing two commands to update everything. If you plan to use the homebrew Nix module, make sure to have Homebrew installed.
When configuring your environment, I recommend a hybrid approach:
-
Use unvX for foundations: Install your essential, "always-on" tools here (e.g., zsh, git, neovim, tmux). If it shapes your shell behavior or OS integration, it belongs in your Home Manager configuration.
-
Use Mise for runtimes: For project-specific languages (Node, Python, Go) that require frequent version switching, use Mise.
Why? Nix provides a rock-solid, reproducible base, but can feel rigid for rapid version hopping. Mise excels at managing dynamic per-directory runtimes, giving you the best of both worlds: a stable environment and developer agility.
Note
A mise Nix module is available in the module folder.
Useful resources to learn Nix:
- Nix language basics by nix.dev
- Packaging existing software with Nix by nix.dev
- Nix modules by nix.dev
- Nix flakes by Zero to Nix
