home-manager icon indicating copy to clipboard operation
home-manager copied to clipboard

Add `nix.nixPath` and `nix.keepOldNixPath` options

Open Enzime opened this issue 3 years ago • 4 comments
trafficstars

Description

This change is useful as it means flake users don't need to use channels and can just manage it through their flake configs:

{ inputs, ... }:

{
  nix.nixPaths = [ "nixpkgs=${inputs.nixpkgs}" ];
}

By default, the system value for $NIX_PATH is kept as a fallback. To completely override the system value for $NIX_PATH:

nix.keepOldNixPath = false;

Checklist

  • [x] Change is backwards compatible.

  • [x] Code formatted with ./format.

  • [x] Code tested through nix-shell --pure tests -A run.all.

  • [ ] Test cases updated/added. See example.

  • [ ] Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • [ ] Added myself as module maintainer. See example.

    • [ ] Added myself and the module files to .github/CODEOWNERS.

Enzime avatar Feb 01 '22 02:02 Enzime

I think this might clash with other places where Home Manager overrides the NIX_PATH? I'm not familiar with the shell code and all that so cc @rycee

berbiche avatar Feb 20 '22 04:02 berbiche

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

stale[bot] avatar May 21 '22 11:05 stale[bot]

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

stale[bot] avatar Aug 31 '22 01:08 stale[bot]

@berbiche I had a look through the references to NIX_PATH in the home-manager repo and it seems like it should be fine. This PR is basically just a way to control the environment variable to match the nixpkgs option.

Enzime avatar Aug 31 '22 13:08 Enzime

Is there an update for the status of this MR?

ambroisie avatar Feb 07 '23 11:02 ambroisie

Superseded by #4031

Enzime avatar Jun 09 '23 08:06 Enzime