Comments (12)
I closed some of the PRs because they didn't actually solve the IFD, but rather just moved it around.
I think the right solution there might be to turn most of those fetchFromGitHub
s into flake inputs
from stylix.
I guess all the templates would need to be added as flake inputs, and then we could have a moduleArgs inputs
that would let individual modules reference inputs.base16-alacritty
, for example.
from stylix.
Also, some of the templates are quite short, so we could consider just embedding them as a string.
from stylix.
Alright, with the two open PRs listed above and #165 we get rid of all IFD except for xresources
, which I can't see a clear way to do without IFD, but folks can also just disable it :)
from stylix.
Another plus of the approach taken in #165 is that it's not possible to easily override the templates used, and they get auto-updated with the rest of the flake inputs :)
from stylix.
I'm now running all these changes on my systems, everything working AOK and evaluation is much faster 🚀
from stylix.
I may have a solution for xresources
.
All home-manager
does is create the .Xresources
file: https://github.com/nix-community/home-manager/blob/master/modules/xresources.nix#L90-L100
And then configure the xsession to merge it to xrdb: https://github.com/nix-community/home-manager/blob/master/modules/xresources.nix#L102
And that is just a command that points to the file: https://github.com/nix-community/home-manager/blob/master/modules/xresources.nix#L26
We could do something similar with:
{
home.file.".Xstylix" = {
source = theme;
onChange = ''
if [[ -v DISPLAY ]]; then
${pkgs.xorg.xrdb}/bin/xrdb -merge ${config.home.homeDirectory}/.Xstylix
fi
'';
};
xsession.initExtra = "${pkgs.xorg.xrdb}/bin/xrdb -merge ${config.home.homeDirectory}/.Xstylix";
}
And that does no IFD.
I can't really test this because I don't know what the .Xresources
theme even impacts.
cc. @danth
from stylix.
It should have an effect on rxvt
and xterm
.
I think we can avoid linking the file too:
let
# theme = ;
command = "${pkgs.xorg.xrdb}/bin/xrdb -merge ${theme}";
in {
xsession.initExtra = command;
home.activation.Xresources = lib.hm.dag.mkEntryAfter [ "writeBoundary" ] ''
if [[ -v DISPLAY ]]; then
$DRY_RUN_CMD ${command}
fi
'';
}
On the other hand the template is fairly simple, so we could translate it to xresources.properties
and remove the dependency:
{
xresources.properties =
with config.lib.stylix.colors.withHashtag;
{
"*foreground" = base05;
"*cursorColor" = base05;
...
};
}
Then it goes through the Home Manager module as usual.
from stylix.
Ah, good idea, let me give it a shot :)
from stylix.
Seems to work! Done in #168
from stylix.
Looking at the modules, though, they mostly don't need IFD, and could be reworked to avoid it. One example is
bat
, where I was able to remove the need for IFD by improving the underlying HomeManager module.I think most of the others on the list can also avoid
IFD
by just linking the theme file, and then referencing the linked path instead of trying to embed the theme in the configuration files.(Source: #159 (comment))
Would replacing the current Mustache templates with upstream Home Manager and NixOS options not further improve evaluation time? Additionally, unlike Mustache templates, Nix options can be seamlessly overwritten by end users in Stylix, Home Manager, or NixOS.
I guess all the templates would need to be added as flake inputs, and then we could have a moduleArgs inputs that would let individual modules reference inputs.base16-alacritty, for example.
(Source: #159 (comment))
For reference, this is quite similar to what #222 does.
from stylix.
Yes, using Nix options is a better option.
from stylix.
Related Issues (20)
- zathura: missing transparency HOT 3
- targets.kitty.enable=false doesn't work HOT 4
- stylix: improve `stylix.mkEnableTarget` behaviour HOT 8
- doc: add "accent" colour to spec HOT 2
- treewide: GitHub Action failures HOT 1
- Support for Nix 24.05? HOT 7
- Image needs to be set on rebuild
- hyprland: init `hyprpaper` service
- sddm: add support HOT 2
- Stylix breaking Plasma 6's shortcuts and Spectacle HOT 9
- Release 24.05 HOT 6
- Stylix no longer functional after update HOT 2
- The option `stylix.image' is used but not defined. HOT 11
- kde: home-manager failing to set Plasma wallpaper, not connected to D-Bus server HOT 1
- Waybar: only inject colors HOT 5
- Stylix stoped working after update HOT 2
- lightdm: support colors in addition to wallpaper HOT 4
- Stylix doesn't build after commit 76d6ca2.
- Stylix stopped building after update on darwin
- [Bug] infinite recursion after commit f060e40
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylix.