This commit is contained in:
jeirmeister 2025-09-12 14:51:37 -07:00
parent cd9bf22f71
commit 4ae77a04d3

View file

@ -1,13 +1,11 @@
{
description = "BTCPay server, NBXplorer, Bitcoin Core, etc. as a NixOS system/container image with disko";
description = "BTCPay server, NBXplorer, Bitcoin Core, etc. as a NixOS system/container image";
inputs = {
nix-bitcoin.url = "github:fort-nix/nix-bitcoin/release";
nixpkgs.follows = "nix-bitcoin/nixpkgs";
nixos-generators.url = "github:nix-community/nixos-generators";
flake-utils.url = "github:numtide/flake-utils";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
@ -16,7 +14,6 @@
nix-bitcoin,
nixos-generators,
flake-utils,
disko,
...
}: let
system = "x86_64-linux";
@ -26,7 +23,6 @@
inherit system;
modules = [
nix-bitcoin.nixosModules.default
disko.nixosModules.default
({
config,
pkgs,
@ -37,82 +33,11 @@
nix-bitcoin.generateSecrets = true;
disko.devices = {
disk.root = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
bios_boot = {
size = "2M";
type = "EF02"; # BIOS boot partition (unformatted)
content = null; # No filesystem
};
ESP = {
# Optional for hybrid, but harmless
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg.root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = ["defaults"];
};
};
};
};
disk.data = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
data = {
size = "100%";
type = "8300";
content = {
type = "filesystem";
format = "xfs";
mountpoint = "/var/lib/bitcoind";
mountOptions = ["noatime"];
};
};
};
};
};
};
boot.loader = {
grub = {
enable = true;
device = "/dev/sda"; # Install only on sda (avoids sdb)
useOSProber = false; # Don't scan other disks
device = "/dev/sda"; # Targets only root disk
useOSProber = false;
};
};