Skip to content

stylix/testbeds: don't unnecessarily use an IFD#2019

Closed
0xda157 wants to merge 1 commit intonix-community:masterfrom
0xda157:testbeds-ifd
Closed

stylix/testbeds: don't unnecessarily use an IFD#2019
0xda157 wants to merge 1 commit intonix-community:masterfrom
0xda157:testbeds-ifd

Conversation

@0xda157
Copy link
Copy Markdown
Contributor

@0xda157 0xda157 commented Nov 24, 2025

inspired by #1985 (comment), cc @MattSturgeon @danth @trueNAHO


@stylix-automation stylix-automation bot added topic: dependencies Dependency updates topic: testbed Testbed changes topic: flake /flake.nix, /flake.lock, and /flake/ subsystems topic: stylix /stylix/ subsystem labels Nov 24, 2025
Copy link
Copy Markdown
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial review from my phone, so I can't do any testing or verification. But here are my thoughts and questions:

stylix = {
enable = true;
image = images.dark;
base16Scheme = "${tinted-schemes}/base16/catppuccin-macchiato.yaml";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this is technically importing from an input derivation, IIUC it doesn't really count as IFD because flake inputs are special and get made available in the nix store before evaluation starts.

So unless flake-compat and flake.parts partitions are breaking that assumption, I don't think this is a problematic import. Maybe I was wrong to call out IFD in your testbeds?

IFD is normally an issue because the derivation has to get built part-way through the eval.

Looking elsewhere, it looks like base16Scheme gets used in:

    lib.stylix.colors = (cfg.base16.mkSchemeAttrs cfg.base16Scheme).override cfg.override;

And that is a function that also comes from a flake input. So if you completely wanted to avoid IFD bootstrapping I think you'd need to see lib.stylix.colors directly.

Does cfg.base16 itself do any IFD? Does it behave differently when given a yaml file path vs an attrset? Did you notice any performance differences with this change?

Copy link
Copy Markdown
Member

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This essentially just inlines the theme file, making future theme changes like in #1857 harder. IMHO this is not a worthy trade-off.

Ideally, we disable IFD in CI, as previously done in #1124.

@0xda157
Copy link
Copy Markdown
Contributor Author

0xda157 commented Nov 26, 2025

Although this is technically importing from an input derivation, IIUC it doesn't really count as IFD because flake inputs are special and get made available in the nix store before evaluation starts.

indeed, nix build github:nix-community/stylix#testbed:gnome:dark --option allow-import-from-derivation false builds fine, so this pr can be closed.

Does cfg.base16 itself do any IFD? Does it behave differently when given a yaml file path vs an attrset? Did you notice any performance differences with this change?

with my config replacing pkgs.base16-schemes with an attrset of colors allows it to build without an IFD, but seems like that's not the case if a flake input is used.

Ideally, we disable IFD in CI, as previously done in #1124.

I'm not really sure what this means... we can't just disable IFDs because the palette generator uses an IFD.

@0xda157 0xda157 closed this Nov 26, 2025
@0xda157 0xda157 deleted the testbeds-ifd branch November 26, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: dependencies Dependency updates topic: flake /flake.nix, /flake.lock, and /flake/ subsystems topic: stylix /stylix/ subsystem topic: testbed Testbed changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants