this post was submitted on 08 May 2025
3 points (80.0% liked)
Nix / NixOS
2195 readers
5 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
@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.So I am importing in home manager file and the syntax and building is fine, the file is also being created in my ~/requested folder.
But I think there has been a misunderstanding in my concept of how this package is being installed and where it will get its colors from, so this flake package astal takes colors from where it is built right? and inside there will be created a scss folder which will have the themes/astel.css file, but in our setup we will only create a file in *user's home/.config/astal directory, but then how will the app use that file? I am getting confuse here, I tried to change the astel.scss file lines to
@import "~/.config/astal/scss/themes/astel.scss";
but no cigar. I am missing a piece here, can you please help me?Sry I am asking a little too much help now.
Please consider these sources:
github.com/mobsenpai/hana
github.com/mobsenpai/aoi (just changed the name)
https://aylur.github.io/astal/guide/getting-started/nix
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.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.
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.