getAlby / hub

Alby Hub - Your own lightning node connected to every app. Run anywhere. Become self-sovereign.
https://albyhub.com
Apache License 2.0
93 stars 18 forks source link

Feature add: An Official NixOS Flake Implementation for Alby Hub #519

Open naturallaw777 opened 2 months ago

naturallaw777 commented 2 months ago

Hello Everyone at Alby!

I think it would be great if Alby Hub had a NixOS Flake Implementation (packages and modules).

Just like LNBits does with their project. https://github.com/lnbits/lnbits

What are the teams thoughts on this?

I also started a Matrix chat regarding this topic here:
https://matrix.to/#/#New_Features_Ideas_Devs:anarchyislove.xyz.

Thanks so much!

naturallaw777 commented 2 months ago

I got Alby Hub ported over to NixOS as the base package. I am waiting on the team to not require an Alby.com account to use Alby Hub.

jurraca commented 1 month ago

I got the http-server part building here. not pretty but it builds. you got the wails desktop build working @naturallaw777 ?

noblepayne commented 1 month ago

In case it is helpful for the combined effort, here is another take on nix packages for Alby Hub. Both server and desktop/wails builds are working enough to launch and display the UI on a Linux system; I have not done any significant testing beyond that. Neither are polished, but the wails build is especially MVP (PRs welcome).

noblepayne commented 1 month ago

I am waiting on the team to not require an Alby.com account to use Alby Hub.

@naturallaw777 looks like this was accomplished with v1.8.0:

Finally, the Alby Account is now optional

naturallaw777 commented 3 weeks ago

I got the http-server part building here. not pretty but it builds. you got the wails desktop build working @naturallaw777 ?

I apologize for the late response. I am not on Github that much.

Okay, great. I did not get that much detail in my default.nix. So thank you.

I will just post mine here just for reference.

I have not tested it for the newest version.

{ 

lib,

stdenv, 

fetchurl, 

autoPatchelfHook,

}:

stdenv.mkDerivation rec {
    pname = "Alby Hub";
    version = "1.6.0";

    src = fetchurl {
        url = "https://github.com/getAlby/hub/releases/download/v${version}/albyhub-Server-Linux-x86_64.tar.bz2";
        hash = "sha256-nDrrAWAIWbGTHbTMinLMyQV33UkNCR0o+zrOMvigasw=";
    };

sourceRoot = ".";

nativeBuildInputs = [
    autoPatchelfHook
];

buildInputs = [
  stdenv.cc.cc.lib
];

preBuild = ''
    addAutoPatchelfSearchPath ./lib
'';

installPhase = ''
    mkdir -p $out/lib/albyhub

    runHook preInstall
  install -m755 -D ./bin/albyhub $out/bin/albyhub
    install -m755 -D ./lib/* $out/lib/albyhub
  runHook postInstall

    '';

meta = with lib; {
    description = "Alby Hub - Your own lightning node connected to every app";
    license = licenses.asl20;
    maintainers = with maintainers; [ ];
    homepage = "https://github.com/getAlby/hub";
};

}
naturallaw777 commented 3 weeks ago

In case it is helpful for the combined effort, here is another take on nix packages for Alby Hub. Both server and desktop/wails builds are working enough to launch and display the UI on a Linux system; I have not done any significant testing beyond that. Neither are polished, but the wails build is especially MVP (PRs welcome).

Thank you. I will have to take some time to look this over.