!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

229 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.50 Servers

Load older messages


SenderMessageTime
11 Jan 2024
@qbit:tapenet.org@qbit:tapenet.org so you'd remove the go.* files and then ref github.com/mplsbugbounty/signaslbot/errUtils 19:31:41
@qbit:tapenet.org@qbit:tapenet.org where errUtils is the package name in the errUtils dir 19:31:53
13 Jan 2024
@fractivore:cyberia.clubSYMYƧI decided to just refactor it to avoid the custom import which wasn't really necessary. Now I'm having another problem with the build:00:47:48
@fractivore:cyberia.clubSYMYƧ *

I decided to just refactor it to avoid the custom import which wasn't really necessary. Now I'm having another problem with the build:

error: builder for '/nix/store/zf22x2ygw6ldag7b7dxi8r4gd7vgbd3q-signASLbot-.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Building subPackage .
       > # maunium.net/go/mautrix/crypto/olm
       > vendor/maunium.net/go/mautrix/crypto/olm/account.go:4:11: fatal error: olm/olm.h: No such file or directory
       >     4 | // #include <olm/olm.h>
       >       |           ^~~~~~~~~~~
00:48:04
@fractivore:cyberia.clubSYMYƧ

I tried to make libolm available to my environment by installing it in my configuration, e.g.:

  environment.systemPackages = [
    pkgs.olm
  ];

Might not be the right package, or might not be what I need to do to make olm.h available . Does anybody know what to do here?

00:49:55
@qbit:tapenet.org@qbit:tapenet.orgyou might need pkg-config 00:58:06
@qbit:tapenet.org@qbit:tapenet.orgbut also you probably want olm in your derivation that builds signaslbot00:58:21
@qbit:tapenet.org@qbit:tapenet.orghere's an example that uses some x11 stuff: https://github.com/qbit/traygent/blob/main/flake.nix#L2801:02:02
@qbit:tapenet.org@qbit:tapenet.orgall your deps go in buildInputs01:02:14
@fractivore:cyberia.clubSYMYƧthanks again for all the help01:25:30
@qbit:tapenet.org@qbit:tapenet.orgnp01:38:52
14 Jan 2024
@fractivore:cyberia.clubSYMYƧ

Finally got it to build and work.... Repo here: https://github.com/mplsbugbounty/signASL-matrix/tree/master
I just have a couple of follow-up questions.

  1. How could I have figured out the correct usage of buildGoModule myself? I tried searching https://search.nixos.org/packages (as well as flakes and options on the same site for good measure). Nothing came up, I presume because it's a function and not an option, flake, or package. Where is it defined in nixpkgs?
  2. I got it to build with a default.nix that includes
let
  lib = import <nixpkgs> {};
in

lib.buildGoModule rec {

  pname = "signASLbot";
  version = "";

  buildInputs = [
    lib.pkg-config
...

...etc. But I notice nothing in nixpkgs does it this way, instead the whole default.nix file defines a function of an attribute set. When I tried writing my file this way I wasn't able to figure out how to call nix-build to get it to populate this attribute set correctly. Not sure exactly how to phrase this question, but how can I make my nix file more consistent with normal design patterns, and then how do I use it?

17:45:28
@qbit:tapenet.org@qbit:tapenet.orgso search.nixos.org just has existing packages and moudle docs17:49:51
@qbit:tapenet.org@qbit:tapenet.orgnothing related to building packages17:49:55
@qbit:tapenet.org@qbit:tapenet.orgthe manual has a bit of info on all the various build mechanism: https://nixos.org/manual/nixpkgs/stable/#ssec-language-go17:50:44
@qbit:tapenet.org@qbit:tapenet.orgnoogle is also helpful: https://noogle.dev/f/pkgs/buildGoModule17:52:12
15 Jan 2024
@fionera:matrix.orgfionera joined the room.14:16:50
@fionera:matrix.orgfioneraHi, I cam currently migrating a software I maintain to nix and I am wondering what the best practice for a repository with multiple go binaries but one go.mod would be14:17:48
@fionera:matrix.orgfionera * Hi, I am currently migrating a software I maintain to nix and I am wondering what the best practice for a repository with multiple go binaries but one go.mod would be14:18:35
@qbit:tapenet.org@qbit:tapenet.org fionera: hi! 14:19:20
@qbit:tapenet.org@qbit:tapenet.orgthere's a subPackages opiton you can set that list all the various places things live14:19:36
@qbit:tapenet.org@qbit:tapenet.org for buildGoModule 14:19:51
@fionera:matrix.orgfionerabut how would I package it without having to set the vendor hash every time? :D14:20:05
@qbit:tapenet.org@qbit:tapenet.org by default it builds ./... 14:20:12
@qbit:tapenet.org@qbit:tapenet.orguh, you should only have to set it once for every change of deps14:20:24
@qbit:tapenet.org@qbit:tapenet.orgdo you have external C deps? 14:20:30
@qbit:tapenet.org@qbit:tapenet.org if so you will need to set proxyVendor = true; or the hash can change every build 14:20:49
@fionera:matrix.orgfioneraNo but I hoped to even skip the initial pinning :D14:20:49
@fionera:matrix.orgfioneraI am migrating vom bazel to nix 14:21:08
@qbit:tapenet.org@qbit:tapenet.orgonly way to do that is to have your stuff vendor'd already 14:21:14

Show newer messages


Back to Room ListRoom Version: 9