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

Consider adding a magit-like interface for interacting with Nix #104

Open
cjbassi opened this issue Aug 30, 2020 · 4 comments
Open

Consider adding a magit-like interface for interacting with Nix #104

cjbassi opened this issue Aug 30, 2020 · 4 comments

Comments

@cjbassi
Copy link

cjbassi commented Aug 30, 2020

The emacs guix package has implemented this feature and it looks really great: https://github.com/alezost/guix.el. Would it be possible to add this feature to this package or should it be done in a separate package? Thanks.

@yilinwei
Copy link
Contributor

yilinwei commented Sep 3, 2020

I can't speak for the maintainers but I do think that having a good porcelain would really help newcomers to nix in general - it's not for nothing that magit is so widely used!

That said, I think it would be good to put this in a separate repository for now, with the eventual goal of merging back upstream once it's stable. I'm fairly new as a nix-user but I'm happy to collaborate with anyone who has a better idea of what should go in a porcelain.

@akirak
Copy link
Contributor

akirak commented Dec 22, 2020

Granted that nix commands support the docopt syntax, I think docopt.el can help with this issue. I don't know if it does. nix-build doesn't seem to provide --help flag, and it displays a man page instead.

@nagy
Copy link
Member

nagy commented Jul 13, 2021

I want to take this on. I have used emacs-guix in the past and know how it works. I have published the first part of this at #134 which addresses store-paths. The next step in my opinion would be and interaction on objects in the Repl. This can give us access to package information and metadata that is lost in the store, such as homepages, licenses and srcs.

@akirak
Copy link
Contributor

akirak commented Nov 5, 2021

I am currently working on a transient wrapper for flake commands (see #140). As there are so many commands in Nix and some of them are even experimental, I have implemented only a small subset of them such as nix build, nix run, and nix flake check/lock/update. Support for the flags is also limited, based on my usage. Think of it as a proof of concept, but it has been already useful for me.

The main entry point is nix-flake, which lets you dispatch a flake command.

I have also implemented nix-flake-init, which lets you initialize a new project from a template in the registry. It has a limited support for the registry.

Because it depends on private functions from nix.el, it would be better to maintain the library in the same repository as nix.el, but I don't mind if I will have to maintain it in my repository as a separate package.

I think it may need refinement, so I will mark the PR as a draft. Any feedback is welcome.

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

4 participants