nixos/modules/base/home-manager.nix

43 lines
1.3 KiB
Nix
Raw Normal View History

2024-03-05 22:57:41 +01:00
{
config,
home-manager,
...
}: {
2023-08-25 00:57:42 +02:00
# Like NixOS manages the system configuration, Home Manager manages the user
# environment.
#
# A lot of people split their configuration into home/ and nixos/, and import
# both directly in flake.nix, but on a single-user system I find more value
# in a structure based on the program or service rather than the
# implementation-specific details of where the output is saved to disk.
# https://nix-community.github.io/home-manager/
2024-06-27 20:37:34 +02:00
# https://wiki.nixos.org/wiki/Home_Manager
2023-08-25 00:57:42 +02:00
# https://nix-community.github.io/home-manager/options.html
2023-08-01 15:35:09 +02:00
2023-08-25 00:57:42 +02:00
# Import Home Manager to make it part of the NixOS configuration
2023-08-01 15:35:09 +02:00
imports = [
home-manager.nixosModules.home-manager
];
home-manager = {
# Use the same nixpkgs as the system
useGlobalPkgs = true;
2023-08-25 00:57:42 +02:00
# Install packages to /etc/profiles instead of $HOME/.nix-profile.
# According to the Home Manager documentation, this option may become the
# default in the future, so it's probably a good idea.
2023-08-01 15:35:09 +02:00
useUserPackages = true;
2023-08-25 00:57:42 +02:00
# Define the user and path Home Manager should manage
2023-08-01 15:35:09 +02:00
users.caspervk = {
2023-08-12 02:27:52 +02:00
home = with config.users.users; {
username = caspervk.name;
homeDirectory = caspervk.home;
2023-08-01 15:35:09 +02:00
};
# Let Home Manager install and manage itself
programs.home-manager.enable = true;
};
};
}