Setting up zCli on NixOS
hey @Arbel can you ask your questions here ? related to installing zcli
65 Replies
and related to lxc
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
alright 💯
what does it take to add a package to nix package manager @Arbel, any idea?
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
@Aleš can i try setting that up ? 🤔
sure if you want
Going through all the steps carefully will take around 60 minutes.these more obscure distros sure like to make things a little hard lol @Nermal reading through the tutorial, I'm not sure you'll be even able to properly do it without actually having Nix
:monkaChrist: gimme some minutes i'll get back to you if i can set this up from some other blog
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
alright suree
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Hmmmm
Oh okay will fix it
will get back to you tomorrow
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
alright
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
it's in go
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
all npm i -g does is download the binary for the correct os and put it in path
https://github.com/zeropsio/zcli
you can download binaries directly here
https://github.com/zeropsio/zcli/releases
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Hmmmmmm alright thanks @Arbel
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
https://github.com/zeropsio/zcli (i think you'll need to setup a github workflow as well i think ?)
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Hmmm
Are you gonna make a pr to nixpkgs ?
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
sUREEE
GOT IT
feel free to make one
https://github.com/marketplace/actions/use-nix-shell-action look into this maybe @Arbel
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Hmmmm 🤔 alright we'll review this as soon as possible
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
This test is testing if
zcli push
works correctly and can not be deleted, since zcli push
operates with git
initialized repository.
Can't Go build flags be used to ignore this test file while building for NixOS instead of the patch?Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Try to add
//go:build exclude
to the top of that test file, it should be excluded during build phase.
Yeah, thing is, if that file changes, I can guarantee people would forget to update the patch file and it would break.Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Nice, we could probably have that tag straight in the file without the patch, since it's a test file, it isn't necessary during build phase.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Please add it directly.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
One question, how does the
vendorHash
work? Is hash supposed to be a checksum of the final binary?
Similar with version
, does it somehow extract it from the gomodule, or is the one defined in .nix
file static?
If yes, that means it has to be changed with every commit, which we would have to automate somehow 🤔Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
We would like to avoid committing of the
vendor
folder. But does anything prevent you doing go mod vendor
before the build?Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
What version of GO do you have installed? I think I encountered that when I had older version of GO.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
If you run
go mod tidy
and then go mod vendor
?Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Can you check if the vendor dir that gets created/moved isn't
/vendor/vendor/
like in this thread:
https://discourse.nixos.org/t/cant-update-a-go-package-getting-go-inconsistent-vendoring/27063/6NixOS Discourse
Can't update a Go package, getting
go: inconsistent vendoring
Thanks a lot for your help again. I finally figured this out 🎉 : This happens (probably only to me) due to installManPage in postBuild. The go-modules derivation inherits the postBuild that one would expect to be used by the main builder, not the builder of the go-modules derivation[1]: Hence since go-modules runs my postBuild, the $out dire...
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
alrighttt
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Hi, sorry for such delay.
If by 1830 dependencies you mean downloaded files, that will probably be caused by packages downloading everything, including files that aren't really necessary (e.g.
_test.go
, readme files etc.).
One thing I would change is the Arbel's zcli flake
, since at least I would find it weird in an official repo (I have nothing against you and nermal being mentioned in maintainers of the nix flake).
Probably just to ZeropsCLI flake
🤔Hmmmmmmmm i was just thinking of testing it on a nix distro thats why i added myself
but well @Arbel i think this message is for you
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Probably to something standard, it seems like it's basically a description you would have in a standard package manager, so probably just a
Zerops CLI utility
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
installed nix on parallels will test it there 😸
So did it work? If yes, ideally just a few notes for our docs would be nice (like, were you able to just run some 2 specific commands to install it), and I will merge that bad boy in and keep spamming our docs people untill it's there 😛
@Michal Saloň https://github.com/zeropsio/zcli/pull/163 feel free to merge this ~ and @Arbel mentioned he can write the guide for that
GitHub
added basic nix flake by Arbel-arad · Pull Request #163 · zeropsio...
a patch was required to disable some incompatible git file tests (nix removes .git when building)
@Aleš can we merge this ?
sure
done
thanks @Arbel!
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
should .envrc be in .gitignore? gitguardian is complaining
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
yea I'll just ignore it