Upgrading to config version 0.2.0
Unstable NixOS base
bitcoinix now bases its systems and packages on unstable nixpkgs only. The single
nixpkgs input tracks nixos-unstable; remove any follows declarations targeting
bitcoinix/nixpkgs-unstable. Continue following bitcoinix/nixpkgs for your node.
The system itself must be evaluated with unstable nixpkgs, regardless of
nix-bitcoin.useVersionLockedPkgs. NixOS 26.05 evaluation fails before migration
assertions run, even without I2P or namespace isolation, with an error such as
The option `services.i2pd.checkConfig' does not exist.
Switch your system’s nixpkgs input to unstable before evaluating this release.
If your system follows bitcoinix/nixpkgs, as the deployment examples do, updating
bitcoinix moves the whole OS from NixOS 26.05 to unstable, not only service packages.
PostgreSQL 14 removed
nixos-unstable has removed PostgreSQL 14. If you don’t set services.postgresql.package,
NixOS selects PostgreSQL by system.stateVersion, and with a stateVersion from 22.05
through 23.05 that was PostgreSQL 14. Then your PostgreSQL databases, such as those of
BTCPay Server and NBXplorer, are in PostgreSQL 14, and bitcoinix 0.2.0 fails evaluation.
This also happens if you set services.postgresql.package = pkgs.postgresql_14;.
Check the running version as root with
runuser -u postgres -- psql -tAc 'SHOW server_version'.
Upgrade the databases before you update bitcoinix, while the node still has
PostgreSQL 14. The steps follow
Upgrading
in the NixOS manual, but run the commands as root with runuser, which works without
sudo. With the secure-node preset, sudo is only an alias for doas.
-
Back up the databases, see Backups.
-
Add this to your configuration and deploy it with your current bitcoinix version:
environment.systemPackages = [ (let cfg = config.services.postgresql; newPostgres = pkgs.postgresql_17.withPackages cfg.extensions; newData = "/var/lib/postgresql/${newPostgres.psqlSchema}"; # Add the other services that use PostgreSQL units = lib.optionals config.services.btcpayserver.enable [ "btcpayserver" "nbxplorer" ] ++ [ "postgresql" ]; # initdb turns data checksums off by default before PostgreSQL 18, # which added this flag and turns them on noChecksums = lib.optionalString (lib.versionAtLeast newPostgres.psqlSchema "18") "--no-data-checksums"; in pkgs.writeScriptBin "upgrade-pg-cluster" '' set -eux export NEWDATA="${newData}" export NEWBIN="${newPostgres}/bin" export OLDDATA="${cfg.dataDir}" export OLDBIN="${cfg.finalPackage}/bin" if [ -e "$NEWDATA" ]; then echo "$NEWDATA exists. Leave it intact and set newData to a new dir." >&2 exit 1 fi # pg_upgrade requires the new cluster to match the old data checksum setting case $(runuser -u postgres -- "$OLDBIN/psql" -p ${toString cfg.settings.port} -tAc 'SHOW data_checksums') in on) checksums=--data-checksums ;; off) checksums="${noChecksums}" ;; *) echo "Can't read data_checksums. Is PostgreSQL running?" >&2; exit 1 ;; esac systemctl stop ${toString units} trap 'systemctl start ${toString units}' ERR install -d -m 0700 -o postgres -g postgres "$NEWDATA" cd "$NEWDATA" runuser -u postgres -- "$NEWBIN/initdb" -D "$NEWDATA" ${lib.escapeShellArgs cfg.initdbArgs} $checksums runuser -u postgres -- "$NEWBIN/pg_upgrade" \ --old-datadir "$OLDDATA" --new-datadir "$NEWDATA" \ --old-bindir "$OLDBIN" --new-bindir "$NEWBIN" \ "$@" '') ];If you set
services.postgresql.dataDir, setnewDatato a path that doesn’t exist yet. If you setservices.postgresql.extensionsto a list, write it as a function, such asps: [ ps.postgis ], so that the script uses the PostgreSQL 17 extensions. The script initializes the new data dir with the data checksum setting of the running server, aspg_upgraderequires. -
Run
upgrade-pg-clusteras root. IfnewDataalready exists, the script stops before it changes anything. Don’t delete that dir, it can hold another cluster: setnewDatato a new path. If the script fails later, it starts the services again on the old data, which it leaves unchanged. Fix the cause and delete thenewDatadir that the script created before you run it again. -
Set
services.postgresql.package = pkgs.postgresql_17;and, if you set it,services.postgresql.dataDirtonewData. Remove the script and deploy. PostgreSQL and its services start on the upgraded data. -
Check BTCPay Server, then update bitcoinix.
Don’t change system.stateVersion to select a newer PostgreSQL: the data dir
/var/lib/postgresql/<version> changes with it, so PostgreSQL starts with a new,
empty database.
Unversioned PostgreSQL package moves to 18
nixos-unstable’s pkgs.postgresql has moved from PostgreSQL 17 to 18. If you set
services.postgresql.package = pkgs.postgresql;, PostgreSQL 18 doesn’t use your
PostgreSQL 17 data after the update: it starts with a new, empty data dir
/var/lib/postgresql/18 or, with a custom services.postgresql.dataDir, fails to
start. Evaluation reports each config that sets a PostgreSQL 18 package.
Check the running version as root with
runuser -u postgres -- psql -tAc 'SHOW server_version'. If it’s 17, set
services.postgresql.package = pkgs.postgresql_17; before you update. To move to
PostgreSQL 18 later, follow the steps in
PostgreSQL 14 removed with pkgs.postgresql_18 in place of
pkgs.postgresql_17.
Custom package imports
Custom calls to lib.mkNbPkgs or pkgs/default.nix must remove pkgsUnstable.
Use pinned.pkgs in place of pinned.pkgsUnstable. The deployment shell no longer
exports nixpkgsUnstable; use the nixpkgs entry in NIX_PATH instead.
The dependency update helper no longer accepts a NixOS release argument.
Service package selection
With the flake’s NixOS module, nix-bitcoin.useVersionLockedPkgs now defaults to
true, including for local package builds. Your system’s nixpkgs.overlays and
nixpkgs.config no longer apply to the pinned service packages, including bitcoind,
lnd and clightning.
Review any security patches or other customizations supplied through overlays:
set nix-bitcoin.useVersionLockedPkgs = false to use your system’s customized
unstable package set, or explicitly override the affected service’s package.
The formerly separate unstable service packages (including lnd and clightning)
now also follow your system’s nixpkgs when you set this option to false or
import the NixOS modules without flakes. Non-flake module imports do not provide
the useVersionLockedPkgs option. If your flake sets
bitcoinix.inputs.nixpkgs.follows = "nixpkgs", even the option’s default true
uses your chosen input instead of bitcoinix’s tested revision. This is different
from having your system’s nixpkgs.follows = "bitcoinix/nixpkgs", which keeps the
bitcoinix pin.
In these setups, pin your own nixpkgs and review service versions before each update against the tested versions. An update can upgrade or downgrade a daemon independently of bitcoinix; an older lnd or clightning may refuse a database written by a newer version. Follow the daemon’s migration instructions and do not assume rolling back nixpkgs can roll back its database.
Keep your existing system.stateVersion: it controls state compatibility and does
not select the nixpkgs channel.
Firewall and FUSE defaults
The OS update also changes these NixOS defaults:
networking.firewall.checkReversePathchanges fromtrue(strict) to"loose". Loose checking accepts a source reachable through any interface, rather than requiring the return route to use the incoming interface. Setnetworking.firewall.checkReversePath = true;to retain strict checking, after checking compatibility with your routing and VPN configuration.programs.fuse.enabledefaults tofalse. If you use non-root FUSE mounts, such as an sshfs backup target, setprograms.fuse.enable = true;to keep the privileged mount helper. Encrypted Core Lightning replication enables it automatically; unrelated operator mounts need their own setting.
I2P settings and validation
For custom i2pd configuration, replace services.i2pd.proto.sam with
services.i2pd.settings.sam and rename its enable field to enabled.
bitcoinix still enables SAM automatically for services.bitcoind.i2p and
sets its address for namespace isolation.
The web console, HTTP proxy and SOCKS proxy remain disabled by default, and
NTCP2/SSU2 address publication remains disabled. Explicit opt-ins through
services.i2pd.settings still take precedence.
With namespace isolation, bitcoinix disables services.i2pd.checkConfig by
default: the upstream build-time check starts i2pd and cannot bind the namespace
bridge address inside the build sandbox. Custom setting errors can therefore
surface only when the service starts. After changing I2P settings, check
systemctl status i2pd and journalctl -u i2pd, and verify bitcoind can reach
the SAM listener. The i2p VM scenario exercises this bridge listener and
i2pLocal covers the loopback listener with the upstream check enabled; these
tests do not validate your custom configuration.
Core Lightning in systemd-nspawn
On the unstable package/system base, Core Lightning in systemd-nspawn needs
memory-locking syscalls allowed to keep its signing keys out of swap. For a custom
NixOS/systemd-nspawn container, add this to the host configuration, replacing
node with the container name:
containers.node.extraFlags = [ "--system-call-filter=@memlock" ];
Without it, lightning_hsmd aborts during startup. The bitcoinix container examples
and test runner already set this flag. The normal memory-lock limit still applies;
no additional capability is needed.
Bitcoin network selection
Replace services.bitcoind.regtest = true; with services.bitcoind.network = "regtest";.
If you explicitly set services.bitcoind.regtest = false;, remove it or set
services.bitcoind.network = "mainnet"; (the default). The new option selects the
network for the whole deployment; existing network-specific paths and ports
are unchanged.
The old boolean is forwarded to network during migration, so upgrade notices
still use the network and paths from your existing configuration. It emits a
deprecation warning if used after updating configVersion.
Network name overrides
The read-only services.bitcoind.makeNetworkName helper has been removed.
Replace calls such as config.services.bitcoind.makeNetworkName "bitcoin" "regtest"
with the new helper, specifying only names that need overriding. In a NixOS
module taking config as an argument, define nbLib before using the short name:
let
nbLib = config.nix-bitcoin.lib;
in
nbLib.networkName { mainnet = "bitcoin"; }
This returns "bitcoin" on mainnet and "regtest" on regtest. Unmapped network
names pass through unchanged.
Mempool follows the selected network
Mempool now identifies as regtest in both its backend and frontend when
services.bitcoind.network = "regtest";. Previously it identified as mainnet
while connecting to the regtest node. It automatically clears disk caches
labelled mainnet and reloads data from its backend after restart.
Review overrides in services.mempool.frontend.settings: regtest defaults to
MAINNET_ENABLED = false, REGTEST_ENABLED = true and ROOT_NETWORK = "regtest".
Remove conflicting overrides unless needed for a custom deployment. If you set
services.mempool.frontend.staticContentRoot, update that custom frontend too.
The web interface stays at the same URL; reload it after deploying.
Regtest onion target port
On regtest, bitcoinix now maps the public onion port 18444 to the local
bitcoind listener on 18445 by default. The generated Tor mapping updates
automatically.
If you manage a separate Tor mapping that forwards to 8334, update its
target to 18445 or set services.bitcoind.onionPort = 8334; to keep using
the old listener.
bitcoind sysperms option removed
services.bitcoind.sysperms has been removed. Bitcoin Core 25.0 removed its sysperms
setting, so bitcoind ignored the option and logged a warning about it. Remove the
option from your configuration. To let the bitcoind group read the blocks dir, set
services.bitcoind.dataDirReadableByGroup = true;. This now also covers the files
that bitcoind creates while it runs. It needs POSIX ACL support on the filesystem of
the blocks dir, and it turns off bitcoind’s wallet.
Group read access needs a real bitcoind blocks dir
With services.bitcoind.dataDirReadableByGroup on mainnet, bitcoind no longer changes
the permissions of the blocks dir (blocks in the data dir) when it’s a symlink. Members
of the bitcoind group can write to the data dir, so they could replace blocks with a
symlink to other files of the bitcoind user and make bitcoind give the group access to
them. The new bitcoind-group-read service, which sets up the group’s access before
each start of bitcoind, now logs a warning and leaves the target alone. On regtest, the
blocks dir wasn’t covered before. Now it is, if neither regtest nor regtest/blocks
is a symlink. On signet and testnet4, the network subdirectory and its blocks
subdirectory must also be real directories or mount points.
If your blocks dir is a symlink, for example to a dir on a second disk, the group can’t
read the block files that bitcoind creates from now on. Replace the symlink with a dir,
or with a bind mount of the dir on the second disk. That dir and all entries in it must
belong to the bitcoind user and group (bitcoin by default). The service leaves an entry of
another user or group alone, so the bitcoind group can’t read it, and logs a warning on
each start. So don’t mount the root of a filesystem there, which can hold a root-owned
lost+found.
A mount point can’t be a symlink. Stop bitcoind and run rm /var/lib/bitcoind/blocks.
Then deploy a config with a mount like the one below, and start bitcoind.
fileSystems."/var/lib/bitcoind/blocks" = {
device = "/mnt/disk2/blocks";
fsType = "none";
options = [ "bind" ];
};
Own RPC users for Core Lightning and mempool
Core Lightning and mempool now connect to bitcoind as their own RPC users,
clightning and mempool. Before, they connected as the public user and added
the methods they need to its whitelist: getblockfrompeer for Core Lightning’s
bcli plugin and gettxoutsetinfo for mempool. All services of the public user
share its whitelist, so electrs, Fulcrum, lnd and the others could call these
methods too. gettxoutsetinfo can keep bitcoind busy for minutes. Now the
public user has only the base whitelist, and each new user has the base
whitelist plus the method of its service.
Each new user has its own password and HMAC in the
secrets dir: bitcoin-rpcpassword-clightning
and bitcoin-HMAC-clightning, and bitcoin-rpcpassword-mempool and
bitcoin-HMAC-mempool. What you have to do depends on your setup:
- With
nix-bitcoin.generateSecrets = trueor the krops deployment shell, and bitcoind on the same node, bitcoinix creates these files, and there’s nothing else to do. No option marks a bitcoind on another node, so evaluation reports this change for every config with Core Lightning or mempool. - If you supply secrets yourself, create these files for the services you use
before deploying. Write a new password to
bitcoin-rpcpassword-<user>, and its HMAC tobitcoin-HMAC-<user>: the<salt>$<hmac>part of therpcauth=line that Bitcoin Core’sshare/rpcauth/rpcauth.pyprints. Withnix-bitcoin.setupSecrets, a missing file fails setup, and then no service can read its secrets. - With the
bitcoind-remote.nixpreset, create the new users on the other node as described in Use bitcoind from another node, with the whitelists inservices.bitcoind.rpc.users.clightning.rpcwhitelistandservices.bitcoind.rpc.users.mempool.rpcwhitelist. Setservices.bitcoind.rpc.users.<user>.nameif a user has another name there. Save their passwords tobitcoin-rpcpassword-<user>on this node. Withnix-bitcoin.generateSecrets = true, bitcoinix creates a password when the file is missing, andbitcoin-HMAC-<user>then holds the part afterrpcauth=<name>:for the other node. Without it, write the HMAC as above, or create an emptybitcoin-HMAC-<user>and setnix-bitcoin.secrets.bitcoin-HMAC-<user>.allowEmpty = true, since this node doesn’t use it.
With bitcoind on another node, its whitelists still have the methods that
bitcoinix added before. Remove getblockfrompeer and gettxoutsetinfo from the
whitelist of the public user there, if it has them, whatever your new config
enables. If you use BTCPay Server, set the whitelist of its user there again
from services.bitcoind.rpc.users.btcpayserver.rpcwhitelist. It builds on the
public whitelist, so with mempool it had gettxoutsetinfo too.
Backups leave out the Lightning channel databases
The backups service no longer includes lnd’s graph directory, which holds
channel.db, or Core Lightning’s lightningd.sqlite3. It copied these files while
the daemons wrote them. A node that runs from an outdated copy can broadcast a
revoked channel state, and the peer can then take all funds in that channel.
Backups made before this change still contain these files. Never restore them. To recover Lightning funds, use the files that Lightning channel databases lists. For a copy of the Core Lightning database that’s always current, use database replication.
Backups include copies of bitcoind wallets
Before each backup, the new bitcoind-wallet-backup unit asks a local bitcoind for a
consistent copy of each loaded wallet. The duplicity unit now also fails when a
copy fails, or when bitcoind is starting or stopping. It still backs up all other
files first. If a backup fails, check journalctl -u bitcoind-wallet-backup. See
bitcoind wallets.
Core Lightning data dir no longer writable by its group
The Core Lightning data dir (services.clightning.dataDir, /var/lib/clightning by
default) now has mode 0750 instead of 0770. Before, every member of the clightning
group (services.clightning.group, clightning by default) could create, rename and
delete entries in it. A member could swap the config file after clightning.service
wrote it and before lightningd read it, and make lightningd start a plugin of its
choice. Or it could replace the network dir with one that holds its own hsm_secret.
The group can hold the operator user (with nix-bitcoin.operator.enable), BTCPay
Server’s user (with services.btcpayserver.lightningBackend = "clightning") and the
users that you add to it.
The deployment sets the new mode. Group members can still use the RPC socket, for
example with lightning-cli, and read the files they could read before. The RPC socket
gives full control over the node, so add only trusted users to this group. A script
that writes to the data dir as a group member now fails. Run it as the clightning user
(services.clightning.user, clightning by default) or as root.
Every entry in the data dir belongs to the clightning user. To list the entries that
don’t, run this as root. Use your services.clightning.dataDir and
services.clightning.user if you changed them:
find /var/lib/clightning ! -user clightning
If it lists an entry that you didn’t create as root, a group member created it. Stop
clightning and check the entry before you start clightning again. A network dir
(bitcoin on mainnet) that a group member created can hold an hsm_secret that the
member controls.
clightning requires the mount of its local replica
clightning now requires the mounts for services.clightning.replication.local.directory.
With encrypt, clightning-replication-mounts requires them too. This changes
something only when a mount that systemd knows, like a fileSystems entry other
than /, holds the directory. While that mount is missing, clightning doesn’t
start. Before, it started and wrote the replica to the filesystem below the mount
point, usually the primary disk. Then a failure of that disk took both copies.
Stopping or restarting the mount now also stops or restarts clightning.
Evaluation can’t check which mount holds the directory, so it reports this change
for every local replica directory. If the directory is on the root filesystem, or
the replica’s disk or share isn’t declared, for example because you mount it by
hand, clightning starts as before. Declare the disk or share in fileSystems, as in
Local directory target, so that clightning
waits for it. systemd doesn’t follow symlinks here, so if local.directory is a
symlink, set it to the target instead.
Deploying this change restarts clightning once, because its unit changes.
To check where the replica is, run findmnt --target <local.directory>. It names the
filesystem that holds the directory.
Charge-LND credential paths
Charge-LND now reads the configured LND certificate and
/run/lnd/charge-lnd.macaroon directly, without a proxy data directory.
If you selected custom credentials with --lnddir in
services.charge-lnd.extraFlags and omitted either --tlscert or --macaroon,
add the missing credential path explicitly. Configurations already specifying
both paths, and default configurations, need no changes.
The old /var/lib/charge-lnd/lnddir-proxy tree is left behind on existing hosts.
It is no longer used and can be removed after upgrading.
NBXplorer RPC password permissions
NBXplorer’s bitcoind RPC password (bitcoin-rpcpassword-btcpayserver in the
secrets dir) is now readable only by NBXplorer’s
user (services.nbxplorer.user), with mode 0400. Before, bitcoind’s user and
NBXplorer’s group could read it too. BTCPay Server is in that group to read
NBXplorer’s API cookie, so it could read the password. BTCPay Server still reads
the cookie.
If a program reads the password as another user, give the program its own RPC user
in services.bitcoind.rpc.users. If you manage the secret files outside bitcoinix,
for example with nix-bitcoin.secretsSetupMethod = "manual", make NBXplorer’s user the
owner of the file and set its mode to 0400.
If you think that BTCPay Server was compromised, replace the password. With a local
bitcoind and nix-bitcoin.generateSecrets = true, delete the password file and run
systemctl restart setup-secrets. Then run systemctl restart bitcoind nbxplorer.
BTCPay Server admin account
BTCPay Server makes the first account that registers the server admin, which can use
the internal Lightning node. Before, any local user could register first and take that
account until you registered yours. When BTCPay Server has no admin, bitcoinix now
creates the admin account admin@localhost before BTCPay Server opens its port. Its
password is in the new secret $secretsDir/btcpayserver-admin-password.
- If your BTCPay Server already has an admin, bitcoinix keeps it and doesn’t create
admin@localhost. Check that each admin is yours. Check the admin accounts says how, and what to do if one isn’t. This matters most if BTCPay Server ran for a while before you registered, or if you found registration closed. - If it has no admin yet, sign in as
admin@localhostinstead of registering. See Connect to BTCPay Server. - If you supply your secrets yourself instead of with
nix-bitcoin.generateSecrets, put a password inbtcpayserver-admin-passwordbefore you deploy. With krops, thedeployandkrops-deploycommands of the deployment shell rungenerate-secrets, which creates it.
RTL gets its own lnd macaroon and clightning rune
RTL’s start copied lnd’s admin macaroon to macaroons/admin.macaroon and clnrest’s
admin rune to clightning-admin-rune in RTL’s data dir, /var/lib/rtl by default. Now
RTL gets its own macaroon and rune, which allow only the calls that RTL makes, and its
start writes them to these paths. It removes the copy of a backend that RTL doesn’t use.
If another app reads one of these files, it gets authorization errors after the deploy
for the calls that RTL doesn’t make, or doesn’t find the file. Give the app its own
credentials. For lnd, add a custom macaroon with services.lnd.macaroons.<name>, see
Custom macaroons. For clightning, create a rune
with lightning-cli createrune that allows only the methods that the app needs.
With RTL on lnd, lnd restarts once during the deploy to create RTL’s macaroon.
systemd holds RTL’s port while RTL is stopped
Without netns-isolation, RTL now listens on a unix socket, and systemd holds
services.rtl.address and port for it with a socket unit, rtl-proxy-*.socket.
rtl-proxy.service forwards each connection to RTL. The SSH tunnel and the onion
service work as before. In the tunnel, use the address and port that systemd holds. By
default that’s 127.0.0.1:3000, as in Connect to RTL.
If you set another address or port, use those, with 127.0.0.1 for 0.0.0.0 and
[::1] for ::. With localhost, sshd may connect to [::1]:3000, which systemd
doesn’t hold with the default address.
services.rtl.addressmust be a numeric IPv4 or IPv6 address, without brackets and without a zone ID like%lo. A host name likelocalhost, a zone ID or a socket path now fails the system build with an error that names the address. So if you set a host name or a zone ID, set a numeric IP address like127.0.0.1.- The first switch to this version stops RTL before it starts the socket unit. The
port is free in between, and another local user could take it. To avoid this,
deploy with
nixos-rebuild bootand reboot. After the reboot or a switch, check thatsystemctl list-units --all 'rtl-proxy-*.socket'shows the socket unitloadedandactive. A switch back to an older version has the same gap, and so has a later switch that changesservices.rtl.addressorport. - RTL now ignores
PORTandHOSTin its environment, also from anEnvironmentFile. Useservices.rtl.addressandportinstead. - RTL sees no client addresses through the proxy. So five failed logins from any client lock out all clients for 30 minutes. Before, this applied to all clients on localhost.
Hardware wallet access requires group hardware-wallets
With services.hardware-wallets.ledger or trezor enabled, the Ledger and Trezor
devices that its udev rules match are now available only to members of group
hardware-wallets (services.hardware-wallets.group). The operator user is in that
group. Before, systemd’s 70-uaccess.rules also gave these devices to the user of
the active local session, and the Trezor rules added the uaccess tag themselves.
The rules now remove that tag. The Ledger rules now match every Ledger device that
systemd lists: all of USB vendor 2c97, and the HW.1 and early Nano IDs of vendor
2581. Before, they matched only product 0001, so the group didn’t get other Ledger
models and firmware versions. To give another user access,
add it to the group:
users.users.<name>.extraGroups = [ "hardware-wallets" ];
A device that’s plugged in while you deploy keeps the session user’s access until you unplug it.
Trezor Bridge runs only on request
The Trezor Bridge (trezord) no longer runs. HWI and trezorctl open the device
directly and don’t need it. The bridge couldn’t open the device before, since its
user wasn’t in group hardware-wallets. To run it for apps that use it, set:
services.hardware-wallets.trezorBridge = true;
The bridge serves an HTTP API without authentication on 127.0.0.1:21325. Every
local user and service can then use the Trezor through it. For example, they can
read its public keys while it’s unlocked, which reveals the addresses of its
wallets. Signing still needs a confirmation on the device. If you set
services.trezord.enable = true yourself instead and don’t give trezord the group,
evaluation warns that the bridge can’t open the device.
The secure-node preset turns off SSH password login
The secure-node.nix preset publishes sshd as an onion service. It now also sets
services.openssh.settings.PasswordAuthentication and
services.openssh.settings.KbdInteractiveAuthentication to false by default, so
sshd accepts only keys. Before, the NixOS defaults allowed passwords, and anyone who
knew the onion address could try the passwords of your accounts over Tor. This
includes the operator, whose groups control your node’s funds. The change also
applies to SSH over the node’s IP address, since it’s the same sshd.
Evaluation reports this change for every configuration with the preset and
services.openssh.enable. If yours already sets both options to false, like the
flakes and Colmena examples, nothing changes.
Otherwise, before deploying, check that each account that logs in over SSH has its
key in users.users.<name>.openssh.authorizedKeys.keys. The preset gives the
operator the keys of root. Keep a root session or console access until a new login
with a key works.
To keep password login, set services.openssh.settings.PasswordAuthentication = true;.
If you log in with keyboard-interactive methods through PAM, for example one-time
codes, set KbdInteractiveAuthentication = true and check sshd’s PAM stack. NixOS
sets security.pam.services.sshd.unixAuth from PasswordAuthentication, and PAM
modules differ in how they depend on it:
- With
googleAuthenticator, NixOS adds the one-time code rule only whenunixAuthorservices.homed.enableis on. Without systemd-homed, set both options totrue. - With
otpwAuth,unixAuthadds a password rule before the one-time password rule, so a plain password would be enough. KeepPasswordAuthentication = false.
For other modules, check the rules in /etc/pam.d/sshd after you build the system.
Either way, test a new login before you close your current session.
If your configuration sets one of these options to true with lib.mkDefault,
evaluation fails with “conflicting definition values”, because the preset uses the
same priority. Then you don’t see this notice. Set the option without lib.mkDefault
instead.
nix-bitcoin-wg-connect needs the node’s address
nix-bitcoin-wg-connect, from the WireGuard preset, now needs the address where your
WireGuard client reaches the node. Before, it looked up the node’s public IP when you
didn’t pass an address. The lookup queried public IP lookup services over clearnet,
which revealed the IP to them, also on a node that otherwise uses only Tor. Without an
address, the command now prints a usage message and fails. Pass your node’s public IP
or hostname, as described in Set up WireGuard and ZEUS:
nix-bitcoin-wg-connect 93.184.216.34
Scripts that call it without an address need the same change. Existing WireGuard clients keep working.
hardened-extended ignores router advertisements on new interfaces
The hardened-extended.nix preset now sets net.ipv6.conf.default.accept_ra = 0
instead of a sysctl that doesn’t exist. The kernel then ignores IPv6 router
advertisements on interfaces that appear after the sysctl settings are applied at
boot, which can include your main network interface. dhcpcd and systemd-networkd
handle router advertisements themselves, but only on the interfaces they manage.
They skip, for example, interfaces with useDHCP = false or a static IPv4 address,
all interfaces with networking.dhcpcd.IPv6rs = false, and with systemd-networkd,
VLANs, bridges and bonds, because its default networks match only physical
interfaces. Evaluation reports this for each config with the preset
and IPv6.
If an interface gets its IPv6 address or default route from router advertisements, before deploying, do one of these:
- Configure the address and route statically, for example with
networking.interfaces.<name>.ipv6.addressesandnetworking.defaultGateway6. - Let dhcpcd or systemd-networkd manage the interface:
networking.interfaces.<name>.useDHCP = true;. - With a static IPv6 address, let dhcpcd solicit router advertisements:
networking.dhcpcd.IPv6rs = true;. - Keep the previous behavior:
boot.kernel.sysctl."net.ipv6.conf.default.accept_ra" = lib.mkForce "1";.
After migrating your configuration, set nix-bitcoin.configVersion = "0.2.0";.