Stylix image not working

Hi, i am trying to get stylix set up but it doesnt work with the error message ` … while evaluating the option

`home-manager.users.jankoh.xdg.systemDirs.config’:

   … while evaluating definitions from `/nix/store/18lx9jbhwdwsd3w2zx3nwg887wwm3il9-source/modules/kde/hm.nix':

   … while evaluating the option `home-manager.users.jankoh.stylix.base16Scheme':

   … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/home-manager/nixos/common.nix':

   … while evaluating the option `stylix.image':

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

   error: The option `stylix.image' was accessed but has no value defined. Try setting the option.`

The part of my home manager as a nix module looks like:

  stylix = {
    image = /home/jankoh/.dotfiles/nixcold.png;
    enable = true;
    polarity = "dark";
    autoEnable = true;
  };

I tried it in all different formats, including grabbing the image directly from the web, but it always gives the same error

if you need more context, here is my full config:

stylix.image has to be set in system configuration, not HM.

1 Like

thank youy i although now hae a different problem

× home-manager-jankoh.service - Home Manager environment for jankoh
     Loaded: loaded (/etc/systemd/system/home-manager-jankoh.service; enabled; preset: ignored)
     Active: failed (Result: exit-code) since Sat 2024-12-28 21:56:58 CET; 271ms ago
 Invocation: 45b57ec2eefa4d83a9dfde48e5f976d1
    Process: 6485 ExecStart=/nix/store/m91h9kmjw78swvldfb9px8qnv1nb23ax-hm-setup-env /nix/store/0qsphybyxq6a0g96wi59n67mq67vhxiq-home-manager-generation (code=exited, status=1/FAILURE)
   Main PID: 6485 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
         IO: 0B read, 0B written
   Mem peak: 6.1M
        CPU: 162ms

Dez 28 21:56:58 nixos hm-activate-jankoh[6512]: Please do one of the following:
Dez 28 21:56:58 nixos hm-activate-jankoh[6512]: - Move or remove the above files and try again.
Dez 28 21:56:58 nixos hm-activate-jankoh[6512]: - In standalone mode, use 'home-manager switch -b backup' to back up
Dez 28 21:56:58 nixos hm-activate-jankoh[6512]:   files automatically.
Dez 28 21:56:58 nixos hm-activate-jankoh[6512]: - When used as a NixOS or nix-darwin module, set
Dez 28 21:56:58 nixos hm-activate-jankoh[6512]:     'home-manager.backupFileExtension'
Dez 28 21:56:58 nixos hm-activate-jankoh[6512]:   to, for example, 'backup' and rebuild.
Dez 28 21:56:58 nixos systemd[1]: home-manager-jankoh.service: Main process exited, code=exited, status=1/FAILURE
Dez 28 21:56:58 nixos systemd[1]: home-manager-jankoh.service: Failed with result 'exit-code'.
Dez 28 21:56:58 nixos systemd[1]: Failed to start Home Manager environment for jankoh.
warning: error(s) occurred while switching to the new configuration

I just cut/pasted the block i allready wrote in my original post, i know that that causes the problem because if i cmment it out, it works

do you have any ideas how to fix it or at wich site i should look?

thx :smiley:

i know that it tells me to delete something, but i dont want to break anything, so i ask first

Check the full logs of the failing unit, then delete the offending file(s).

[jankoh@nixos:~]$ sudo rm -fr /nix/store/m91h9kmjw78swvldfb9px8qnv1nb23ax-hm-setup-env
rm: das Entfernen von '/nix/store/m91h9kmjw78swvldfb9px8qnv1nb23ax-hm-setup-env' ist nicht möglich: Read-only file system

sorry if im starting to be annoying, i have mainly used arch before but had no problems with nix untill with stylix

but how do i remove the file? i thought sudo rm -rf is the highest form of deleting a file possible

1 Like

No, the ones in your home, that should get replaced by the links created by HM.

1 Like

thx, fixed it by adding home-manager.backupFileExtension = "backup"; in my configuration.nix :smiley:

1 Like

ok, now it doesnt work anymore xd

where do i find them in my home folder?

1 Like

The error in the HM logs should tell you.

1 Like