this post was submitted on 08 May 2025
3 points (80.0% liked)
Nix / NixOS
2192 readers
2 users here now
Main links
Videos
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I'm afraid it's difficult to provide a simple example as there are a bunch of moving parts.
In essence, you create a file (e.g.
module.nix
) in your package repo:Then you make sure your program reads the colors from
~/.config/my-package/colors.toml
(you can use whatever format or path you want, but adjust the module accordingly), and uses those colorsFinally, you add
homeModules.default = import ./module.nix self;
to your package flake, andimports = [ inputs.my-package.homeModules.default ]; programs.my-package.enable = true; stylix.targets.my-package.enable = true;
to your home-manager configuration. You will need to adjust a lot of stuff depending on how exactly you want to do this but this should get you started.All of this is a bit complicated but I think for a good reason; this setup is really quite flexible and will allow you to expand easily in the future should you continue work on the project. And if not, it gives you a chance to learn about a lot of different Nix concepts that will come in useful later :)
@balsoft Help wanted my G!, I am stuck here I created this flake for my astal widget config: https://github.com/mobsenpai/astal.git
And I have this flake for my main nixos config: https://github.com/hana.git
I can try to import it now, but perhaps it seems that there is some error here. I try building this astal config using nix build (just to try to test it) and it creates a result folder inside the astal folder, where i have its flake and configs, see the astal repo, those are the contents of the folder. But there is no check.scss file gets created in the scss/theme/ folder. I haven't yet tried to import it into my nixos system, for now, didn't get the time, but will update you on that, but I feel something if not a lot of things are not good here.
How are you importing it in your nixos config? I don't see any references to astal in there.
That sounds right,
nix build
on that flake by itself wouldn't produce that file. You would have to import that home-manager module to your config and then switch to that config, and then the file will be created in your homedir, in~/.config/astal/scss/themes/astel.scss
to be specific.Wow, my G! This is incredibly well-structured, and I really appreciate that you even included comments. It’s genuinely helpful, and I’m definitely going to give it a try.
I actually posted this while my exams are ongoing, hoping someone would respond in the meantime. For real, thank you so much. I love this community!