added and connected bitcoin core system module

This commit is contained in:
Bryan Ramos 2024-05-13 16:22:26 -04:00
parent 553961b831
commit 1fe6ccb729
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
4 changed files with 83 additions and 10 deletions

View file

@ -2,7 +2,7 @@
{ system.stateVersion = "23.11";
imports = [ ../modules ];
imports = [ ../../modules ];
users.users = {
${config.user.name} = {

View file

@ -0,0 +1,68 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.system.bitcoin;
version = "27.0";
home = /var/lib/bitcoind;
#conf = pkgs.writeText "bitcoin.conf" (import ./config);
in
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
config = mkIf cfg.enable {
#nixpkgs.overlays = [
# (final: prev: {
# bitcoind = prev.bitcoind.overrideAttrs (old: {
# src = fetchTarball {
# url = ''
# https://bitcoincore.org/bin/bitcoin-core-${version}/bitcoin-${version}-x86_64-linux-gnu.tar.gz
# '';
# sha256 = ''
# sha256-05i4zrdwr2rnbimf4fmklbm1mrvxg1bnv3yrrx44cp66ba0nd3jg
# '';
# };
# });
# })
#];
users = {
users = {
"bitcoind" = {
inherit home;
description = "bitcoind system user";
isSystemUser = true;
group = "bitcoin";
createHome = true;
};
};
#groups = {
# "bitcoin" = {
# members = [
# ];
# };
#};
};
networking.firewall.allowedTCPPorts = [ 8333 ];
services.bitcoind = {
"bitcoind" = {
enable = true;
user = "bitcoind";
group = "bitcoin";
#configFile = conf;
rpc = {
port = 8332;
#users = {
# config.user.name = {
# passwordHMAC = "";
# };
#};
};
};
};
};
}

View file

@ -0,0 +1,5 @@
{
imports = [
./bitcoin
];
}