Declarative Theming\Configuration

This is my first post so forgive me of any mistakes.

I’ve recently have spun up NixOS and am trying to get it ready for switching my primary machine over to it. While the configuration is working great for the packages I need and use on a regular basis, there are two things I’m struggling to understand as one of the main draws to me is that configuration can be done decoratively through code and having the nixos-rebuild command rather than manually moving files around…

  1. If I want to configure package settings decoratively, such as setting SDDM to use a custom theme, or Xrandr to always use a specific configuration for my monitors. What would be the best way to handle that?

  2. If I want to decoratively add .config/* files to specific users I see I could use home-manager, but is there any way to do this separate from home-manager? If not, the only issue I have with home.file would be the length of my config files, is there a better way to handle this? Copying the configs from a USB maybe?

Let me know, I’m new and have been enjoying it a lot but I admit I still have a lot to learn. Thanks in advance.

1 If I want to configure package settings decoratively, such as setting SDDM to use a custom theme, or Xrandr to always use a specific configuration for my monitors. What would be the best way to handle that?

Have a look at this for both sddm and X options: https://search.nixos.org/options?channel=23.05&from=0&size=50&sort=relevance&type=packages&query=sddm

Do note that we have support for a number of environments supporting wayland where the X11 settings are ignored.

2 If I want to decoratively add .config/* files to specific users I see I could use home-manager, but is there any way to do this separate from home-manager?

Sure, you can write all the plumbing that moves files into place, but that’s really what home-manager does for you.

If not, the only issue I have with home.file would be the length of my config files

Split them into logical chunks.

1 Like

Thank you, the thing with the provided sddm.theme configuration is that I’m using a custom theme from Github that I like that’s not in the NixOS Repository, I know there’s a fetchFromGithub command but I’m not sure how I could use that in this cases.

I’ll look more into home-manager for the dotfiles thank you.

A bit tangencial but you also have projects like nix-colors and stylix.

I was looking at colors before. For those who have used these. Is one preferred over the other? Do they cover the same or different use cases? (Looking to avoid a rabbit hole of picking one and just moving onto configuring)

Hey guys, I took some time and looked into home-manager and flakes and I’ve gotten the theming all setup with all of my config files. Thank you to everyone in this thread, I’ve linked my flake setup below so if anyone wants to get any inspiration from my setup I hope it helps someone else. Feel free to ask any questions about it.
Flake Setup: https://github.com/Jj1910/NixOS-Flake

1 Like