share
Unix & LinuxHow to add home-manager to my configuration.nix?
[+5] [1] user406407
[2020-04-15 14:39:40]
[ linux nixos nix ]
[ https://unix.stackexchange.com/questions/580233/how-to-add-home-manager-to-my-configuration-nix ]

I want to add the home-manager channel to my configuration.nix, then install home-manager

I don't have experience with NixOS. A simple code snippet is much appreciated, if possible.

[+3] [2020-04-16 17:07:36] MemAllox

There is a good article [1] about that in the NixOs Wiki. Basically, you need to import two things in your configuration.nix:

  • The resources from the home-manager's GitHub repository
  • Your own home.nix config (see the README on GitHub [2] for examples)
imports = [
    ...
    (import "${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos")
    /path/to/home.nix
  ];

You might also need to add home-manager to your list of packages to be installed.

[1] https://nixos.wiki/wiki/Home_Manager
[2] https://github.com/rycee/home-manager#usage

1