Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"! nh 4.0.0-beta.5 now uses NH_FLAKE instead of FLAKE" #199

Closed
novoid opened this issue Dec 20, 2024 · 4 comments
Closed

"! nh 4.0.0-beta.5 now uses NH_FLAKE instead of FLAKE" #199

novoid opened this issue Dec 20, 2024 · 4 comments

Comments

@novoid
Copy link

novoid commented Dec 20, 2024

I'm running NixOS stable with the latest nh according to https://github.com/novoid/nixos-config

Since a couple of days (weeks?) I got the following message when running nh:

! nh 4.0.0-beta.5 now uses NH_FLAKE instead of FLAKE, please modify your configuration (nh/src/main.rs:36)

I could not find anything related to "NH_FLAKE" in my search engine: https://duckduckgo.com/?t=ffab&q=nh_flake&ia=web and I don't have any clue what it means and what I need to change ...

Thanks for any clarification.

@ToyVo
Copy link
Contributor

ToyVo commented Dec 20, 2024

nixos-unstable still uses 3.6.0 https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/nh/nh/package.nix#L14

but once 4.0.0 is actually released this line needs to be updated to NH_FLAKE instead of FLAKE https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/programs/nh.nix#L80

feel free to define environment.variables.NH_FLAKE to the location to suppress the warning until it is updated

@ToyVo
Copy link
Contributor

ToyVo commented Dec 20, 2024

or update your line here to NH_FLAKE https://github.com/novoid/nixos-config/blob/main/homemanager.nix#L18

@viperML
Copy link
Owner

viperML commented Dec 20, 2024

Note that I might change the env vars again before 4.0

@viperML viperML closed this as completed Dec 20, 2024
@novoid
Copy link
Author

novoid commented Dec 23, 2024

or update your line here to NH_FLAKE https://github.com/novoid/nixos-config/blob/main/homemanager.nix#L18

Thank you for the tip.

I adapted said line in novoid/nixos-config@0feaeaf

However, this did not remove the warning message:

nixos [main●] % nh os switch --ask "/home/vk/nixos"
! nh 4.0.0-beta.5 now uses NH_FLAKE instead of FLAKE, please modify your configuration (nh/src/main.rs:36)
> Building NixOS configuration
Using saved setting for 'experimental-features = nix-command flakes' from ~/.local/share/nix/trusted-settings.json.
Finished at 16:18:15 after 24s
> Comparing changes
<<< /run/current-system
>>> /tmp/nh-osXvvf6q/result
No version or selection state changes.
Closure size: 7463 -> 7463 (0 paths added, 0 paths removed, delta  0, disk usage  0B).
> Apply the config?
yes
> Activating configuration
activating the configuration...
setting up /etc...
reloading user units for vk...
restarting sysinit-reactivation.target
> Adding configuration to bootloader
nh os switch --ask "/home/vk/nixos"  18,68s user 3,08s system 68% cpu 31,832 total

nixos [main●] % git grep NH_FLAKE
homemanager.nix:  home.sessionVariables.NH_FLAKE = "/home/vk/nixos"; ## for nh; 2024-12-23: changed "FLAKE" to "NH_FLAKE" because of https://github.com/viperML/nh/issues/199#issuecomment-2557575842

nixos [main●] % 

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

No branches or pull requests

3 participants