diff --git a/src/system/machines/server/system.nix b/src/system/machines/server/system.nix index d51a636..39b03c0 100644 --- a/src/system/machines/server/system.nix +++ b/src/system/machines/server/system.nix @@ -10,11 +10,13 @@ }; }; + users.mutableUsers = false; users.users = { ${config.user.name} = { isNormalUser = true; extraGroups = config.user.groups; openssh.authorizedKeys.keys = [ "${config.user.sshKeys.key1}" ]; + initialPassword = "123"; }; }; diff --git a/src/system/modules/bitcoin/default.nix b/src/system/modules/bitcoin/default.nix index 184bdc4..6d7f3d1 100644 --- a/src/system/modules/bitcoin/default.nix +++ b/src/system/modules/bitcoin/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, autoreconfHook, ... }: +{ pkgs, lib, config, ... }: with lib; let @@ -13,30 +13,21 @@ in config = mkIf cfg.enable { nixpkgs.overlays = [ (final: prev: { - bitcoind = prev.stdenv.mkDerivation rec { - pname = "bitcoind"; + bitcoind = prev.bitcoind.overrideAttrs (old: { version = "27.0"; - src = fetchTarball { - url = "https://bitcoincore.org/bin/bitcoin-core-${version}/bitcoin-${version}-x86_64-linux-gnu.tar.gz"; - sha256 = "sha256-T45mgVrGXEZIz9mPbVd4feca6qKzOuJqXDaLzFv+JBY="; + url = "https://github.com/bitcoin/bitcoin/archive/refs/tags/v${version}.tar.gz"; + sha256 = "sha256-U2tR3WySD3EssA3a14wUtA3e0t/5go0isqNZSSma7m4="; }; - - phase = [ "unpackPhase" "installPhase" ]; - - installPhase = '' - mkdir -p $out/bin - cp bin/* $out/bin - ''; - }; + }); }) ]; users = { users = { - "bitcoind" = { + "btc" = { inherit home; - description = "bitcoind system user"; + description = "Bitcoin Core system user"; isSystemUser = true; group = "bitcoin"; createHome = true; @@ -45,29 +36,24 @@ in groups = { "bitcoin" = { members = [ - "bitcoind" + "btc" ]; }; }; }; + programs.bash.shellAliases = { + btc = "bitcoind"; + }; + networking.firewall.allowedTCPPorts = [ 8333 ]; services.bitcoind = { - "bitcoind" = { + "btc" = { enable = true; - user = "bitcoind"; + user = "btc"; group = "bitcoin"; configFile = conf; - - rpc = { - port = 8332; - #users = { - # config.user.name = { - # passwordHMAC = ""; - # }; - #}; - }; }; }; };