Any comprehensive way to make dynamic light/dark wallpapers in Plasma with NixOS?

UPDATE: I managed to fix the issue by recreating the folder structure in ~/.local/share/wallpapers. It works now, don’t know if it’ll stop again. Below is the unedited post. Thank you to all who read this post and helped.

Just wanted to ask if anyone’s found a way to make dynamic wallpapers that sync with the light/dark theming? I did once with my current setup, but when I updated and rebooted to switch to the next Generation, the changes were undone, excluding my other wallpaper that I made because it was the current choice.

The reason I chose to send the question here over a solely Plasma-related forum is because anything that I post there wouldn’t likely help, as this seems to be exclusive to NixOS because of the unique nature.

Currently running NixOS 26.05 Yarara with Linux kernel version 7.0.0. 8 GB of RAM and 256 GB of SSD storage.

I’m not using any Flakes or Home Manager, and I’m completely on Unstable, with no Stable-running components.

Eager for a response. Thank you for reading!

Well, do you know how to achieve this regardless of Nix/NixOS?

Well, you’d have to know what steps need to be taken to implement it in your nixos config. You’re not using plasma-manager, evidently, so that might be a place to look first.

That usually requires to make a specific folder in ‘~/.local/share/wallpapers’ with a metadata.json. This didn’t work, leading me to try another idea, which did work, but it just got undone on my most recent update. I’ll try to figure out what I did last time to do it. I believe that it had something to do with going to one of the already-existent dynamic wallpapers, then copying the folder structure and metadata file.

Correction: I used the metadata.json file and the folder structure from an already included dynamic wallpaper, then just implemented that inside ‘~/.local/share/wallpapers’. The folder for the included wallpapers, as well as most others that are included, were in /nix/store, so I couldn’t change nor add a folder there.

Good idea, haven’t heard of plasma-manager. Might look into that, but not sure if I’m ready to go try Home Manager and Flakes yet.

What are the odds that you copied a bunch of symlinks which now point to somewhere in /nix/store that no longer exists?

Not very likely. I think it was unrelated, but it seems it had broken for some other reason and I only managed to notice after updating.

plasma-manager seems to be depend on home-manager. Having several Nix distributions in the same environment does not seem straightforward. Is there a way to use it without including home-manager? Maybe with flakes?

No. Plasma-manager configures your home directory, NixOS cannot do this.

That’s not what home-manager is. It also has pretty straightforward, explicit support for managing NixOS-based users.

Flakes are just like Cargo.toml or package.json - a standard file format to define what your project is.

Trying to use them to do what plasma-manager or home-manager do doesn’t make sense; flakes are used to tell nix to use plasma-manager or home-manager, not the other way around.

I tremendously disagree with this statement. Nix Flakes are not a simple configuration format like .toml or package.json because regular Nix code can be used within them. Nix functions can be written and used within a Flake. they can be used from another flake too. A flake.nix is more like the main starting point of a nix software project, like a main.rs or a lib.rs.

Technically yes, because you can write a project entirely in just a flake.nix file, but the flake spec is completely auxilliary to the use case. You’re not using “flakes”, you’re just writing your code inline instead of building sensible project structure.

This is kinda like writing your entire python project in the setuptools entrypoint string and claiming that pyproject.toml is therefore the same as main.rs.

This why the flake format being nix is generally considered a bit of a design flaw - that, and of course because it’s not entirely valid nix. It blurs the lines between metadata and code in the hands of inexperienced developers.