请问是否遇到home-manager和nixpkgs版本不一致的问题 #59

Closed
opened 2025-12-29 04:21:11 +01:00 by adam · 9 comments
Owner

Originally created by @CS-liujf on GitHub (Jul 22, 2025).

我今天执行home-manager switch,它警告:我的home-manager版本为24.11,而nixpkgs是25.11。并且报错

error: `substituteAll` has been removed. Use `replaceVars` instead

我的home manager配置文件里并未使用这俩函数,是它内部使用了。请问你有遇到过类似问题吗?此外,是否有方法固定nixpkgs的版本?

Originally created by @CS-liujf on GitHub (Jul 22, 2025). 我今天执行`home-manager switch`,它警告:我的home-manager版本为24.11,而nixpkgs是25.11。并且报错 ``` error: `substituteAll` has been removed. Use `replaceVars` instead ``` 我的home manager配置文件里并未使用这俩函数,是它内部使用了。请问你有遇到过类似问题吗?此外,是否有方法固定nixpkgs的版本?
adam closed this issue 2025-12-29 04:21:11 +01:00
Author
Owner

@ryan4yin commented on GitHub (Jul 22, 2025):

你需要统一 home-manager 跟 nixpkgs 的版本

@ryan4yin commented on GitHub (Jul 22, 2025): 你需要统一 home-manager 跟 nixpkgs 的版本
Author
Owner

@ryan4yin commented on GitHub (Jul 22, 2025):

flake 的 inputs 里就是写版本的啊,建议读一读这个 https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-flake-configuration-explained

@ryan4yin commented on GitHub (Jul 22, 2025): flake 的 inputs 里就是写版本的啊,建议读一读这个 https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-flake-configuration-explained
Author
Owner

@CS-liujf commented on GitHub (Jul 22, 2025):

flake 的 inputs 里就是写版本的啊,建议读一读这个 https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-flake-configuration-explained

谢谢,我研究研究。我一直没用flake,我之前只是简单地使用home manager。此外,我也不是nix os。我是在ubuntu上使用home-manager,不知使用flake是否麻烦

@CS-liujf commented on GitHub (Jul 22, 2025): > flake 的 inputs 里就是写版本的啊,建议读一读这个 https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-flake-configuration-explained 谢谢,我研究研究。我一直没用flake,我之前只是简单地使用home manager。此外,我也不是nix os。我是在ubuntu上使用home-manager,不知使用flake是否麻烦
Author
Owner

@CS-liujf commented on GitHub (Jul 22, 2025):

flake 的 inputs 里就是写版本的啊,建议读一读这个 https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-flake-configuration-explained

实在抱歉再次打扰,没有看懂。请问有无明确的例子(非nixos,使用flake和home-manager),如此我更易理解

@CS-liujf commented on GitHub (Jul 22, 2025): > flake 的 inputs 里就是写版本的啊,建议读一读这个 https://nixos-and-flakes.thiscute.world/nixos-with-flakes/nixos-flake-configuration-explained 实在抱歉再次打扰,没有看懂。请问有无明确的例子(非nixos,使用flake和home-manager),如此我更易理解
Author
Owner

@ryan4yin commented on GitHub (Jul 22, 2025):

我没有用过非 flakes,也没有在 ubuntu 上用过 home-manager,所以在你的场景下要如何解决这个问题,我也不清楚。

非 NixOS 非 flakes 的例子 home-manager 本身的文档里就有,你重点关注下它怎么指定版本号吧:
https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone

@ryan4yin commented on GitHub (Jul 22, 2025): 我没有用过非 flakes,也没有在 ubuntu 上用过 home-manager,所以在你的场景下要如何解决这个问题,我也不清楚。 非 NixOS 非 flakes 的例子 home-manager 本身的文档里就有,你重点关注下它怎么指定版本号吧: https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone
Author
Owner

@CS-liujf commented on GitHub (Jul 22, 2025):

我没有用过非 flakes,也没有在 ubuntu 上用过 home-manager,所以在你的场景下要如何解决这个问题,我也不清楚。

非 NixOS 非 flakes 的例子 home-manager 本身的文档里就有,你重点关注下它怎么指定版本号吧: https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone

非常感谢。如果我没理解错,你是在mac os上用flake+home-manager,以此统一 home-manager 跟 nixpkgs 的版本吧?我去仔细看看文档如何解决 非 flakes的home-manager固定nixpkgs版本

