Compatibility with builtins.getFlake #15

Open
opened 2021-01-01 11:44:15 +00:00 by zimbatm · 3 comments
zimbatm commented 2021-01-01 11:44:15 +00:00 (Migrated from github.com)

What do you think if flake-compat was changed to provide the same output as builtins.getFlake? That way, most of the logic can be substituted if the builtin exists.

Then the other issue is to select the right shell and packages from the current system, which I think is a separate concern. For this I would propose to extend the flake schema to include currentSystem = { packages = []; devShell = <drv>; <...> }.

With both of these combined, flake-compat is the same as builtins.getFlake, and the flake schema would look something like this:

{ 
  description = "";
  inputs = {};
  outputs = inputs: {};
  currentSystem = {};
}
What do you think if flake-compat was changed to provide the same output as `builtins.getFlake`? That way, most of the logic can be substituted if the builtin exists. Then the other issue is to select the right shell and packages from the current system, which I think is a separate concern. For this I would propose to extend the flake schema to include `currentSystem = { packages = []; devShell = <drv>; <...> }`. With both of these combined, `flake-compat` is the same as `builtins.getFlake`, and the flake schema would look something like this: ```nix { description = ""; inputs = {}; outputs = inputs: {}; currentSystem = {}; } ```
edolstra commented 2021-01-12 11:23:19 +00:00 (Migrated from github.com)

What do you think if flake-compat was changed to provide the same output as builltins.getFlake?

Isn't that the case already?

> What do you think if flake-compat was changed to provide the same output as builltins.getFlake? Isn't that the case already?
zimbatm commented 2021-01-12 15:29:44 +00:00 (Migrated from github.com)

It's quite close to being a poly-fill for builtins.getFlake, but not quite. It would need to output result without the defaultNix and shellNix attributes. And the input parameters aren't exactly the same as builtins.getFlake either.

It's quite close to being a poly-fill for `builtins.getFlake`, but not quite. It would need to output `result` without the `defaultNix` and `shellNix` attributes. And the input parameters aren't exactly the same as `builtins.getFlake` either.
jsoo1 commented 2021-12-09 05:01:47 +00:00 (Migrated from github.com)

It would actually also be really nice if it were possible to add polyfills for builtins.getFlake and builtins.fetchTree (inasmuch as that is possible).

It would actually also be really nice if it were possible to add polyfills for `builtins.getFlake` and `builtins.fetchTree` (inasmuch as that is possible).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/flake-compat#15
No description provided.