!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

231 Members
Go packaging for and with Nixpkgs. | Be excellent to each other.51 Servers

Load older messages


SenderMessageTime
25 Feb 2025
@gigahawk:matrix.orggigahawk * is there a way to make a non-fixed-output derivation with buildGoModule? I have a package with dependencies that need to be patched to point to nix store but this still results in illegal path references in fixed-output derivation08:26:40
@gigahawk:matrix.orggigahawk *

is there a way to make a non-fixed-output derivation with buildGoModule?
I have a package with dependencies that need to be patched to point to nix store

  packages = rec {
    env86 = pkgs.buildGoModule {
      name = "env86";
      # TODO: Real version
      version = "1";
      src = ./.;
      buildInputs = with pkgs; [
        gtk3
      ];


      # HACK: this package uses purego to link libraries at runtime,
      # which will fail since we have no global libs, patch the library
      # paths to point to nix store
      modPostBuild = ''
        sed -i 's|"libgtk-3.so"|"${pkgs.gtk3}/lib/libgtk-3.so"|' vendor/tractor.dev/toolkit-go/desktop/linux/linux.go
      '';
      vendorHash = pkgs.lib.fakeHash;
      outputHashMode = null;
      outputHashAlgo = null;
      outputHash = null;

      # HACK: guest86 needs to be built externally
      preBuild = ''
        rm -r cmd/guest86
      '';
    };
    default = env86;

  };

but this still results in illegal path references in fixed-output derivation

08:26:54
@odysee:catgirl.cloud@odysee:catgirl.cloud removed their profile picture.12:01:57
@odysee:catgirl.cloud@odysee:catgirl.cloud removed their display name odysee.12:02:04
@odysee:catgirl.cloud@odysee:catgirl.cloud left the room.12:02:14
@nazarewk:matrix.orgkdn Why would go install hang when trying to rebuild netbird from nixpkgs? nom-build -A netbird https://github.com/r-ryantm/nixpkgs/archive/267f63cb9b4faf3ef8fd5be997f1864c29795b2b.tar.gz
I've made my own local version to add set -x and it just hangs on the go install step doing nothing
12:24:20
@nazarewk:matrix.orgkdnohhh... it just took forever, I'm on 22nd minute and it's building management now12:33:34
@nazarewk:matrix.orgkdnstill running it outside nix build finishes in seconds12:43:02
26 Feb 2025
@diamondburned:matrix.orgDiamond (it/she) a hack would be to make a derivation that copies all of the vendor derivation's files out and then do the transformation 06:54:10
@diamondburned:matrix.orgDiamond (it/she)though I'm like 90% sure Nix has a hook to patch library paths inside programs that specifically do dynimports but I could be wrong?06:54:43
@diamondburned:matrix.orgDiamond (it/she)iirc `autoPatchelfHook` does what you want I think???06:54:50
@lanestolen:matrix.orglanestolen joined the room.12:44:49
1 Mar 2025
@achnazoor:matrix.org@achnazoor:matrix.org left the room.12:44:17
@k900:0upti.meK900 ⚡️Can someone tell me if I did anything wrong on the Go side of https://github.com/NixOS/nixpkgs/pull/38606412:51:52
3 Mar 2025
@qbit:tapenet.org@qbit:tapenet.orglgtm14:25:19
@k900:0upti.meK900 ⚡️Thanks, I got some help from Puck on that :) 14:26:22
@qbit:tapenet.org@qbit:tapenet.orgPuck?14:28:54
@k900:0upti.meK900 ⚡️@puckipedia14:35:27
@k900:0upti.meK900 ⚡️One of the Lix maintainers 14:35:45
@k900:0upti.meK900 ⚡️And bearer of cursed Go knowledge m14:35:55
@k900:0upti.meK900 ⚡️* And bearer of cursed Go knowledge14:36:06
@qbit:tapenet.org@qbit:tapenet.orgah, sweet14:39:05
@sandro:supersandro.deSandro 🐧the go things in there are basic :)23:10:17
5 Mar 2025
@hiengyen:matrix.orgTrungHieu joined the room.03:44:08
@ygt:matrix.org@ygt:matrix.org joined the room.13:31:56
@ygt:matrix.org@ygt:matrix.org Is there a recommended way to deal with projects that don't provide a go.sum when using buildGoModule? 13:36:45
@ygt:matrix.org@ygt:matrix.orgContext: Trying to package https://github.com/deadc0de6/gocatcli13:40:29
@katexochen:matrix.orgPaul Meyer (katexochen)I'd say clone the project, generate the go.sum file, put it beside your nix source (nixpkgs, if you are talking about a package you want to upstream), and copy it into source in postPatch.13:40:51
@katexochen:matrix.orgPaul Meyer (katexochen)But I'd also ask upsteam to lock their dependencies, I say not having a go.sum is really bad practice for a Go project.13:43:33
@ygt:matrix.org@ygt:matrix.orgThank you13:43:45

Show newer messages


Back to Room ListRoom Version: 9