@CS-liujf commented on GitHub (Jul 22, 2025): > 我没有用过非 flakes,也没有在 ubuntu 上用过 home-manager,所以在你的场景下要如何解决这个问题,我也不清楚。 > > 非 NixOS 非 flakes 的例子 home-manager 本身的文档里就有,你重点关注下它怎么指定版本号吧: https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone 非常感谢。如果我没理解错,你是在mac os上用flake+home-manager,以此统一 home-manager 跟 nixpkgs 的版本吧?我去仔细看看文档如何解决 非 flakes的home-manager固定nixpkgs版本
Author
Owner

@CS-liujf commented on GitHub (Jul 22, 2025):

此外,之前忘记附上执行home-manager switch后产生的完整错误信息

trace: warning: You are using

  Home Manager version 24.11 and
  Nixpkgs version 25.11.

Using mismatched versions is likely to cause errors and unexpected
behavior. It is therefore highly recommended to use a release of Home
Manager that corresponds with your chosen release of Nixpkgs.

If you insist then you can disable this warning by adding

  home.enableNixpkgsReleaseCheck = false;

to your configuration.

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/7ln0qilwhb0bb9s2dny5vwxi72symp73-source/pkgs/stdenv/generic/make-derivation.nix:482:13

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'
         at /nix/store/7ln0qilwhb0bb9s2dny5vwxi72symp73-source/pkgs/build-support/trivial-builders/default.nix:80:17:
           79|         enableParallelBuilding = true;
           80|         inherit buildCommand name;
             |                 ^
           81|         passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]);while evaluating the option `home.activation.checkLinkTargets.data':

       … while evaluating definitions from `/home/liujf/.nix-defexpr/channels/home-manager/modules/files.nix':

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

       error: `substituteAll` has been removed. Use `replaceVars` instead.
@CS-liujf commented on GitHub (Jul 22, 2025): 此外,之前忘记附上执行`home-manager switch`后产生的完整错误信息 ```bash trace: warning: You are using Home Manager version 24.11 and Nixpkgs version 25.11. Using mismatched versions is likely to cause errors and unexpected behavior. It is therefore highly recommended to use a release of Home Manager that corresponds with your chosen release of Nixpkgs. If you insist then you can disable this warning by adding home.enableNixpkgsReleaseCheck = false; to your configuration. error: … while calling the 'derivationStrict' builtin at <nix/derivation-internal.nix>:34:12: 33| 34| strict = derivationStrict drvAttrs; | ^ 35| … while evaluating derivation 'home-manager-generation' whose name attribute is located at /nix/store/7ln0qilwhb0bb9s2dny5vwxi72symp73-source/pkgs/stdenv/generic/make-derivation.nix:482:13 … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation' at /nix/store/7ln0qilwhb0bb9s2dny5vwxi72symp73-source/pkgs/build-support/trivial-builders/default.nix:80:17: 79| enableParallelBuilding = true; 80| inherit buildCommand name; | ^ 81| passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]); … while evaluating the option `home.activation.checkLinkTargets.data': … while evaluating definitions from `/home/liujf/.nix-defexpr/channels/home-manager/modules/files.nix': (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: `substituteAll` has been removed. Use `replaceVars` instead. ```
Author
Owner

@ryan4yin commented on GitHub (Jul 25, 2025):

如果我没理解错,你是在mac os上用flake+home-manager,以此统一 home-manager 跟 nixpkgs 的版本吧?

我主要使用 NixOS,macOS 偶尔用用。另外 flakes 对我而言是 Nix 最基础的功能,从来没考虑过也完全没接触过非 flakes.

@ryan4yin commented on GitHub (Jul 25, 2025): > 如果我没理解错,你是在mac os上用flake+home-manager,以此统一 home-manager 跟 nixpkgs 的版本吧? 我主要使用 NixOS,macOS 偶尔用用。另外 flakes 对我而言是 Nix 最基础的功能,从来没考虑过也完全没接触过非 flakes.
Author
Owner

@ryan4yin commented on GitHub (Jul 25, 2025):

因为 issue 跟这个 repo 没啥关系,我也提供不了更多帮助,我先关掉这个 issue 了

@ryan4yin commented on GitHub (Jul 25, 2025): 因为 issue 跟这个 repo 没啥关系,我也提供不了更多帮助,我先关掉这个 issue 了
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/nix-config-ryan4yin#59