-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ghostty: allow darwin users to manager their config #6300
Open
anund
wants to merge
3
commits into
nix-community:master
Choose a base branch
from
anund:ghostty_darwin_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to capitalize ghostty in the description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't appear to work when nixpkgs is marking the package as broken. Setting the package to null in config isn't allowed (not nullable) and nixpkgs evaluates the default since it is present. This does work when the package isn't present at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't be present look at: #6300 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, my mistake on where the actual eval was coming from. "Ghostty" isn't needed if we're guarding all the package sites.
mkPackageOption
currently only checks for presence not whether or not the package is broken.I considered checking if the package is broken instead and looked at ~hostPlatform. I think Linux is the only supported output from
hostPlatform
so that doesn't seem to buy much generality.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out this trying to avoid installing only on linux brings in different complications. When we just gate on
isLinux
we add a synchronization point with nixpkgs. If nixpkgs gains a darwin version of ghostty (as some are working on) this module will have to change at the ~same as it's introduced into nixpkgs. Addtionally, to a lesser degree, it also interferes with users ability to set their own package if they figure out some work around for themselves. If, say, a *bsd or darwin user gets a package working for themselves before it lands in nixpkgs they would not be able to use the module as is.There's a bit of weirdness around a transition from broken -> working for macos users too. If a nixpkgs copy exists some users will want that copy and some will want the macos managed version instead. (technically this could also be the case for nix on Arch)
To me this suggests setting
nullable: true
and handling the null case. Trying to default to the 'right' value for darwin users runs into that point above around choosing darwin or nix hosted packages.My user facing suggestion for that is adding an assertion:While it's possible ghostty darwin becomes a package there isn't an easy option to avoid setting the package to null, as far as I can see.(!lib.meta.availableOn stdenv.hostPlatform cfg.package) -> (cfg.package == null)
with the message "programs.ghostty.package is marked as broken on your platform, set the value to null to manage your configuration without installing the package"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handling null for
package
is exactly the path I have chosen for my private Ghostty module. I support that route.