This is my personal configuration for home-manager.
First steps on nix world, I'm currently just using home-manager to install utilities I need day by day.
I'm using direnv and nix develop or devbox to manage my development environments.
Dotfiles and secrets are sops-encryted and stored in a private repository.
- Install
nixandhome-manager(depends on target OS) - Clone this repository
- Run
nix developenter a development environment - Generate age key for this host
age-keygen -o ~/.config/sops/age/keys.txt - Add the public key to sops config of the private repository and re-encrypt everything/prepare the secrets for this host
- Run
gh auth loginto authenticate with GitHub and create a private key for the host - Create a file
~/hosts/$(hostname).nixwith the following content:{ config, pkgs, username, homeDirectory, sops, lib, ... }@inputs: { # common configurations, if you don't want to use them, remove the import but you'll need to # define at least the following: # # home = { # # inherit username homeDirectory; # # keyboard.layout = "it"; # # stateVersion = "23.11"; # # } imports = [ ./common.nix ]; }
- Run
home-manager(nh home build) to verify the configuration - If everything is ok, run
nh home switch .to apply the configuration
nix flake update
nh home build .
# If there are no errors
nh home switch .See README.md for a list of custom options.