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

Teach pure interfaces by default #1049

Open
fricklerhandwerk opened this issue Sep 4, 2024 · 0 comments
Open

Teach pure interfaces by default #1049

fricklerhandwerk opened this issue Sep 4, 2024 · 0 comments
Labels
site Improvements to the site infrastructure or content presentation

Comments

@fricklerhandwerk
Copy link
Collaborator

fricklerhandwerk commented Sep 4, 2024

Observations

We're currently showing patterns like

pkgs = import nixpkgs { config = {}; overlays = []; system = builtins.currentSystem; };

as a defensive measure against historical, impure interfaces that may mess with your expression if you happened to follow the ancient documentation on configuring Nixpkgs.

Problem

Dismantling the Nixpkgs manual is a big chunk of work, and in any case that wouldn't remove the convenient-looking but foot-gunny impure interface which is used absolutely everywhere.

Approaches

Until NixOS/nixpkgs#339635 is settled, we can only show the ugly but technically correct

pkgs = import "${nixpkgs}/pkgs/top-level" { localSystem.system = builtins.currentSystem; };

and may eventually please today's new users with a future release that makes the interface less verbose.
This would require replacing all instances where we use it, and updating the relevant best practices section.

Willing to help?

As always.

Priorities

Add 👍 to issues you find important.

@fricklerhandwerk fricklerhandwerk added the site Improvements to the site infrastructure or content presentation label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site Improvements to the site infrastructure or content presentation
Projects
None yet
Development

No branches or pull requests

1 participant