Skip to content

flake/dev: rename nixpkgs input to avoid shadowing#3121

Merged
mergify[bot] merged 1 commit intonix-community:mainfrom
MattSturgeon:partition/dont-shadow
Mar 28, 2025
Merged

flake/dev: rename nixpkgs input to avoid shadowing#3121
mergify[bot] merged 1 commit intonix-community:mainfrom
MattSturgeon:partition/dont-shadow

Conversation

@MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Mar 28, 2025

Rename inputs.nixpkgs to inputs.dev-nixpkgs to avoid shadowing the root flake's inputs.nixpkgs.

Having the dev flake shadow an input can be confusing, since overriding the root flake's input will have no effect when evaluating outputs that depend on the dev partition (i.e. outputs listed in partitionedAttrs).

The only reason we specify a nixpkgs input in the dev flake at all, is so the other inputs can follow it.


Once nix 2.26 is more prevalent, we can follow the root flake's inputs using a "path:../.." input. See 2.26 release notes and NixOS/nix#10089.

This may also require changes in flake-compat, since that is used by flake-parts to load the partition flake, see NixOS/flake-compat#18. The nix-community fork has support for path: references, however idk if it is compatible with NixOS/nix#10089 which introduced lockfile changes in nix 2.26. I'm also unsure exactly which version of flake-compat is in use by flake-parts.

Rename `inputs.nixpkgs` to `inputs.dev-nixpkgs` to avoid shadowing the
root flake's `inputs.nixpkgs`.

Having the dev flake shadow an input can be confusing, since overriding
the root flake's input will have no effect when evaluating outputs that
depend on the dev partition.

The only reason we specify a `nixpkgs` input at all here, is so the
other inputs can follow it.

Once nix 2.26 is more prevalent, we can follow the root flake's inputs
using a `"path:../.."` input.
@MattSturgeon

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@mergify

This comment was marked as resolved.

@mergify mergify bot merged commit 8e732cf into nix-community:main Mar 28, 2025
4 checks passed
@mergify mergify bot temporarily deployed to github-pages March 28, 2025 05:10 Inactive
@MattSturgeon MattSturgeon deleted the partition/dont-shadow branch March 28, 2025 05:10
MattSturgeon added a commit to MattSturgeon/nixvim that referenced this pull request Mar 28, 2025
Apply changes from 8e732cf (nix-community#3121)

Flake lock file updates:

• Added input 'dev-nixpkgs':
    'github:NixOS/nixpkgs/bd3bac8bfb542dbde7ffffb6987a1a1f9d41699f?narHash=sha256-jAIUqsiN2r3hCuHji80U7NNEafpIMBXiwKlSrjWMlpg%3D' (2025-03-26)
• Updated input 'devshell/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Updated input 'git-hooks/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Updated input 'home-manager/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Updated input 'nix-darwin/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Removed input 'nixpkgs'
• Updated input 'treefmt-nix/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
MattSturgeon added a commit to MattSturgeon/nixvim that referenced this pull request Mar 28, 2025
Apply changes from 8e732cf (nix-community#3121)

Flake lock file updates:

• Added input 'dev-nixpkgs':
    'github:NixOS/nixpkgs/1750f3c1c89488e2ffdd47cab9d05454dddfb734?narHash=sha256-oDJGK1UMArK52vcW9S5S2apeec4rbfNELgc50LqiPNs%3D' (2025-03-24)
• Updated input 'devshell/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Updated input 'git-hooks/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Updated input 'home-manager/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Updated input 'nix-darwin/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
• Removed input 'nixpkgs'
• Updated input 'treefmt-nix/nixpkgs':
    follows 'nixpkgs'
  → follows 'dev-nixpkgs'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants