-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Implement standardized "use flags" for Nixpkgs #39580
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
Changes from 2 commits
555d0c6
69a2a5e
3f8943f
b985ab6
c44ecd4
4ff72fd
0da6168
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| {lib, stdenv}: | ||
|
|
||
| with lib; | ||
|
|
||
| # Define some user flags. Note that none of these should be mutually | ||
| # exclusive. For instance enabling X11 should not imply that Wayland | ||
| # is disabled. | ||
|
|
||
| { | ||
|
|
||
| lang = mkOption { | ||
| default = "en"; | ||
| type = types.string; | ||
| description = '' | ||
|
|
||
| The target language to compile packages with support for. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withX11 = mkOption { | ||
| default = stdenv.isLinux; # also BSDs? | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the X Window System. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withWayland = mkOption { | ||
| default = stdenv.isLinux; # also BSDs? | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the Wayland window system. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withAlsa = mkOption { | ||
| default = stdenv.isLinux; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the ALSA sound system. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withPulseAudio = mkOption { | ||
| default = stdenv.isLinux; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the PulseAudio sound system. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withJack = mkOption { | ||
| default = false; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the JACK sound system | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withQt = mkOption { | ||
| default = true; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the Qt graphical toolkit | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withGTK = mkOption { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should probably be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can do that although I'm not quite sure if that's better. GTK is usually capitilized.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So is ALSA. See this question discussing the use of acronyms in identifiers. I do not really care which style we choose but the inconsistency is jarring.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. That only first letter capitalizes also bothered me in Since I have a love towards descriptive names, I adopted this |
||
| default = false; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the GTK graphical toolkit | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withApple = mkOption { | ||
| default = stdenv.isDarwin; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with Apple's proprietary frameworks. | ||
|
|
||
| Note that this only supports macOS currently. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| withSystemd = mkOption { | ||
| default = stdenv.isLinux; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to compile packages with support for the Systemd init system. | ||
|
|
||
| Note that this specifically means compiling packages with the | ||
| /Systemd/ libraries. Unit files should always be included in | ||
| packages. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| allowUnfree = mkOption { | ||
| default = false; | ||
| type = types.bool; | ||
| description = '' | ||
|
|
||
| Whether to support unfree software. This includes everything not | ||
| considered free software by the Free Software Foundation. | ||
|
|
||
| ''; | ||
| }; | ||
|
|
||
| } | ||
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.
Can you use
hostPlatforminstead?Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah definitely! targetPlatform might actually make more sense though. In fact, one of the big reasons for doing this is getting rid of a lot of the
stdenv.isDarwinandstdenv.isLinuxthat is spread accross Nixpkgs. Quite a few should be easily replaced withwithApple,withSystemdandwithAlsa.