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

hdn does not work unless using with pkgs for home.packages #19

Open
Bujiraso opened this issue Jun 20, 2023 · 3 comments
Open

hdn does not work unless using with pkgs for home.packages #19

Bujiraso opened this issue Jun 20, 2023 · 3 comments

Comments

@Bujiraso
Copy link

When I run a simple command, it fails

bash $ hdn remove gnome-2048
home.nix doesn't contain any of the specified packages, home-manager switch was not run

Here's my home.packages:

bash $ grep -m 1 home.pack home.nix 
  home.packages = [ pkgs.gnome-2048 ];

If I modify to

home.packages = with pkgs; [ gnome-2048 ];

It works.
I also notice the add command does not check if pkgs is necessary, in the other direction, leading to errors on install.

@seasonedfish
Copy link
Owner

seasonedfish commented Jun 20, 2023

If I understand correctly, what you're describing is the expected behavior.

When you use the add and remove commands, hdn looks for exact matches in the home.packages list. The intention behind this design is to mirror what users would normally type in their configuration files without using hdn.

For users who have with pkgs in their configuration, they would normally enter gnome-2048 directly into the home.packages list. So, when using hdn, they should run hdn add gnome-2048 and hdn remove gnome-2048.

On the other hand, for users who don't have with pkgs in their configuration, they would normally use pkgs.gnome-2048 in the home.packages list. So, when using hdn, they should run hdn add pkgs.gnome-2048 and hdn remove pkgs.gnome-2048.

Please let me know if this addresses your issue!

@seasonedfish
Copy link
Owner

Hmm, perhaps hdn could look for partial matches and provide hints on errors, sort of like rustc's error messages?

@Bujiraso
Copy link
Author

I think hints on this one so that the user understands that should try pkgs.gnome-2048 is a good idea!

That could resolve this.
Additionally, it could be very nice to simply tack on pkgs. before failing and give a warning that pkgs. was applied automatically.

I hope that wouldn't be very contentious behavior.

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

2 participants