fixed bitcoin core? added test pass

This commit is contained in:
Bryan Ramos 2024-05-13 22:59:51 -04:00
parent c4aaf582c6
commit 10c4a97fe1
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
2 changed files with 16 additions and 28 deletions

View file

@ -10,11 +10,13 @@
}; };
}; };
users.mutableUsers = false;
users.users = { users.users = {
${config.user.name} = { ${config.user.name} = {
isNormalUser = true; isNormalUser = true;
extraGroups = config.user.groups; extraGroups = config.user.groups;
openssh.authorizedKeys.keys = [ "${config.user.sshKeys.key1}" ]; openssh.authorizedKeys.keys = [ "${config.user.sshKeys.key1}" ];
initialPassword = "123";
}; };
}; };

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, autoreconfHook, ... }: { pkgs, lib, config, ... }:
with lib; with lib;
let let
@ -13,30 +13,21 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
bitcoind = prev.stdenv.mkDerivation rec { bitcoind = prev.bitcoind.overrideAttrs (old: {
pname = "bitcoind";
version = "27.0"; version = "27.0";
src = fetchTarball { src = fetchTarball {
url = "https://bitcoincore.org/bin/bitcoin-core-${version}/bitcoin-${version}-x86_64-linux-gnu.tar.gz"; url = "https://github.com/bitcoin/bitcoin/archive/refs/tags/v${version}.tar.gz";
sha256 = "sha256-T45mgVrGXEZIz9mPbVd4feca6qKzOuJqXDaLzFv+JBY="; sha256 = "sha256-U2tR3WySD3EssA3a14wUtA3e0t/5go0isqNZSSma7m4=";
}; };
});
phase = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p $out/bin
cp bin/* $out/bin
'';
};
}) })
]; ];
users = { users = {
users = { users = {
"bitcoind" = { "btc" = {
inherit home; inherit home;
description = "bitcoind system user"; description = "Bitcoin Core system user";
isSystemUser = true; isSystemUser = true;
group = "bitcoin"; group = "bitcoin";
createHome = true; createHome = true;
@ -45,29 +36,24 @@ in
groups = { groups = {
"bitcoin" = { "bitcoin" = {
members = [ members = [
"bitcoind" "btc"
]; ];
}; };
}; };
}; };
programs.bash.shellAliases = {
btc = "bitcoind";
};
networking.firewall.allowedTCPPorts = [ 8333 ]; networking.firewall.allowedTCPPorts = [ 8333 ];
services.bitcoind = { services.bitcoind = {
"bitcoind" = { "btc" = {
enable = true; enable = true;
user = "bitcoind"; user = "btc";
group = "bitcoin"; group = "bitcoin";
configFile = conf; configFile = conf;
rpc = {
port = 8332;
#users = {
# config.user.name = {
# passwordHMAC = "";
# };
#};
};
}; };
}; };
}; };