# Need help to package slidge-whatsapp

**URL:** https://discourse.nixos.org/t/need-help-to-package-slidge-whatsapp/78883
**Category:** Help
**Created:** [July 12, 2026, 11:31am UTC](https://discourse.nixos.org/t/need-help-to-package-slidge-whatsapp/78883 "2026-07-12T11:31:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mirror](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@mirror](https://discourse.nixos.org/u/mirror)
#### Post date: [July 12, 2026, 11:31am UTC](https://discourse.nixos.org/t/need-help-to-package-slidge-whatsapp/78883/1 "2026-07-12T11:31:21Z")

</div>

> **[slidge-whatsapp](https://codeberg.org/slidge/slidge-whatsapp)**
>
> Whatsapp/XMPP gateway based on Slidge

As a amateur, I am not familiar to package software written in mixed language like this. (python and go). And I have little to zero knowledge in both language.

How do I handle this?

[https://codeberg.org/slidge/slidge-whatsapp/src/commit/2987788ef37fad34532c5466449974bb6fe506ed/build.py#L56-L80](https://codeberg.org/slidge/slidge-whatsapp/src/commit/2987788ef37fad34532c5466449974bb6fe506ed/build.py#L56-L80)

To build the go parts, It requires `gopy` and `goimports` as dependencies.

`goimports` is in the `gotools` packages in nixpkgs.

I am able to package `gopy` by following instructions in nixpkgs manual.

```nix
{
  buildGoModule,
  fetchFromGitHub,
  ...
}:
{
  gopy = buildGoModule (finalAttrs: {
    pname = "gopy";
    version = "master";

    src = fetchFromGitHub {
      owner = "go-python";
      repo = "gopy";
      rev = "72557f647208599c726c14dc9721a6c850d2e6d9";
      hash = "sha256-FSAxadu9ZAX7Ep2wHegIzQcGO8PSCa5b4aPtRrHRnJw=";
    };

    vendorHash = "sha256-J0Xmgk9YGUNkw7q97RgElgAVSZv5HTLDdsPtmaAaXAM=";

    checkFlags =
      let
        skippedTests = [
          # Requires network access (Error: module lookup disabled by GOPROXY=off).
          "TestGovet"

          "TestGofmt"
          "TestGoPyErrors"
        ];
      in
      ["-skip=^${builtins.concatStringsSep "$|^" skippedTests}$"];

    meta = {
      mainProgram = "gopy";
    };
  });
}

```

Manually running the `gopy` command to build go parts seems to work somhow (with some error) in `nix-shell` environment with `gopy` and `gotools` installed. However I do not know how to write it in nix expression to package sligde-whatsapp.

---

<div class="post-metadata">

### Author: ![mightyiam](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mightyiam/32/33998_2.png) [@mightyiam](https://discourse.nixos.org/u/mightyiam)
#### Post date: [July 14, 2026, 6:58am UTC](https://discourse.nixos.org/t/need-help-to-package-slidge-whatsapp/78883/2 "2026-07-14T06:58:59Z")

</div>

Did you make any progress?

---

<div class="post-metadata">

### Author: ![mirror](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@mirror](https://discourse.nixos.org/u/mirror)
#### Post date: [July 14, 2026, 10:31am UTC](https://discourse.nixos.org/t/need-help-to-package-slidge-whatsapp/78883/3 "2026-07-14T10:31:21Z")

</div>

Yesterday I found I can build the package with `devenv` environment with `uv` package and just run `uv build` to build it from source in codeberg easily, then I can get a `.whl` file inside a `dist` folder.

However I cannot able to do it in nix way, as manually running the `gopy build` command in the `build.py` file outside the `uv build` environment do not work. It throws error about something like this: [# github.com/gen2brain/go-fitz | /go/pkg/mod/github.com/gen2brain/go-fitz@v1.18.0/fitz.go:8:10: fatal error: mupdf/fitz.h: No such file or directory · Issue #41 · gen2brain/go-fitz · GitHub](https://github.com/gen2brain/go-fitz/issues/41)

Not only that, doing it in `buildGoModule` don’t work in another way because it do not have internet access i guess because of `GOPROXY=off` issue. Manually setting `GOPROXY` to point to some manually crafted `goModules` also not help.

Today I learned what `.whl` actually is as I don’t know much about python, and I figured out `fetchPypi` can fetch wheel and not the source, so I came up another way to package it.

```nix
{
  fetchPypi,
  python3Packages,
  python3,
  ...
}:
let
  # from pkgs/development/python-modules/clarifai-protocol/default.nix
  pythonVersionNoDot = builtins.replaceStrings ["."] [""] python3.pythonVersion;
in
python3Packages.buildPythonPackage (finalAttrs: {
  pname = "slidge-whatsapp";
  version = "0.3.11";
  format = "wheel";

  src = fetchPypi {
    format = "wheel";
    pname = "slidge_whatsapp";
    version = finalAttrs.version;
    python = "cp${pythonVersionNoDot}";
    abi = "cp${pythonVersionNoDot}";
    dist = "cp${pythonVersionNoDot}";
    platform = "manylinux_2_41_x86_64";
    hash = "sha256-SbnRWbp2xnBg5lSNMUqwZZ0NzLQg+pOg+51LzSFr5bY=";
  };

  propagatedBuildInputs = [
    (import ../slidge)
    (import ../linkpreview)
  ];

  meta = {
    # #...
  };
})

```

I just switch the `src` with my local build `.whl` file.

Dependencies `slidge` and `linkpreview` need to be packaged, which is not hard. I also got help to package `slidge` yesterday here; [Need help for packaging python package (package not installed error)](https://discourse.nixos.org/t/need-help-for-packaging-python-package-package-not-installed-error/78904)

I am now just able to get `./result/bin/slidge-whatsapp` to show some proper help message, but I have to set things up to see if it actually works.

---

<div class="post-metadata">

### Author: ![mirror](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@mirror](https://discourse.nixos.org/u/mirror)
#### Post date: [July 14, 2026, 3:36pm UTC](https://discourse.nixos.org/t/need-help-to-package-slidge-whatsapp/78883/4 "2026-07-14T15:36:59Z")

</div>

Oh just noticed people is packaging matridge and some dependencies are overlapped.

> <https://github.com/NixOS/nixpkgs/pull/527267>
>
> Matridge is a feature-rich Matrix to XMPP gateway:
> https://slidge.im/docs/matri…dge/main/
> 
> \## Things done
> 
> 
> 
> \- Built on platform:
> - \[x\] x86\_64-linux
> - \[\] aarch64-linux
> - \[\] x86\_64-darwin
> - \[\] aarch64-darwin
> \- Tested, as applicable:
> - \[\] \[NixOS tests\] in \[nixos/tests\].
> - \[\] \[Package tests\] at \`passthru.tests\`.
> - \[\] Tests in \[lib/tests\] or \[pkgs/test\] for functions and "core" functionality.
> \- \[\] Ran \`nixpkgs-review\` on this PR. See \[nixpkgs-review usage\].
> \- \[x\] Tested basic functionality of all binary files, usually in \`./result/bin/\`.
> \- Nixpkgs Release Notes
> - \[\] Package update: when the change is major or breaking.
> \- NixOS Release Notes
> - \[\] Module addition: when adding a new NixOS module.
> - \[\] Module update: when the change is significant.
> \- \[x\] Fits \[CONTRIBUTING.md\], \[pkgs/README.md\], \[maintainers/README.md\] and other READMEs.
> \- \[x\] Follows the \[automation/AI policy\].
> 
> \[NixOS tests\]: https://nixos.org/manual/nixos/unstable/index.html#sec-nixos-tests
> \[Package tests\]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-tests
> \[nixpkgs-review usage\]: https://github.com/Mic92/nixpkgs-review#usage
> 
> \[CONTRIBUTING.md\]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md
> \[automation/AI policy\]: https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy
> \[lib/tests\]: https://github.com/NixOS/nixpkgs/blob/master/lib/tests
> \[maintainers/README.md\]: https://github.com/NixOS/nixpkgs/blob/master/maintainers/README.md
> \[nixos/tests\]: https://github.com/NixOS/nixpkgs/blob/master/nixos/tests
> \[pkgs/README.md\]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md
> \[pkgs/test\]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/test

---

<div class="post-metadata">

### Author: ![mirror](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@mirror](https://discourse.nixos.org/u/mirror)
#### Post date: [July 16, 2026, 10:09am UTC](https://discourse.nixos.org/t/need-help-to-package-slidge-whatsapp/78883/5 "2026-07-16T10:09:09Z")

</div>

Solved.  
To build from source instead of wheel, `gopy` need to be patch to use `-mod=vendor` instead of hardcoded `-mod=mod`.  
Had some basic test it seems working. But still need to deploy to production environment to test thing out.  
Will submit PR when its dependency slidge is merged.
