.
This commit is contained in:
parent
cd9bf22f71
commit
4ae77a04d3
1 changed files with 3 additions and 78 deletions
81
flake.nix
81
flake.nix
|
|
@ -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 = {
|
inputs = {
|
||||||
nix-bitcoin.url = "github:fort-nix/nix-bitcoin/release";
|
nix-bitcoin.url = "github:fort-nix/nix-bitcoin/release";
|
||||||
nixpkgs.follows = "nix-bitcoin/nixpkgs";
|
nixpkgs.follows = "nix-bitcoin/nixpkgs";
|
||||||
nixos-generators.url = "github:nix-community/nixos-generators";
|
nixos-generators.url = "github:nix-community/nixos-generators";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
disko.url = "github:nix-community/disko";
|
|
||||||
disko.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
|
@ -16,7 +14,6 @@
|
||||||
nix-bitcoin,
|
nix-bitcoin,
|
||||||
nixos-generators,
|
nixos-generators,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
disko,
|
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
@ -26,7 +23,6 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules = [
|
||||||
nix-bitcoin.nixosModules.default
|
nix-bitcoin.nixosModules.default
|
||||||
disko.nixosModules.default
|
|
||||||
({
|
({
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
|
@ -37,82 +33,11 @@
|
||||||
|
|
||||||
nix-bitcoin.generateSecrets = true;
|
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 = {
|
boot.loader = {
|
||||||
grub = {
|
grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
device = "/dev/sda"; # Install only on sda (avoids sdb)
|
device = "/dev/sda"; # Targets only root disk
|
||||||
useOSProber = false; # Don't scan other disks
|
useOSProber = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue