# Nh users - need help

**URL:** https://discourse.nixos.org/t/nh-users-need-help/45147
**Category:** Help
**Created:** [May 9, 2024, 4:21pm UTC](https://discourse.nixos.org/t/nh-users-need-help/45147 "2024-05-09T16:21:40Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![rgoulter](https://discourse.nixos.org/user_avatar/discourse.nixos.org/rgoulter/32/5894_2.png) [@rgoulter](https://discourse.nixos.org/u/rgoulter)
#### Post date: [May 10, 2024, 9:00am UTC](https://discourse.nixos.org/t/nh-users-need-help/45147/4 "2024-05-10T09:00:22Z")

</div>

> [@tesarect](#):
>
> 🙁 Now that went right over my head.

Ah, I meant it more as a “for your information”. “XDG specification” sounds fancy, but it’s just a description for where programs should put the config files (& other files they might need).

> [@tesarect](#):
>
> So, since i haven’t done any installation using `profile` this path to place all the installations are currently redirected to `~/.nix-profile`, am i right ?!

Ah. I was mistaken about `~/.nix-profile` and `~/.local/state/nix/profiles`.

`~/.nix-profile` is a convenient symlink to the user’s current profile.

`~/.local/state/nix/profiles` is just a folder where local profiles can go.

e.g. [home manager uses that dir for the home-manager profile](https://github.com/nix-community/home-manager/blob/6e277d9566de9976f47228dd8c580b97488734d4/modules/lib-bash/activation-init.sh#L50).

e.g. you can try `readlink ~/.local/state/nix/profiles/home-manager`, and this points to e.g. `home-manager-15-link`.

– You can look through `~/.local/state/nix/profiles/home-manager-15-link` or so, you’ll see it has `/activate` and `/bin/home-manager-generation` and other files. – When you run `home-manager switch`, this `home-manager` profile gets updated to point to a new build.

> [@tesarect](#):
>
> Yes, i haven’t tried installing any pkg using `profile`. Instead i have been adding packages using configuration.nix or home.nix so far.  
> May i ask whats the effect of installing a package through `.nix` file and profile. I mean when can we use this method to install something.

`nix profile install` adds a package to the user’s profile. e.g. running `nix profile install nixpkgs#cowsay` means you’ll have `cowsay` in `~/.nix-profile/bin`.

`nix-env --install` and `nix profile install` come with their own footguns. It’s easy to make mistakes when using it that way, causing problems that are difficult to understand (& so are difficult to ask for help for). – It’s often better to just use `nix shell nixpkgs#cowsay`, or to use Home Manager, or install a system in a global config. – See e.g.

> [@Depreciate the use of nix-env to install packages?](https://discourse.nixos.org/t/depreciate-the-use-of-nix-env-to-install-packages/20139):
>
> Hi, It seems using nix-env for installing packages is a bad habit for nix/NixOS users and that it’s not recommended from the community. If this is true, we should update the Wiki to stop referring to this command as the way to install a package, or put a warning after each use of this command in the wiki for installing a package that would lead to a Wiki page explaining why nix-env is special and shouldn’t be used if possible. Here are some Wiki links where nix-env is recommended as the way to…

---

_[View the full topic](https://discourse.nixos.org/t/nh-users-need-help/45147)._
