···11---
22-title: Homes Integration
22+title: Home Environments
33description: Home Manager, hjem, and nix-maid setup with Den.
44---
55···1313[`home-env.nix`](https://github.com/vic/den/blob/main/nix/home-env.nix)
1414</Aside>
15151616-## Home Manager
1616+## Enabling Homes
17171818-### Enabling on Homes
1818+Den supports several Home Nix classes:
1919+2020+- `homeManager`
2121+- `hjem`
2222+- `maid`
2323+- `user`
19242020-All Home integrations are opt-in and must be enabled explicitly.
2525+All Home integrations are opt-in and must be enabled explicitly, except for `user` which is the built-in user environment on NixOS and nix-Darwin.
21262227```nix
2328# Per user
···29343035Home integration contexts, like `den.ctx.hm-host` only activate when
3136at least one host user has `homeManager` in their `classes`.
3232-When true, the integration imports the HomeManager OS module,
3737+If so, the integration imports the HomeManager OS module,
3338and forwards each user's `homeManager` class into `home-manager.users.<userName>`.
34393540Same details regarding `home-manager` apply to other home types like `hjem` and `maid`.
···7984};
8085```
81868282-## Standalone Homes
8787+## Standalone Homes (homeManager)
83888489For machines without root access:
85908691```nix
8787-den.homes.x86_64-linux.alice = { };
9292+den.homes.x86_64-linux.tux = { };
9393+```
9494+9595+This produces a `homeConfigurations.tux` that can be built with the `home-manager` CLI.
9696+9797+### Standalone Homes bound to Host OS
9898+9999+Also, if you define an standalone home with `tux@igloo` name _and_ you also
100100+have a host named `igloo` in the same platform with user `tux`,
101101+102102+```
103103+den.homes.x86_64-linux."tux@igloo" = {};
104104+den.hosts.x86_64-linux.igloo.users.tux = {};
88105```
106106+Den will:
107107+108108+- Correctly set `<home>.userName` so that batteries like `define-user` work.
109109+- Automatically bind the standalone HM instance to the OS host configuration.
891109090-This produces `flake.homeConfigurations.alice`, built with
9191-`inputs.home-manager.lib.homeManagerConfiguration`.
111111+This means that by declaring `tux@igloo` you can quickly rebuild your home
112112+environment without rebuilding the whole `igloo` OS.
9211393114## hjem
94115