aboutsummaryrefslogtreecommitdiff
path: root/modules/home-environment.nix
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2017-10-14 20:56:02 +0200
committerRobert Helgesson <robert@rycee.net>2018-02-07 20:50:01 +0100
commit1bc59f729047886b845ffd9162d40593fad5c7f0 (patch)
treed2c09ded840697e7b885ddaaeaadbc6f7e9ec9ae /modules/home-environment.nix
parent563a20fc82124abebd75a1fbaa6b6ead835d2553 (diff)
allow Home Manager to be used as a NixOS module
This is a NixOS module that is intended to be imported into a NixOS system configuration. It allows the system users to be set up directly from the system configuration. The actual profile switch is performed by a oneshot systemd unit per configured user that acts much like the regular `home-manager switch` command. With this implementation, the NixOS module does not work properly with the `nixos-rebuild build-vm` command. This can be solved by using the `users.users.<name?>.packages` option to install packages but this does not work flawlessly with certain Nixpkgs packages. In particular, for programs using the Qt libraries.
Diffstat (limited to 'modules/home-environment.nix')
-rw-r--r--modules/home-environment.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/home-environment.nix b/modules/home-environment.nix
index 197e9dc57f3..6c98343d792 100644
--- a/modules/home-environment.nix
+++ b/modules/home-environment.nix
@@ -291,6 +291,7 @@ in
# script's "check" and the "write" phases.
home.activation.writeBoundary = dag.entryAnywhere "";
+ # Install packages to the user environment.
home.activation.installPackages = dag.entryAfter ["writeBoundary"] ''
$DRY_RUN_CMD nix-env -i ${cfg.path}
'';