Skip to content

Conversation

@alexdavid
Copy link
Contributor

Short POC that implements #427 and is a step toward completing #348. Just threw this together to open a discussion to see if this is the direction we were all thinking about for #427, or if we wanted something different.

@alexdavid alexdavid linked an issue Nov 22, 2023 that may be closed by this pull request
@alexdavid alexdavid force-pushed the ad/call-flake-dogfooding-poc branch from a0e1c14 to 1ded956 Compare November 29, 2023 03:54
@alexdavid
Copy link
Contributor Author

Updated per discussion above. Let me know what you think! This is still in draft since I haven't pulled anything except the fileserver and checks.

@alexdavid alexdavid force-pushed the ad/call-flake-dogfooding-poc branch from 0686c28 to 304fdfb Compare November 29, 2023 17:30
@alexdavid alexdavid changed the title Add dogfooding proof of concept Implement importFlake Nov 29, 2023
@alexdavid alexdavid marked this pull request as ready for review November 29, 2023 17:32
Copy link
Contributor

@soenkehahn soenkehahn left a comment

Choose a reason for hiding this comment

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

We need a changelog entry.

import { mkPackage, Package } from "./package.ts";

function getFlake(flakeDir: string): NixExpression {
if (flakeDir.match(/^[.][.]?[/]/)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This matches relative and absolute paths?

Btw, there's also lots of other flake url syntax options, see here and here lists all possible types. So e.g. file:... and path:... are valid flake urls. I don't think we have to support any of this besides what's currently implemented. But 1. I wanted you to know those exist and 2. maybe we should think about what happens with those right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This matches relative paths only at the moment. Do you think we should support absolute paths? One thing I realized in testing is that the only thing that would break when using a flake input vs callFlake is parent path imports. Maybe we can experiment with file:... and path:... tomorrow and see how they interact with both flake inputs and callFlake

@soenkehahn
Copy link
Contributor

Forgot to mention that I'm very excited about this PR! :)

@alexdavid alexdavid force-pushed the ad/call-flake-dogfooding-poc branch from 16f5eca to 61a979f Compare November 30, 2023 20:03
Copy link
Contributor

@soenkehahn soenkehahn left a comment

Choose a reason for hiding this comment

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

LGTM.

@soenkehahn soenkehahn enabled auto-merge (squash) December 5, 2023 21:49
@soenkehahn soenkehahn merged commit bab8cc5 into main Dec 5, 2023
@soenkehahn soenkehahn deleted the ad/call-flake-dogfooding-poc branch December 5, 2023 22:04
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.

Create a callFlake function

4 participants