From c8570c23cec32683906154bf71947ffeb623a8d8 Mon Sep 17 00:00:00 2001 From: jeirmeister Date: Fri, 15 Aug 2025 09:23:31 -0700 Subject: [PATCH] Working, more modular approach to btcpay server. Next upgrade will be setting up the flake configuration for multiple hosts in order to separate the bitcoind and payserver applications --- flake.lock | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++---- flake.nix | 13 +++++---- justfile | 7 +++-- 3 files changed, 90 insertions(+), 14 deletions(-) diff --git a/flake.lock b/flake.lock index ba44e0e..d1aa310 100644 --- a/flake.lock +++ b/flake.lock @@ -44,10 +44,28 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nix-bitcoin": { "inputs": { "extra-container": "extra-container", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" }, @@ -66,6 +84,40 @@ "type": "github" } }, + "nixlib": { + "locked": { + "lastModified": 1736643958, + "narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1751903740, + "narHash": "sha256-PeSkNMvkpEvts+9DjFiop1iT2JuBpyknmBUs0Un0a4I=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "032decf9db65efed428afd2fa39d80f7089085eb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1750969886, @@ -100,24 +152,29 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1752620740, - "narHash": "sha256-f3pO+9lg66mV7IMmmIqG4PL3223TYMlnlw+pnpelbss=", + "lastModified": 1736657626, + "narHash": "sha256-FWlPMUzp0lkQBdhKlPqtQdqmp+/C+1MBiEytaYfrCTY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "32a4e87942101f1c9f9865e04dc3ddb175f5f32e", + "rev": "2f9e2f85cb14a46410a1399aa9ea7ecf433e422e", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-25.05", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { + "flake-utils": "flake-utils", "nix-bitcoin": "nix-bitcoin", - "nixpkgs": "nixpkgs_2" + "nixos-generators": "nixos-generators", + "nixpkgs": [ + "nix-bitcoin", + "nixpkgs" + ] } }, "systems": { @@ -134,6 +191,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ad7519b..9b67b69 100644 --- a/flake.nix +++ b/flake.nix @@ -28,16 +28,17 @@ system.stateVersion = "25.05"; # services.btcpay-full.enable = true; users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAaV7JtUWkWrjo5FfCcpTCCEY/OJ+T1mJOLbe4avg0XH sysadmin@skrybit.io" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPs/pdZLlCbv0vgtFA4hHGuWz1EeSn2kKhBJthlZ5lww devnix" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDw6ilma4321EdQvguZKA7ijn9xF9QlfMfkES4bGCLTp jeirmeister@devnix-t470" ]; # networking.firewall.allowedTCPPorts = [ # 23002 # 22 - # # 24444 - # # 8332 - # # 5432 - # # 28332 - # # 28333 + # 24444 + # 8332 + # 5432 + # 28332 + # 28333 # ]; networking.firewall.allowedTCPPorts = [ config.services.btcpayserver.port diff --git a/justfile b/justfile index 21d4563..f3bb369 100644 --- a/justfile +++ b/justfile @@ -1,10 +1,13 @@ REMOTE_HOST := "root@10.1.1.163" +rebuild: + nixos-rebuild switch --flake .#btc-pay-server --extra-experimental-features 'nix-command flakes' + build: - nix build .#nixosConfigurations.btcpay.config.system.build.toplevel + nix build .#nixosConfigurations.btc-pay-server.config.system.build.toplevel deploy: - nixos-rebuild switch --flake .#btcpay --target-host {{REMOTE_HOST}} --option experimental-features "nix-command flakes" + nixos-rebuild switch --flake .#btc-pay-server --target-host {{REMOTE_HOST}} --option experimental-features "nix-command flakes" status: ssh {{REMOTE_HOST}} "systemctl status bitcoind btcpayserver"