danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
906 stars 105 forks source link

Wallpaper withBinaryFile does not exist (No such file or directory) #324

Closed ddogfoodd closed 3 months ago

ddogfoodd commented 3 months ago

I just updated to the latest in nixos-unstable, now stylix palette creation fails as it doesn't seem to find my wallpaper.

I get the following error:

Processing /home/user/.config/nixos/wallpaper.jpg
palette-generator: /home/user/.config/nixos/wallpaper.jpg: withBinaryFile: does not exist (No such file or directory)
CallStack (from HasCallStack):
  error, called at Stylix/Main.hs:15:26 in main:Main

I made sure the file (/home/user/.config/nixos/wallpaper.jpg) still exists. I am not sure, but I update regularly so maybe the error was introduced with this recent commit changing wallpaper path handling.

I would like to test if it does but am not sure yet if there is a convenient way to revert back to before this commit with Nix. If you know how to do it, drop me a hint and I will try it out.

trueNAHO commented 3 months ago

I would like to test if it does but am not sure yet if there is a convenient way to revert back to before this commit with Nix. If you know how to do it, drop me a hint and I will try it out.

To automate the procecdure, you could write a small script that runs git bisect run on Stylix, and on each iteration you verify whether your NixOS or Home Manager configuration still works.

wanderer commented 3 months ago

I also am having this problem

trueNAHO commented 3 months ago

Does https://github.com/danth/stylix/pull/329 resolve the issue?

ddogfoodd commented 3 months ago

To automate the procecdure, you could write a small script that runs git bisect run on Stylix, and on each iteration you verify whether your NixOS or Home Manager configuration still works.

Does this work with nix flakes installation or just with the cloned git repo?

trueNAHO commented 3 months ago

To automate the procecdure, you could write a small script that runs git bisect run on Stylix, and on each iteration you verify whether your NixOS or Home Manager configuration still works.

Does this work with nix flakes installation or just with the cloned git repo?

For example, you could specify the commit hash as:

https://github.com/danth/stylix/blob/b6dbe9ac5d57d27d5620445f20cad2c353089f86/flake.nix#L10

Personally, I prefer to do this with a local clone:

- inputs.stylix.url = "github:danth/stylix";
+ inputs.stylix.url = "git+file:/path/to/stylix";

In /path/to/stylix, I simply git checkout whatever commit I want, and then I nix flake lock --update-input stylix in the flake.nix file that imports it.

Does #329 resolve the issue?

Alternatively, you could test this PR with:

- inputs.stylix.url = "github:danth/stylix";
+ inputs.stylix.url = "github:trueNAHO/stylix/fix-stylix-palette-do-not-escape-spaces-in-wallpaper-path";
feathecutie commented 3 months ago

Does #329 resolve the issue?

I'm having the exact same issue, and for me, that PR resolved it.

ddogfoodd commented 3 months ago

Thanks for the explanation, also yes that fixed it. Thanks for that as well! Do I keep the issue open until merge?

danth commented 3 months ago

The commit which caused this has been reverted for now.

zDyanTB commented 1 week ago

If you put "" around the image path, it returns that same error, just in case anyone face it