Reusable NixOS modules and home-manager bundles for a bitcoin developer workstation. Curated dev tooling, sshd hardening, docker, keyd, YubiKey support, an opinionated nixvim/tmux/starship/git setup, and a cross-platform Bitcoin Core dev-shell.
Alpha. The public API may change.
nixosModules.default— the "just works" entry point. Imports home-manager and wires the developer user with the fullhomeManagerModules.defaultbundle when the workstation preset is enabled.nixosModules.workstation— the bare workstation preset. Typed options (services.workstation.user,timeZone,locale,extraPackages), curated dev tools, sshd hardening, docker rootless, keyd caps→esc, YubiKey support. No home-manager wiring.nixosModules.hetzner-ax102— bootloader andnetwork-onlineworkarounds for Hetzner AX102 bare metal.homeManagerModules.default— composed bundle: nixvim + terminal (tmux/starship/zoxide/direnv) + git, plus a few extra packages.homeManagerModules.{nixvim, terminal, git}— individual tiers.devShells.<system>.bitcoin-core— Bitcoin Core development environment. Available onx86_64-linuxandaarch64-darwin.templates.default— workstation deployment scaffold.templates.bitcoin-core— Bitcoin Core dev-shell scaffold (flake + .envrc + justfile).lib.mkWorkstationVMTest— VM-based smoke test againstnixosModules.workstation, parameterizable for downstream consumers.
Add nix-dev-server to your flake inputs:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
nix-dev-server.url = "github:2140-dev/nix-dev-server";
nix-dev-server.inputs.nixpkgs.follows = "nixpkgs";
};Import nixosModules.default (and an env preset, if applicable):
{
imports = [
nix-dev-server.nixosModules.default
nix-dev-server.nixosModules.hetzner-ax102
];
services.workstation = {
enable = true;
user = {
name = "alice";
sshKeys = [
"ssh-ed25519 AAAA... alice@laptop"
];
};
};
}That's the whole deployment: dev tools, sshd, docker, keyd, YubiKey,
and the home-manager bundle (nixvim + tmux/starship + git) wired for
alice.
A working scaffold with FIXME markers is available via:
nix flake init -t github:2140-dev/nix-dev-server
If you manage home-manager out of band (or want a different
per-developer configuration), use nixosModules.workstation instead.
The preset asserts nothing about home-manager and leaves user-level
configuration to you.
{
imports = [
home-manager.nixosModules.home-manager
nix-dev-server.nixosModules.workstation
];
services.workstation = {
enable = true;
user.name = "alice";
user.sshKeys = [ ... ];
};
home-manager.users.alice = {
# your own composition — pick from
# nix-dev-server.homeManagerModules.{nixvim, terminal, git}
# or roll your own.
};
}Use the dev-shell directly without setting up a workstation:
# in your bitcoin clone:
echo "use flake github:2140-dev/nix-dev-server#bitcoin-core" > .envrc
direnv allowOr scaffold a local flake (with a pinnable flake.lock) and a Bitcoin
Core build justfile:
nix flake init -t github:2140-dev/nix-dev-server#bitcoin-core
direnv allow
just --list
The shell ships clang+mold, cmake+ninja, gdb, the python deps used by the functional tests, and (on Linux) bcc/bpftrace/systemtap for the USDT test runner.
nix flake check
runs workstation-vm: boots a NixOS VM with the workstation preset
enabled and asserts the developer user has the expected groups and the
core services (sshd, keyd) come up.
Downstream consumers can run the same test against their own configuration:
checks.x86_64-linux.workstation = nix-dev-server.lib.mkWorkstationVMTest {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraModules = [ ./my-workstation.nix ];
};MIT. See LICENSE.