Nixos configuration set wallpaper / write files to user/root home [without home-manager]

Well, this is how that option is applied: nixpkgs/nixos/modules/services/x11/desktop-managers/default.nix at d8bb6c681cf86265fdcf3cc3119f757bbb085835 · NixOS/nixpkgs · GitHub

So there’s no way to set the background declaratively currnently. An easy fix would be to change that module to also allow setting an actual image; just takes adding a new option and using it in that command.

I too thought there was an easy way, but it seems there isn’t - I suspect this is because it’s hard to guarantee the directories exist correctly upfront if mutable users is in use.

As an alternative, consider creating a systemd oneshot user unit that copies the image, or populating the skel directory.

1 Like