This is my personal home configuration using home-manager as a standalone util. Its structure is an attempt at a modular and flexible design and is intended to be used both standalone on non-nixos systems and along with NixOS system configs like my NixOS config (also as a standalone non-root tool). The structure is inspired by EmergentMind's config as well as a heap of others. It currently only configures one user and host, but is structured such that more can be added in the future with varying configs as needed.
This config:
- Uses flakes
- Uses the 24.11 branch
- Is meant to be used both on NixOS with a separate system config, and on non-nixos systems
As a reminder to myself and as a resource to anyone seeking inspiration, here is the bootstrapping process:
-
Move to the location you want your config to live (I put mine in
~/dotfiles
) -
Clone this repository:
$ git clone [email protected]:otytlandsvik/dotfiles.git
-
Make your desired modifications to
home.nix
(opt in or out of any optional modules, or change the entire config if you like) -
Remember to change the output target in
flake.nix
to reflect your username and point to the correct nix file -
Install the home-manager standalone tool using Nix (the package manager):
$ nix-shell -p home-manager
Or, on NixOS you can also make it available as a system package:
environment.systemPackages = [ pkgs.home-manager ];
Or, on NixOS you can also make this package explicitly available to your user:
users.users."username" = { ... packages = [ pkgs.home-manager ]; };
After bootstrapping, home-manager will install and manage itself. That's why it's sufficient to run it in a nix-shell.
-
Build the config using home-manager (as an example, if
username
was added as a flake output):$ home-manager switch --flake .#username
Note
The .
here evaluates to the cwd. It must be a path to the directory containing flake.nix
Test it by running one of the programs configured, like nvim
.