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

Allow to specify some flake outputs from Nickel #140

Merged
merged 3 commits into from
Sep 27, 2023
Merged

Conversation

YorikSar
Copy link
Collaborator

@YorikSar YorikSar commented Sep 25, 2023

Add flake field to project.ncl that allows to specify certain flake outputs. For example, you can add lines like these to run hello as an app or a check:

flake.apps.hello.program = nix-s%"%{import_nix "nixpkgs#hello"}/bin/hello"%,
flake.checks.hello = import_nix "nixpkgs#hello",

I will be gragually migrating apps and checks from our flake.nix to project.ncl using this.

Also update flake inputs for the example to use newer Nickel required by the new changes.

Part of #58.

Add project.ncl and nickel.lock.ncl, use them for this very flake.
For now use only devshells.

Update cachix/install-nix-action to install Nix 2.17 that doesn't
evaluate `packages` for all systems on `nix flake check`.

Preparation for dogfooding future improvements from
#58
It's using old Nickel version that will be incompatible with future
changes.
Add `flake` field to `project.ncl` that allows to specify certain
flake outputs. For example, you can add lines like these to run `hello`
as an app or a check:

  flake.apps.hello.program = nix-s%"%{import_nix "nixpkgs#hello"}/bin/hello"%,
  flake.checks.hello = import_nix "nixpkgs#hello",

I will be gragually migrating apps and checks from our `flake.nix` to
`project.ncl` using this.

Part of #58
@thufschmitt
Copy link
Member

I'm not sure I get it. Why are some outputs at toplevel and some under flake? Can't we just have everything at toplevel in the flake? Or everything under flake if we want to hide it and add our own abstraction on top?

@YorikSar
Copy link
Collaborator Author

@thufschmitt I’m not sure we want to expose everything at top level, so I’ve decided to namespace it. Mixing flake API with Organist one doesn’t feel right to me because it’s less declarative, less abstract and less typed. I feel like flake section should be an “output” of Nickel part.
If you want, I can move it to the top level now, or we could do that at any point later if we decide that’s better.

@thufschmitt
Copy link
Member

Fair enough. Let's keep our distances from the Nix interface for the time being.

We are somewhat tied to it though since Nix is our entry point. Not sure how to best juggle this in the long run.

@YorikSar YorikSar marked this pull request as ready for review September 26, 2023 13:21
@thufschmitt thufschmitt added this pull request to the merge queue Sep 27, 2023
Merged via the queue into main with commit ad3253f Sep 27, 2023
@thufschmitt thufschmitt deleted the flake-ncl branch September 27, 2023 16:01
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