this post was submitted on 08 May 2025
3 points (80.0% liked)

Nix / NixOS

2197 readers
24 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

I just want to know from you how you (or how you would) pass options to packages you develop with flakes.

I am currently writing a widget bar using Astal and then import the flake in my NixOS flake and use the package.default output in home.packages. I'd like to also style this bar according to my Stylix theme, how do you do something like this?

you are viewing a single comment's thread
view the rest of the comments
[–] balsoft@lemmy.ml 2 points 18 hours ago (1 children)

Your understanding is correct, you have to read that file (~/.config/astal/scss/thmees/astel.css) from your app somehow. I'm just guessing that @import might be compile-time, in which case you'll have to do it some other way, by reading this file at runtime and using it to configure the colors. If @import is runtime itself, perhaps you need to pass the entire path instead of using ~, like @import "/home/mobsenpai/.config/astal/scss/themes/astel.scss" or something.

[–] mobsenpai@lemmy.world 1 points 18 hours ago (1 children)

I don't think there is a way to give the config during runtime or while calling the binary of the app, I will keep trying something, one thing I think that may help is creating that file during the build process, but I just don't have enough knowledge to do that.

[–] balsoft@lemmy.ml 2 points 18 hours ago

one thing I think that may help is creating that file during the build process

This is certainly an option, but I would only use it as a last resort as it means recompiling the project every time you want to change the theme. It's quite easily done though, you can use overrideAttrs on the package in your home-manager module to pass in the desired colors.