Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this Pull Request (PR) does
Don't run
extract_wisdom
orsummarize
on thisI am the maintainer of
fabric-ai
package in the central NixOS repository called nixpkgsEarlier I created a PR #1088, but to make development a lot more comfortable for myself and other Nix users who decide to contribute to fabric I also wrote this Nix flake which will bring benefits of the Nix ecosystem to fabric.
It improves developer experience and lets people unclutter their systems. Flake maintenance is not resource intensive at all if you know what you are doing, so any Nix user can create a PR if
flake.lock
needs updating.What does this bring to the project:
nix build
to build fabric the build will be binary level reproducible on any system because everything is pinned in theflake.lock
including the compiler.go
compiler, go tools, gomod2nix,and the helper script
update
that basically executesgo mod -u && go mod tidy && gomod2nix generate
. Everything in this flake is pinned usingflake.lock
which is checked into git so you also get a history of ALL your dependencies including the compiler, not just go modules.flake.nix
means that NixOS users can directly installfabric
from your git repository and any of it's branches or tags bypassing thefabric-ai
package the central nixpkgs repository that is updated a lot less frequently.nix fmt
formats all go files codebase withgofmt
and all nix files with various nix formatters. It is possible to addyamlfmt.enable = true;
totreefmt.nix
and then it will also format yaml files, basically it's a tool to format any text files in the project.nix flake check
can be used to check if all files are formatted properly. In the future I probably will open a PR that addsgoimports-reviser
support totreefmt-nix
so it will also be able to sort imports.If you don't know what Nix is and don't use it:
nix build
for a production package ornix develop
to enter a devshell with the needed compiler and rungo build
What to keep in mind:
go get -u && go mod tidy
or modifygo.mod
in any other way and then don't rungomod2nix generate
after that it will desyncgo.mod
andgomod2nix.toml
which can lead to unexpected results when usingnix build
or installing the nix package, normal builds will not be affected.gomod2nix gnerate
on all commits so that ifgo.mod
is changed in any of themgomod2nix.toml
is automatically synced.go.mod
but you will have to remind this to everyone who creates a PR that requires changinggo.mod