Skip to content
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

[Demo] splice.nix: poor man's implementation of Gentoo-like use-flags #56109

Closed
wants to merge 1 commit into from

Conversation

oxij
Copy link
Member

@oxij oxij commented Feb 20, 2019

What? Why?

See #56110.

git log

  • splice.nix: poor man's implementation of Gentoo-like use-flags

    Now, instantiate mpv, add

    poorMansUseFlags = {
      pulseaudioSupport = false;
    };
    

    (Sure, there is pulseaudio option already, I wanted to propose to set x11Support, but setting it breaks evaluation ATM...)

    Instantiate mpv again. Compare drvs.

nix-instantiate environment

  • Host OS: Linux 4.9, SLNOS 19.03
  • Nix: nix-env (Nix) 2.1.3
  • Multi-user: yes
  • Sandbox: yes
  • NIXPKGS_CONFIG:
{
  checkMeta = true;
  doCheckByDefault = true;
}

nix-env -qaP diffs

  • On x86_64-linux: noop
  • On aarch64-linux: noop
  • On x86_64-darwin: noop

Now, instantiate `mpv`, add

```
poorMansUseFlags = {
  pulseaudioSupport = false;
};
```

(Sure, there is `pulseaudio` option already, I wanted to propose to set `x11Support`, but setting it breaks evaluation ATM...)

Instantiate `mpv` again. Compare drvs.
@nixos-discourse
Copy link

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/gentoo-like-use-flags/2210/1

@danbst
Copy link
Contributor

danbst commented Feb 23, 2019

On a second thought, this seems to be basic needed change. Just replace poorMansUseFlags with use. Then nixpkgs.config.use will override scope, not pkgs (which can be overriden with packageOverrides or overlays). The only minor issue is the use if (//), which isn't recursive, but well I don't know if this is needed here.

The actual config.use then can be constructed on-the-site - no need to upstream useDefinitions, but still possible to share. As Hydra problem and configuration space explosion problems don't yet have a nice solution, I doubt actual use flags can be upstreamed here.

The consensus on naming things has indeed to go through RFC. But what is nice about this PR, it doesn't need that consensus, so I guess this (this idea, I mean) can be merged without RFC.

We can also cc Graham C. on whether RFC is required for this.

@oxij
Copy link
Member Author

oxij commented Feb 23, 2019

Closed in favor of #56227.

@oxij oxij closed this Feb 23, 2019
@oxij
Copy link
Member Author

oxij commented Feb 23, 2019

@danbst Yes, this is the crux of #56158 and #56227, but the whole point of use-flags is UI, and this has a very bad one. #56227 is also pretty awesome, IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants