danth / stylix

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

Error with stylix.image: not of type 'path or package convertible to it #345

Closed cachedpotato closed 2 months ago

cachedpotato commented 2 months ago

Hello, I'm a newbie NixOS user and I've been trying to set up stylix but encountering some problems. I first downloaded an image in a seperate folder (which is one level above where stylix.nix is located) and set stylix.image like so:

stylix = {
  image = ../wallpaper1.jpg;
....

when I tried to rebuild my home-manager I got this error:

       error: A definition for option `stylix.image' is not of type `path or package convertible to it'. Definition values:
       - In `<unknown-file>': null

I then tried to change my stylix.image using fetchurl:

stylix = {
  image = pkgs.fetchurl{
    url = "https://link/to/wallpaper.jpg
    sha256 = "";
....

which gave me the same error. I don't think I did anything noteworthy regarding this error, the following is pretty much all I can think of that may be "noteworthy":

I feel like I'm missing extremely basic here but I really don't know what. Any help would be greatly appreciated.

Thanks!

cachedpotato commented 2 months ago

I forgot to import my stylix.nix into my main default.nix home-manager file... I'm dumb.

chris-kruining commented 1 month ago

at least you are not alone. I made the same mistake.

Though in our defense, getting an error that the setting you just made before you run the build is configured wrong, does not really hint to: the settings are missing altogether :P

trueNAHO commented 1 month ago

Though in our defense, getting an error that the setting you just made before you run the build is configured wrong, does not really hint to: the settings are missing altogether :P

Related: https://github.com/danth/stylix/issues/200