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

top-level refactor #17

Merged
merged 2 commits into from
Jun 26, 2024
Merged

top-level refactor #17

merged 2 commits into from
Jun 26, 2024

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Jun 25, 2024

For very simple flakes, it doesn't make sense to create a whole folder
structure.

ADDITIONS:

  • Add a top-level package.nix that maps to packages.<system>.default
  • Add a top-level formatter.nix that maps to formatter.<system> and packages.<system>.formatter.
  • Load devshells from the devshells/ folder.

CHANGES:

  • perSystem values now merge legacyPackages and packages in that order.
  • packages are loaded with callPackage.

BREAKING:

  • Remove packages/<pname>/package.nix as it makes the interface too
    complicated.
  • lib/default.nix: take { flake, inputs }: instead of inputs.

@zimbatm zimbatm force-pushed the refactor branch 2 times, most recently from 5b3c717 to 31ea1a4 Compare June 25, 2024 18:17
@zimbatm zimbatm changed the title Refactor top-level refactor Jun 25, 2024
@zimbatm zimbatm marked this pull request as ready for review June 25, 2024 19:00
@zimbatm zimbatm force-pushed the refactor branch 3 times, most recently from b4d4736 to fdc4ac6 Compare June 25, 2024 19:54
Copy link
Member

@brianmcgee brianmcgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this refactor. I especially like the top-level devshell.nix and formatter.nix.

It would be nice to have a simple way of pointing the default package at one of the other packages. Currently, the only way I can think of doing that would be something like this in package.nix:

{ pkgs, flake, ...}: flake.packages.${pkgs.system}.foo

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
zimbatm added 2 commits June 26, 2024 08:25
For very simple flakes, it doesn't make sense to create a whole folder
structure.

ADDITIONS:

* Add a top-level package.nix that maps to `packages.<system>.default`
* Add a top-level formatter.nix that maps to `formatter.<system>` and `packages.<system>.formatter`.
* Load devshells from the devshells/ folder.

CHANGES:

* perSystem values now merge legacyPackages and packages in that order.
* packages are loaded with `callPackage`.

BREAKING:
* Remove `packages/<pname>/package.nix` as it makes the interface too
  complicated.
* lib/default.nix: take `{ flake, inputs }:` instead of `inputs`.
This is now covered in the main docs
@zimbatm
Copy link
Member Author

zimbatm commented Jun 26, 2024

It would be nice to have a simple way of pointing the default package at one of the other packages.

I added #18 to keep track of this.

@zimbatm zimbatm merged commit 8fb69fb into main Jun 26, 2024
7 checks passed
@zimbatm zimbatm deleted the refactor branch June 26, 2024 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants