qt: guard nixosConfig instead of isLinux and osConfig (#1722)

Link: https://github.com/nix-community/stylix/pull/1722

Reviewed-by: Kilian Mio <86004375+Mikilio@users.noreply.github.com>
Reviewed-by: Flameopathic <64027365+Flameopathic@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
awwpotato 2025-07-20 14:42:13 -07:00 committed by GitHub
parent 9242b3ec8e
commit 4af7cbde9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,21 +2,20 @@
pkgs,
config,
lib,
osConfig ? null,
nixosConfig ? null,
...
}:
{
options.stylix.targets.qt = {
# TODO: Remove the osConfig workaround [1] ("qt: puts NixOS systemd on
# non-NixOS distro path") once [2] ("bug: setting qt.style.name = kvantum
# makes host systemd unusable") is resolved.
# TODO: Replace `nixosConfig != null` with
# `pkgs.stdenv.hostPlatform.isLinux` once [1] ("bug: setting qt.style.name
# = kvantum makes host systemd unusable") is resolved.
#
# [1]: https://github.com/nix-community/stylix/issues/933
# [2]: https://github.com/nix-community/home-manager/issues/6565
# [1]: https://github.com/nix-community/home-manager/issues/6565
enable = config.lib.stylix.mkEnableTargetWith {
name = "QT";
autoEnable = pkgs.stdenv.hostPlatform.isLinux && osConfig != null;
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux && osConfig != null";
autoEnable = nixosConfig != null;
autoEnableExpr = "nixosConfig != null";
};
platform = lib.mkOption {