Skip to content

[release-25.05] Add mkEnableTargetWith and use it for documenting dynamic autoEnable conditions#1470

Merged
danth merged 7 commits intorelease-25.05from
backport-1244-to-release-25.05
Jun 9, 2025
Merged

[release-25.05] Add mkEnableTargetWith and use it for documenting dynamic autoEnable conditions#1470
danth merged 7 commits intorelease-25.05from
backport-1244-to-release-25.05

Conversation

@stylix-automation
Copy link
Copy Markdown
Contributor

This is an automated backport of #1244.

MattSturgeon and others added 7 commits June 9, 2025 15:11
Drop the redundant "same as" prefix and instead use a `literalExpression`.

Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
(cherry picked from commit 93eb9c5)
Refactor `mkEnableTarget` and `mkEnableWallpaper` to use `mkEnableIf`.

(cherry picked from commit 92276a1)
This allows correctly documenting dynamic enable conditions.

E.g:
```nix
    enable = mkEnableTargetWith {
      name = "QT";
      autoEnable = pkgs.stdenv.hostPlatform.isLinux;
      autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";
    };
```

`autoEnableExpr` will be wrapped in parentheses if it contains a nix
operator with lower precedence than `&&`.

Added a note in the docs mentioning `mkEnableTarget` should either have
a static `autoEnable` or specify `autoEnableExpr`.

(cherry picked from commit 0449dae)
Ensure enable options with dynamic `autoEnable` are documented
correctly.

(cherry picked from commit 289356d)
@danth danth enabled auto-merge June 9, 2025 15:17
@danth danth merged commit 82930e9 into release-25.05 Jun 9, 2025
7 checks passed
@danth danth deleted the backport-1244-to-release-25.05 branch June 9, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: home-manager Home Manager target topic: nixos NixOS target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants