!QCCCSJHEsTIfozrZxz:nixos.org

Nix + Go

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

You have reached the beginning of time (for this room).


SenderMessageTime
24 Feb 2025
@raboof:matrix.org@raboof:matrix.org left the room.12:22:38
@diamondburned:matrix.orgdiamond (it/its) you can add a new flake input just for nixpkgs/nixos-unstable as like nixpkgs-unstable then do
let
  unstable = nixpkgs-unstable.legacyPackages.<ARCH>;
  buildGo124Module = unstable.buildGoModule.override { go = unstable.go_1_24; };
in
...
19:32:32
@galaxyyy:matrix.orgSaturn changed their profile picture.22:36:36
25 Feb 2025
@gigahawk:matrix.orggigahawk joined the room.08:25:44
@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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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:16
@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/its) 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

Show newer messages


Back to Room ListRoom Version: 9