How do I get uwsgi with https (libssl) support on nix?

The standard version of uwsgi in nixpkgs does not have https (libssl) support enabled and thus does not know the uwsgi --https option.

Usually plugins would be enabled through an override, like so:

{
  pkgs ? import (builtins.fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/23.05.tar.gz";
    sha256 = "10wn0l08j9lgqcw8177nh2ljrnxdrpri7bp0g7nvrsn9rkawvlbf";
  }) {
    config = {};
    overlays = [
      (final: prev: {
        uwsgi = prev.uwsgi.override {
          plugins = [ "python3" ];
        };
      })
    ]; 
  }
}: pkgs.mkShell { ...}

but the nix-expression does not offer an argument to enable https support. Any help on how to get an uwsgi server with https?

1 Like

in addition to your existing override, I think you can use overrideAttrs to append openssl (or maybe libressl?) to the buildinputs and then maybe append something like echo "ssl = true" >> buildconf/nixos.ini to the configurePhase

1 Like

Thanks @abathur. I can confirm that adding openssl to the buildInputs and putting ssl = true in nixos.ini actually enables https in uwsgi.

Btw. I also noticed that adding "python3¨ to the plugins list strangely doesn’t actually enable the uwsgi python plugin, so I think the packaging is broken. I reported the issue and suggested a solution.

1 Like

I do see basePlugins = "python"; in an expression where I must’ve run into the same sharp corner. I agree with you that having to jump both hoops seems like a problem unless there’s some reason it isn’t feasible.

1 Like