diff --git a/flake.lock b/flake.lock index c1406a7..ef05fd9 100644 --- a/flake.lock +++ b/flake.lock @@ -23,6 +23,28 @@ "type": "github" } }, + "btc": { + "inputs": { + "extra-container": "extra-container", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" + }, + "locked": { + "lastModified": 1723533469, + "narHash": "sha256-8gSsZpYmOzwFRaLIX0OMBvV/+SATmu/O9QXkDgsZlIg=", + "owner": "fort-nix", + "repo": "nix-bitcoin", + "rev": "6e208d6a7b554be592167f6ecad9b16c0abf96d7", + "type": "github" + }, + "original": { + "owner": "fort-nix", + "ref": "release", + "repo": "nix-bitcoin", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -108,6 +130,31 @@ "type": "github" } }, + "extra-container": { + "inputs": { + "flake-utils": [ + "btc", + "flake-utils" + ], + "nixpkgs": [ + "btc", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722175938, + "narHash": "sha256-HKyB4HD+NdX3T233bY31hm76v3/tdQBNeLLvopKbZeY=", + "owner": "erikarvstedt", + "repo": "extra-container", + "rev": "37e7207ac9f857eedb58b208b9dc91cd6b24e651", + "type": "github" + }, + "original": { + "owner": "erikarvstedt", + "repo": "extra-container", + "type": "github" + } + }, "flake-compat": { "locked": { "lastModified": 1696426674, @@ -264,6 +311,24 @@ "type": "github" } }, + "flake-utils_4": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "git-hooks": { "inputs": { "flake-compat": "flake-compat_2", @@ -545,7 +610,39 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1723221148, + "narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "154bcb95ad51bc257c2ce4043a725de6ca700ef6", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { + "locked": { + "lastModified": 1723282977, + "narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1723175592, "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", @@ -601,7 +698,7 @@ "git-hooks": "git-hooks", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -627,7 +724,7 @@ "git-hooks": "git-hooks_2", "home-manager": "home-manager_3", "nix-darwin": "nix-darwin_2", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix_2" }, @@ -663,7 +760,7 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixvimunstable", "nixpkgs" @@ -686,8 +783,9 @@ "root": { "inputs": { "agenix": "agenix", + "btc": "btc", "darwin": "darwin_2", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "hm": "hm", "hmunstable": "hmunstable", "nix23_05": "nix23_05", @@ -759,6 +857,21 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -804,7 +917,7 @@ "wsl": { "inputs": { "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_3", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixunstable" ] diff --git a/flake.nix b/flake.nix index b9aa43e..f6ce48c 100644 --- a/flake.nix +++ b/flake.nix @@ -9,6 +9,9 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixunstable"; }; + btc = { + url = "github:fort-nix/nix-bitcoin/release"; + }; darwin = { url = "github:lnl7/nix-darwin/master"; inputs.nixpkgs.follows = "nixunstable"; diff --git a/hosts/genesis/default.nix b/hosts/genesis/default.nix index 5f98195..860a288 100644 --- a/hosts/genesis/default.nix +++ b/hosts/genesis/default.nix @@ -34,7 +34,6 @@ networking.hostName = "genesis"; # Define your hostname. environment.systemPackages = with pkgs; [ awscli2 - btrfs-progs create_ssl step-ca ]; diff --git a/hosts/hosea/bitcoin.nix b/hosts/hosea/bitcoin.nix new file mode 100644 index 0000000..5c81703 --- /dev/null +++ b/hosts/hosea/bitcoin.nix @@ -0,0 +1,47 @@ +{ config, ... }: + +let + ip = "100.68.203.1"; +in { + nix-bitcoin = { + generateSecrets = true; + operator = { + enable = true; + name = "greg"; + }; + useVersionLockedPkgs = true; # Use the exact versions of packages from upstream + }; + + networking.firewall.allowedTCPPorts = with config.services; [ + bitcoind.port + bitcoind.rpc.port + mempool.frontend.port + ]; + + services = { + bitcoind = { + enable = true; + address = "0.0.0.0"; + dataDir = "/chain/bitcoind"; + listen = true; + rpc = { + address = ip; + allowip = [ + "100.1.1.1/8" + ]; + }; + }; + clightning.enable = true; + electrs = { + enable = true; + address = ip; + }; + mempool = { + enable = true; + frontend = { + enable = true; + address = ip; + }; + }; + }; +} diff --git a/hosts/hosea/default.nix b/hosts/hosea/default.nix index 9a37af7..9c2ecd1 100644 --- a/hosts/hosea/default.nix +++ b/hosts/hosea/default.nix @@ -13,10 +13,10 @@ in imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ./minio.nix + inputs.btc.nixosModules.default + ./bitcoin.nix ]; - # Bootloader boot = { loader = { diff --git a/hosts/hosea/hardware-configuration.nix b/hosts/hosea/hardware-configuration.nix index b2bc54d..6473eef 100644 --- a/hosts/hosea/hardware-configuration.nix +++ b/hosts/hosea/hardware-configuration.nix @@ -24,6 +24,11 @@ fsType = "vfat"; }; + fileSystems."/chain" = { + device = "/dev/sda1"; + fsType = "xfs"; + }; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/hosts/hosea/minio.nix b/hosts/hosea/minio.nix deleted file mode 100644 index 12f3c99..0000000 --- a/hosts/hosea/minio.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ config, pkgs, ... }: - -let - minioPort = 9000; - minioConsolePort = 9001; -in { - fileSystems."/proxy" = { - device = "/dev/sda1"; - fsType = "btrfs"; - }; - - networking.firewall.allowedTCPPorts = [ - 80 - minioPort - minioConsolePort - ]; - - age.secrets.minio.file = ../../secrets/minio.age; - - services.minio = { - enable = true; - dataDir = [ "/proxy/minio" ]; - rootCredentialsFile = config.age.secrets.minio.path; - browser = true; - }; - - greg.proxies."s3.thehellings.lan".target = "http://127.0.0.1:${toString minioPort}"; - - environment.systemPackages = with pkgs; [ - minio-client - ]; -} diff --git a/hosts/jeremiah/default.nix b/hosts/jeremiah/default.nix index e3754a6..c9c33c9 100644 --- a/hosts/jeremiah/default.nix +++ b/hosts/jeremiah/default.nix @@ -55,7 +55,6 @@ tailscale.enable = true; }; environment.systemPackages = with pkgs; [ - btrfs-progs curl gawk git diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 4bbe0f1..cb605fa 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -27,11 +27,13 @@ in { environment.sessionVariables.MOZ_ENABLE_WAYLAND = "0"; environment.systemPackages = with pkgs; [ + btrfs-progs coreutils-full efibootmgr psmisc lshw usbutils + xfsprogs ]; system.stateVersion = "24.05";