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

Document what does and does not work? #90

Open
leeola opened this issue Jul 10, 2023 · 4 comments
Open

Document what does and does not work? #90

leeola opened this issue Jul 10, 2023 · 4 comments

Comments

@leeola
Copy link

leeola commented Jul 10, 2023

I'm trying to understand how much of Nix can currently be replaced Nickel and any blockers that would prevent me from integrating at least some of Nickel into my actual Nix configurations. Notably, this comment:

It is currently missing several basic features.

Is a bit difficult to understand. I suspect there's two important key points:

  1. What features of Nix becomes impossible when using Nickel-Nix, if any?
  2. What features of Nix can i write fully in Nickel-Nix?

I imagine documenting this is best done through examples, maybe paired with a readme to guide from one example to the next. Happy to help if i can, but given that i'm currently exploring this as a user with no knowledge of how it works, i'm more on the receiving side. At least until this makes sense to me, if at all heh.

Any thoughts? Better ways to achieve new user documentation, etc?

@leeola
Copy link
Author

leeola commented Jul 10, 2023

Related, documenting the requirements on the Nix side. For example, both the example and the How to use section do not work for me. Probably warrant their own dedicated issue(s), but for explanation:

The example just starts with nix build --impure, running that fails with:

user ~/n/e/c-hello-world (main)> nix build --impure
warning: Using saved setting for 'extra-substituters = https://nickel-nix.cachix.org' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-public-keys = nickel-nix.cachix.org-1:/Ziozgt3g0CfGwGS795wyjRa9ArE89s3tbz31S6xxFM=' from ~/.local/share/nix/trusted-settings.json.
warning: ignoring untrusted substituter 'https://nickel-nix.cachix.org'
error: attribute 'flake' missing

       at /nix/store/w3yq728isc1m8wxp2rqczk35ipr9ix8z-source/examples/c-hello-world/flake.nix:13:5:

           12|   outputs = {nickel-nix, ...} @ inputs:
           13|     nickel-nix.flake.outputsFromNickel ./. inputs {};
             |     ^
           14| }

Likewise, trying to list the dev shells which is the first command to run in the root Readme, results in:

user ~/n/e/c-hello-world (main)> nix flake show github:nickel-lang/nickel-nix
github:nickel-lang/nickel-nix/75c65b2909567252ab347cc0fec839d5dce5d472
├───apps
│   ├───aarch64-darwin
error: not an app definition

This is on NixOS using Flakes. Nix CLI version nix (Nix) 2.11.1. I imagine this is due to some mismatch of version from the expected, but the lack of documentation indicating a required version makes this difficult to implement.

@leeola
Copy link
Author

leeola commented Jul 10, 2023

Updated to NixOS 23.05 and nix cli nix (Nix) 2.15.1, still approximately the same errors.

@YorikSar
Copy link
Collaborator

About the example: it contains flake.lock file that must point to old version of nickel-nix itself. Please try to update nickel-nix input in it.

About features: I don't think nickel-nix is ready for full blown packaging in Nickel, unless you're ready to reimplement all nixpkgs frameworks in it. We pass Nix objects into Nickel world and back, and we're very limited in what we can pass. For example, we cannot pass closures (functions, callbacks) that are wildly used in nixpkgs.

There's an effort to document a vision for the project in #82 that could give you some insight into what will be possible in the future.

@leeola
Copy link
Author

leeola commented Jul 10, 2023

About the example: it contains flake.lock file that must point to old version of nickel-nix itself. Please try to update nickel-nix input in it.

That worked! For googlers, i ran nix flake lock --update-input nickel-nix and nix run .#regenerate-lockfile.

About features: I don't think nickel-nix is ready for full blown packaging in Nickel, unless you're ready to reimplement all nixpkgs frameworks in it. We pass Nix objects into Nickel world and back, and we're very limited in what we can pass. For example, we cannot pass closures (functions, callbacks) that are wildly used in nixpkgs.

Yea this (with examples) is exactly what is missing from documentation, imo. Though with this i'm still a bit unclear on what NickelNix can do. Shame that Nix can't run from some intermediate static config format (JSON/etc) that Nickel could then just compile to.

For context i'd be looking to replace my Nix system configuration with Nickel. I'm very unclear on where the interop occurs, but at the very least i imagine Home Manager would pose issues. I am not currently trying to distribute Nickel as a package for Nix users. Not that it makes much of a distinction when compared to system configuration, probably.

What are some use cases for Nickel Nix as it is usable today? I see devShells and i have them working locally, though i'm unsure how big the gulf is between devshell flakes and system flakes (nixosConfiguration/home manager/etc). Thoughts?

YorikSar added a commit that referenced this issue Jul 11, 2023
Bump lcokfile and update readme according to recent changes.

Addresses some problems mentioned in #90
YorikSar added a commit that referenced this issue Jul 17, 2023
Bump lcokfile and update readme according to recent changes.

Addresses some problems mentioned in #90
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

No branches or pull requests

2 participants