Skip to content

Intermediate version of api-next#251

Merged
blaggacao merged 23 commits intodevelopfrom
api-next
Apr 22, 2021
Merged

Intermediate version of api-next#251
blaggacao merged 23 commits intodevelopfrom
api-next

Conversation

@blaggacao
Copy link
Contributor

This is a pretty long series of internal refactorings in preparation of the stable API change, but that don't just yet change any public API.

I'd like to log this into core for the sake of reducing the (chore) commit inventory.

bors bot added a commit that referenced this pull request Apr 19, 2021
@divnix divnix deleted a comment from bors bot Apr 19, 2021
@divnix divnix deleted a comment from bors bot Apr 19, 2021
bors bot added a commit that referenced this pull request Apr 19, 2021
Comment on lines +67 to +70
lib = utils.lib // {
inherit (lib)
mkFlake;
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
lib = utils.lib // {
inherit (lib)
mkFlake;
};
inherit lib;

Is there a reason not to export the entire devos lib right now? Or even just move the lib down here and refer to it as self.lib when passing to checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, not really. I think before we finalize we should go over this again and only export stuff for which we identify a clear use case.

This, in oder to only commit (resources to maintain) a public api where we create actual value.

Comment on lines +17 to +25
lib = nixpkgs.lib.makeExtensible (self:
let
attrs = import ./attrs.nix { lib = nixpkgs.lib // self; };
lists = import ./lists.nix { lib = nixpkgs.lib // self; };
strings = import ./strings.nix { lib = nixpkgs.lib // self; };
in

utils.lib

Copy link
Member

Choose a reason for hiding this comment

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

I like this! 👍
Could we recreate callLibs to just do this for us? callLibs = file: import file { lib = nixpkgs.lib // self; } So it has the same meaning as upstream lib.

Copy link
Contributor Author

@blaggacao blaggacao Apr 19, 2021

Choose a reason for hiding this comment

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

We could not call it callLib though, since that would lead people to put more stuff into it (by analogy of upstream).

I have been thinking of importWithNixpkgsLibAndSelfLib which would be appropriatly scoped, but then it's very likely easier to just grasp the meaning of // at the calling site.

{ lib, self, ... }:
{ lib }:

{ userFlakeSelf }:
Copy link
Member

Choose a reason for hiding this comment

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

This should only take nixosConfigurations and as a regular input: nixosConfgurations:. That way it can be used by others too: mkHomeConfigurations self.nixosConfigurations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct! There are a couple of those still around which I didn't clean up just yet.

I was thinking we can address those while rebasing on fup.

@blaggacao
Copy link
Contributor Author

bors try

@bors
Copy link
Contributor

bors bot commented Apr 21, 2021

try

Already running a review

@blaggacao blaggacao changed the base branch from core to develop April 21, 2021 23:56
@blaggacao blaggacao merged commit a44fcf6 into develop Apr 22, 2021
@bors bors bot deleted the api-next branch April 22, 2021 00:02
@bors
Copy link
Contributor

bors bot commented Apr 22, 2021

try

Timed out.

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