refactor(rename): NixOS module + service + paths → bitspire

Five-file coordinated rename to give the dev-branch deploy a clean
`bitspire` namespace at the NixOS level:

  deploy/nixos/lamassu-atm.nix → deploy/nixos/bitspire-atm.nix
    - `services.lamassu-atm`           → `services.bitspire`
    - `systemd.services.lamassu-atm`   → `systemd.services.bitspire`
    - `/var/lib/lamassu-atm`           → `/var/lib/bitspire`
    - `/opt/lamassu-atm`               → `/opt/bitspire`
    - `/etc/lamassu-atm/config.env`    → `/etc/bitspire/config.env`

  flake.nix
    - module import path updated
    - `nixosModules.lamassu-atm` → `nixosModules.bitspire`
    - `system.activationScripts.lamassu-env` → `bitspire-env`
    - all activation-script paths point at /var/lib/bitspire

  deploy/nixos/configuration.nix
    - `networking.hostName = "lamassu-atm"` → `"bitspire"`

  deploy/nixos/live.nix
    - module import path updated
    - ISO name template: `lamassu-atm-<model>-live.iso` → `bitspire-<model>-live.iso`
    - activation-script name updated

  deploy/nixos/provision-atm.sh
    - data-dir paths: /var/lib/lamassu-atm → /var/lib/bitspire
    - systemctl + journalctl unit names updated

DELIBERATELY kept as `lamassu` (for now):
  - The `lamassu` UNIX user and group account. Renaming would
    require file-ownership migration scripts; the Sintra is a
    fresh flash so no existing data, but the internal user
    namespace inconsistency is acceptable.
  - LP-specific bits in provision-atm.sh (admin token, the
    `docker logs lamassu-lightning-pub` extractor) — those
    get ripped out in 3c when the script switches to LNbits.

NO migration activation script added — the Sintra flash is fresh,
production batm3/douro stay on `main` and never see this branch.
A future dev→main cutover will need a separate migration story
(rename UNIX user, move /var/lib/lamassu-atm → /var/lib/bitspire,
SSH key relocation, etc.).

Verified:
  nix eval .#nixosConfigurations.batm3-installed.config.systemd.services.bitspire.enable
    → true
  nix eval .#nixosConfigurations.bitSpire-live-sintra.config.networking.hostName
    → "bitspire"

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-13 12:35:12 +02:00
commit 28a35ca479
5 changed files with 39 additions and 39 deletions

View file

@ -23,7 +23,7 @@ let
# .env template — runtime secrets are provisioned later via provision-atm.sh.
# Only non-secret defaults and display vars go here.
envTemplate = pkgs.writeText "lamassu-atm-env" ''
envTemplate = pkgs.writeText "bitspire-env" ''
VITE_RELAY_URL=
VITE_LIGHTNING_PUB_PUBKEY=
VITE_LIGHTNING_PUB_API_URL=
@ -48,12 +48,12 @@ in
./configuration.nix
# Reuse ATM systemd service module
./lamassu-atm.nix
./bitspire-atm.nix
];
# ISO image settings
isoImage = {
isoName = "lamassu-atm-${machineModel}-live.iso";
isoName = "bitspire-${machineModel}-live.iso";
makeEfiBootable = true;
makeBiosBootable = true;
squashfsCompression = "zstd -Xcompression-level 6";
@ -139,7 +139,7 @@ in
};
# Enable the ATM service with live USB paths
services.lamassu-atm = {
services.bitspire = {
enable = true;
appDir = "${atm-app}";
};
@ -148,9 +148,9 @@ in
boot.kernel.sysctl."kernel.unprivileged_userns_clone" = 1;
# Override the systemd service for live USB environment
systemd.services.lamassu-atm = {
systemd.services.bitspire = {
serviceConfig = {
EnvironmentFile = lib.mkForce "/var/lib/lamassu-atm/.env";
EnvironmentFile = lib.mkForce "/var/lib/bitspire/.env";
# Native modules need libstdc++ on NixOS
Environment = "LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib";
# Electron needs --no-sandbox in the live/testing environment
@ -170,12 +170,12 @@ in
};
# Install the .env on first boot
system.activationScripts.lamassu-env = ''
mkdir -p /var/lib/lamassu-atm
if [ ! -f /var/lib/lamassu-atm/.env ]; then
cp ${envTemplate} /var/lib/lamassu-atm/.env
chmod 600 /var/lib/lamassu-atm/.env
chown lamassu:lamassu /var/lib/lamassu-atm/.env
system.activationScripts.bitspire-env = ''
mkdir -p /var/lib/bitspire
if [ ! -f /var/lib/bitspire/.env ]; then
cp ${envTemplate} /var/lib/bitspire/.env
chmod 600 /var/lib/bitspire/.env
chown lamassu:lamassu /var/lib/bitspire/.env
fi
'';
@ -186,7 +186,7 @@ in
after = [ "display-manager.service" ];
requires = [ "display-manager.service" ];
wantedBy = [ "graphical.target" ];
before = [ "lamassu-atm.service" ];
before = [ "bitspire.service" ];
serviceConfig = {
Type = "oneshot";
User = "lamassu";