An open API service indexing awesome lists of open source software.

https://github.com/replit/nix-editor

an automatic editor for replit.nix files
https://github.com/replit/nix-editor

Last synced: 6 months ago
JSON representation

an automatic editor for replit.nix files

Awesome Lists containing this project

README

          

This program edits Replit's replit.nix editor that is used by Goval to modify programatically interact with the file.

It parses the file into an AST and traverses the AST to get the relevant information to modify the file.

run `cargo run -- --help` to see what cli arguments are available.

```
nix-editor

USAGE:
nix-editor [OPTIONS]

OPTIONS:
-a, --add
-d, --dep-type [default: regular] [possible values: regular, python]
-h, --human
--help Print help information
-p, --path
-r, --remove
--return-output
-v, --verbose
-V, --version Print version information
```

You can directly add/remove packages through the cli args like so `cargo run -- --add pkgs.cowsay` or `cargo run -- --remove pkgs.cowsay` or `cargo run -- --get`.

You can also run it without passing in any flags. If you do that, it reads json from stdin with the following structure:
```
{"op":"add", "dep": "pkgs.cowsay" }
```

# Contributing

* Please run `nix fmt` to format the code in this repository before making a pull request.
* `nix develop` will put you in a devshell with all the necessary development tools.