Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
naturallaw777 opened this issue Aug 20, 2024 · 8 comments
Open

Comments

@naturallaw777
Copy link

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
Copy link
Author

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
Copy link

jurraca commented Sep 7, 2024

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

@noblepayne
Copy link

noblepayne commented Sep 11, 2024

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
Copy link

noblepayne commented Sep 16, 2024

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
Copy link
Author

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
Copy link
Author

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.

@itstomekk
Copy link
Contributor

Hey @noblepayne @jurraca @naturallaw777 , what would it take to get Alby Hub to Nix's official package repo?

@jurraca
Copy link

jurraca commented Jan 9, 2025

It would take settling on an expression we can work with and submitting it, then getting someone to merge it :) .

Probably best to set up two packages, UI and server. I was going to suggest attempting to get rid of the autoPatchElf stuff and linking them explicitly, but it seems a bunch of packages use autoPatchElf so maybe it's not an issue.

I've been using @noblepayne 's flake here and it works great. So if the goal is "get Alby to Nix users", they're just one nix flake build noblepayne/alby-hub-flake#albyHub away from getting it already. The work may just be getting that flake to track dev more closely. Given Hub is under active dev, this may make more sense that having a package in Nixpkgs that ends up out of date continually.

Finally, I'd love to see the package in nix-bitcoin, which would require getting a module done to set up configuration. I've very roughly started looking at this here.

Edit: opened a PR for a nixOS module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants