Z
Zerops•4mo ago
nermal

Setting up zCli on NixOS

hey @Arbel can you ask your questions here ? related to installing zcli
65 Replies
nermal
nermalOP•4mo ago
and related to lxc
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
alright 💯
Aleš
Aleš•4mo ago
what does it take to add a package to nix package manager @Arbel, any idea?
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
@Aleš can i try setting that up ? 🤔
Aleš
Aleš•4mo ago
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
nermal
nermalOP•4mo ago
:monkaChrist: gimme some minutes i'll get back to you if i can set this up from some other blog
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
@Arbel can you test it ? (i cant test it so not so sure if it will work sucessfully on a nixos distro)
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
alright suree
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
Hmmmm Oh okay will fix it will get back to you tomorrow
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
alright
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Aleš
Aleš•4mo ago
it's in go
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Aleš
Aleš•4mo ago
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
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
Hmmmmmm alright thanks @Arbel
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
https://github.com/zeropsio/zcli (i think you'll need to setup a github workflow as well i think ?)
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
Hmmm Are you gonna make a pr to nixpkgs ?
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
sUREEE GOT IT feel free to make one https://github.com/marketplace/actions/use-nix-shell-action look into this maybe @Arbel
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
Hmmmm 🤔 alright we'll review this as soon as possible
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
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
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
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
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
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
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
Please add it directly.
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
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
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
We would like to avoid committing of the vendor folder. But does anything prevent you doing go mod vendor before the build?
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
What version of GO do you have installed? I think I encountered that when I had older version of GO.
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
If you run go mod tidy and then go mod vendor?
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•4mo ago
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/6
NixOS 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
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•4mo ago
alrighttt
Unknown User
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•3mo ago
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 🤔
nermal
nermalOP•3mo ago
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
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Michal Saloň
Michal Saloň•3mo ago
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
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
nermal
nermalOP•3mo ago
installed nix on parallels will test it there 😸
Michal Saloň
Michal Saloň•3mo ago
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 😛
nermal
nermalOP•3mo ago
@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)
nermal
nermalOP•3mo ago
@Aleš can we merge this ?
Aleš
Aleš•3mo ago
sure done thanks @Arbel!
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Aleš
Aleš•3mo ago
should .envrc be in .gitignore? gitguardian is complaining
No description
Unknown User
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Aleš
Aleš•3mo ago
yea I'll just ignore it
Want results from more Discord servers?
Add your server