Really just wanted to start nix-bitcoin fan thread. I recently switched my node over to a nixos machine and was able to get a second node running in a container on it really fast. It wasn't painless but man I'm really enjoying using nixos.
Here's some things I used to get it going:
Here's a snippet you can use to override the default CLN package version to get the most up to date version.
services.clightning = { enable = true; package = pkgs.clightning.overrideAttrs ( orig: let version = "v23.02rc3"; in { version = version; src = pkgs.fetchFromGitHub { owner = "ElementsProject"; repo = "lightning"; rev = "${version}"; fetchSubmodules = true; sha256 = "sha256-xGttepiu6ds9+kUhUX+WavUs1yJ9V461SgMv+mWMzcE="; }; configureFlags = [ "--enable-developer" "--disable-valgrind" "--enable-experimental-features" ]; makeFlags = [ "VERSION=${version}" ]; });
I'm no linux pro, but I just switched to nixos myself and am thinking about running a node. I have to admit nixos confused the hell out of me for two weeks. Do you know a source for a good sample configuration.nix file? I feel like I modified mine so much I need to start over.
reply
went ahead and put mine up here; it uses flakes, which i'm still getting comfy with
reply
Thanks. Flakes, huh? I have to crawl before I can walk!
reply
also fwiw working on getting some nix workshops put together for bitcoin++ in Austin, hoping to have some good how-tos to feature there soon!
reply
That sounds great.
reply
My next node is going to be a Nuc with mirrored SATA M.2 drives using ZFS using NixOS. The documentation at OpenZFS is fantastic for setting up your own NixOS install on ZFS for the base filesystem. I'm still deciding if I'll do a immutable filesystem or not.
I love using ZFS for the auto snapshots in case any data needs to be recovered and auto scrubs for warning you in advance if a drive is failing.
If you are keeping BTC on the node or looking up addresses, don't forget about full disk encryption in case of theft. There is documentation of full disk encryption in the ZFS install guide and a way to unlock the system remotely over Tor in another guide.
reply
wen Guix
reply
Thanks for this info! Yes, NixOS is great! I switched over from Arch several months ago.
Is your clightning container connected to the stable or unstable branch?
reply
Once I got the configuration squared away, I really started to like the motivation behind nix-bitcoin.
I haven't really strayed too far from the basic set up, and the prospect of building my own packages/modules for nix-bitcoin is still pretty intimidating.
Compared to running a raspiblitz, I like nix-bitcoin much better, if for nothing else than the infinitely saner declarative upgrade process.
reply
yeah it's great! we're going to have at least one talk on nix at bitcoin++ in Austin this April, hoping it'll be on how to package things up (unsure about what speaker wants to cover tho)
reply
Is the Nixos Machine like Raspberry?
reply
it's basically a declarative way of writing up machine configuration, including every package that you download/install
as others have mentioned the startup/learning curve is really steep but once you've got a working machine config you've basically documented how to completely setup your machine -- makes it really easy to try new things and roll back!
reply
It is similar to a node-in-a-box distribution, like raspiblitz or umbrel in that you can just "turn on" features and know that they are well-tested and play well with other features. But it's a steeper learning curve to setting up the machine and configuring the features.
reply
Solid code
reply
I tried to do this and got zero support so I gave up
reply
To tell the truth, the Matrix channel has been extremely helpful. I've never been turned away for even the most basic questions
reply
reply
it's pretty hard to get going, and the tutorials etc were all over the place -- @nothingmuch had to walk me through getting mine set up :3
reply
Yeah I think if I had time I could figure it out but fiat mining takes so much time.
deleted by author
reply
You could give the Sovran Pro a try https://sovransystems.com. Works out of the box!
reply
Run, node, run!
reply
Nix sure is promising with its declarative approach.
reply
It's great not to be alone :) Same boat here. We update our progress on GitHub #MYBONK