{"id":16720513,"url":"https://github.com/dieracdelta/flake_generator","last_synced_at":"2025-03-21T21:30:37.058Z","repository":{"id":42384699,"uuid":"340974276","full_name":"DieracDelta/flake_generator","owner":"DieracDelta","description":"Generate Nix Flakes imperatively.","archived":false,"fork":false,"pushed_at":"2023-11-28T19:59:18.000Z","size":124,"stargazers_count":20,"open_issues_count":10,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T05:11:46.502Z","etag":null,"topics":["flake","nix-expressions","nixpkgs","rnix","skim"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DieracDelta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-21T18:32:39.000Z","updated_at":"2024-07-05T17:27:48.000Z","dependencies_parsed_at":"2024-10-28T11:34:03.490Z","dependency_job_id":"3ba1b3d2-5dc9-4ba0-aba2-0548a3abd567","html_url":"https://github.com/DieracDelta/flake_generator","commit_stats":{"total_commits":70,"total_committers":6,"mean_commits":"11.666666666666666","dds":0.5714285714285714,"last_synced_commit":"3a5946127c5c0ff527f29e6332869b0062cfb6f6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieracDelta%2Fflake_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieracDelta%2Fflake_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieracDelta%2Fflake_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DieracDelta%2Fflake_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DieracDelta","download_url":"https://codeload.github.com/DieracDelta/flake_generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244874093,"owners_count":20524572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flake","nix-expressions","nixpkgs","rnix","skim"],"created_at":"2024-10-12T22:07:22.375Z","updated_at":"2025-03-21T21:30:36.372Z","avatar_url":"https://github.com/DieracDelta.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Imperative Management of Declarative Packages #\n\nNix flakes are a really fantastic way to finely manage project dependencies.\nHowever, writing Nix expressions to specify dependencies is subtle\nand requires learning a whole new language. Can we do better?\n\nTurns out *yes*.  Demo:\n\n\n[![asciicast](https://asciinema.org/a/ZegsK3eFdDwz32mYorJEcOFoQ.svg)](https://asciinema.org/a/ZegsK3eFdDwz32mYorJEcOFoQ)\n\n\n\n# Goal: Avoid writing boilerplate code #\n\nThe goal is to write an imperative CLI to automate the generation\nof the declarative dependencies specified in a flake.\n\nEvery time I start a project, I find myself copying a\nflake that works, and simply tweaking the\nname and list of buildInputs. The goal is to streamline\nthat process and dodge writing any boilerplate code.\n\n# How is this any different than `nix flake init` ? #\n\nThis is meant to be more powerful. Templates generate\nboilerplate code, but without interaction. Interaction\nis *key*. The end user should be able to get their\nproject up and running with minimal effort expended\ntowards figuring out how to get nix to play nicely with\ntheir package and set of dependencies.\n\n# How does this work? #\n\nThe idea is to have the user specify the type of dependencies,\nflake inputs and outputs, and type of the package with `skim`,\nthen to output a flake. This flake is then validated with `rnix`.\n\nIf the user wants to modify an existing flake to add or remove\ndependencies, this will also be possible. The flake shall be\nparsed in with `rnix`, and the user will be able to modify it.\n\nAs of now, basically none of the features exist. I've only\ngot the proof of concept working: skim can be used for a cli\nand rnix can be used to modify the AST.\n\nFurther down the line, I'd like to make this even more interactive.\nThis will involve querying github, crates.io, pypy, nixpkgs and more for packages,\nthen piping them into skim for selection based on language.\n\nThe hope is to also provide automatic support for pre-existing\nnix expression generators such as node2nix, poetry2nix, cabal2nix,\nand naersk.\n\n# Dependencies #\n\nI'm using the `rnix` parser to generate nix expressions,\nand the `skim` fuzzy finder for the cli.\n\n# Roadmap #\n\n- [x] Proof of concept\n- [ ] Flake Input management\n  - [ ] Add inputs\n  - [ ] Remove inputs\n  - [ ] Change inputs\n  - [ ] Query github\n- [ ] BuildInput management\n  - [ ] Query nixpkgs\n  - [ ] Modify buildInputs\n  - [ ] Add buildInputs\n  - [ ] Delete buildInputs\n- [ ] Specify flake outputs\n- [ ] Support of specific languages:\n    - [ ] Python\n    - [x] Rust\n    - [ ] Haskell\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieracdelta%2Fflake_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdieracdelta%2Fflake_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdieracdelta%2Fflake_generator/lists"}