Skip to content

type // { check = ...; } is incompatible with the new nixpkgs merge mechanism #1207

@LeanidShutau

Description

@LeanidShutau

I have confirmed that this is a bug related to nvf

  • This is a bug, and not an user error or a support request. I understand that my issue will be closed if it is not a bug in nvf.
  • I have checked the issues tab and confirmed that my issue has not yet been reported. I understand that my issue will be closed if it is a duplicate.

Description

nixpkgs have introduced the v2 merge mechanism (NixOS/nixpkgs#391544) and now they throw an error (NixOS/nixpkgs#454964) if type // { check = ...; } syntax is used in the configuration:

       … while evaluating definitions from `/nix/store/dly9hqfms8f32swaiml7w9rvwnvahdm1-source/flake/modules/home-manager.nix':

       … while evaluating the option `home-manager.users.username.programs.nvf.settings':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The option `home-manager.users.username.programs.nvf.settings' has a type `Nvf module' that uses
       an ad-hoc `type // { check = ...; }' override, which is incompatible with
       the v2 merge mechanism.

       Please use `lib.types.addCheck` instead of `type // { check }' to add
       custom validation. For example:

         lib.types.addCheck baseType (value: /* your check */)

       instead of:

         baseType // { check = value: /* your check */; }

nvf uses the syntax in 3 places in lib/types/custom.nix and lib/types/plugins.nix

Installation Method

Home Manager Module (homeManagerModules.default)

Installation Method (Other)

No response

nvf Version

master

Reproduction steps

As I understand this is a global issue and affects every installation that depends on nixpkgs

Expected behavior

Not applicable

Actual Behavior

Not applicable

System Information

- system: `"x86_64-linux"`
 - host os: `Linux 6.12.54, NixOS, 25.11 (Xantusia), 25.11.20251022.01f116e`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.31.2`
 - channels(root): `"nixos-25.05"`
 - nixpkgs: `/nix/store/sqilaxdxljyalv530z1qrd1q3nd4lyxq-source`

Relevant log output

Not applicable

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions