!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

234 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.48 Servers

Load older messages


SenderMessageTime
2 May 2024
@hbjy:matrix.orgHayden joined the room.20:41:06
@c0ba1t:matrix.orgCobalt joined the room.21:07:39
4 May 2024
@hofsiedge:matrix.orgIlya Zuev joined the room.06:49:44
@claesatwork:matrix.orgClaes joined the room.20:56:31
7 May 2024
@cblacktech:matrix.orgcblacktech joined the room.06:50:12
8 May 2024
@adam:robins.wtfadamcstephens 🐝 left the room.22:24:36
9 May 2024
@fractivore:cyberia.clubsymys joined the room.05:57:18
@fractivore:cyberia.clubsymys I'm confused about gomuks... the package source includes olm in buildInputs, but it doesn't seem to have encryption support on my machine? Is it just me somehow? 06:01:38
@fractivore:cyberia.clubsymys I built a vm to test it out, and I believe what happened is it built without encryption support on my machine because I didn't have gcc or any C compiler installed the first time I installed it. In the VM, I included just gccandgoin environment.systemPackages and it built with encryption support still fine. But even though I havegcc` installed on my real machine now, there's still no encryption support. 21:05:28
@fractivore:cyberia.clubsymys * I built a vm to test it out, and I believe what happened is it built without encryption support on my machine because I didn't have gcc or any C compiler installed the first time I installed it. In the VM, I included just gccandgoin environment.systemPackages and it built with encryption support still fine. But even though I havegcc\ installed on my real machine now, there's still no encryption support. 21:05:37
@fractivore:cyberia.clubsymys * I built a vm to test it out, and I believe what happened is it built without encryption support on my machine because I didn't have gcc or any C compiler installed the first time I installed it. In the VM, I included just gccandgoin environment.systemPackages and it built with encryption support still fine. But even though I havegcc installed on my real machine now, there's still no encryption support. 21:05:50
@fractivore:cyberia.clubsymysIDK, this doesn't seem quite right to me. Shouldn't the package check for a C compiler if it needs one, rather than just building a different version? How is stuff like this with CGo usually handled?21:07:45
@jrick:zettaport.comjrick add CGO_ENABLED = 1; to your buildGoModule attrset 21:12:54
@jrick:zettaport.comjrick cgo is disabled by default, and any source files that exclude cgo build tags won't be used 21:14:08
@jrick:zettaport.comjrickat least i think it is disabled by default. i set it for the cgo things i build21:19:20
@diamondburned:matrix.orgDiamond (it/she)if it's not already in the nixpkgs file and that does indeed fix the issue, then you should file a PR22:01:34
@diamondburned:matrix.orgDiamond (it/she)it might be a regression, iirc Go now disables Cgo by default unless it detects CC in the env22:01:51
@diamondburned:matrix.orgDiamond (it/she)https://tip.golang.org/doc/go1.2022:02:11
@diamondburned:matrix.orgDiamond (it/she)
The go command now disables cgo by default on systems without a C toolchain. More specifically, when the CGOENABLED environment variable is unset, the CC environment variable is unset, and the default C compiler (typically clang or gcc) is not found in the path, CGOENABLED defaults to 0. As always, you can override the default by setting CGO_ENABLED explicitly.
22:02:20
10 May 2024
@fractivore:cyberia.clubsymys wait.... It's actually building with encryption support in the VM without adding CGO_ENABLED=1; or gcc or anything. I'm confused, but I guess it's a quirk with my local system after all.
Even so, the program does use CGO, and it's not like adding that attribute breaks the build, so should I submit the PR anyway?
02:44:32
@diamondburned:matrix.orgDiamond (it/she)verify that your VM has the same nixpkgs input first02:54:01
@brumik1:matrix.org@brumik1:matrix.org joined the room.07:54:38
@cequal:matrix.org@cequal:matrix.org joined the room.12:26:08
11 May 2024
@brumik1:matrix.org@brumik1:matrix.org

Hello, bit new here (with nix too). I would like to ask if somebody could clarify for me how do I add a runtimeInput to a go package? I understand that this is not a Go issue as per-say, but rather more flakes/derivation problem.

I use gomod2nix with flake. All works good except that I have a cmd line tool that my go program needs to call. I would like my flake to specify this dependency just like writeShellApplication does. Maybe somebody could help me out or at least give some pointers?

08:03:58
@brumik1:matrix.org@brumik1:matrix.org *

Hello, bit new here (with nix too). I would like to ask if somebody could clarify for me how do I add a runtimeInput to a go package? I understand that this is not a Go issue as per-say, but rather more flakes/derivation problem.

I use gomod2nix with flake. All works good except that I have a cmd line tool that my go program needs to call. I would like my flake to specify this dependency just like writeShellApplication does. Maybe somebody could help me out or at least give some pointers?

Edit: the project: https://github.com/brumik/bw-setup-secrets/

08:05:22
@diamondburned:matrix.orgDiamond (it/she)
In reply to @brumik1:matrix.org

Hello, bit new here (with nix too). I would like to ask if somebody could clarify for me how do I add a runtimeInput to a go package? I understand that this is not a Go issue as per-say, but rather more flakes/derivation problem.

I use gomod2nix with flake. All works good except that I have a cmd line tool that my go program needs to call. I would like my flake to specify this dependency just like writeShellApplication does. Maybe somebody could help me out or at least give some pointers?

Edit: the project: https://github.com/brumik/bw-setup-secrets/

you want to add a hook that calls wrapProgram on your binary to wrap it around a shell script that appends the PATH variable appropriately
09:52:33
@diamondburned:matrix.orgDiamond (it/she)you may want to try using postInstall maybe 09:54:14
@brumik1:matrix.org@brumik1:matrix.org

Thank you for the answer!

PostInstall is part of mkDerivation right? Can I do there writeShellApplication? Some approximate example would help me greatly in my failing attempts

10:10:31
@diamondburned:matrix.orgDiamond (it/she) `nix
buildGoModule {
// ...
shellHook =
}
23:26:15
@diamondburned:matrix.orgDiamond (it/she)omg23:26:17

Show newer messages


Back to Room ListRoom Version: 9