lnd: use optionals instead of optional for list additions

Use optionals with explicit list syntax for requires, after, and
extraGroups. This makes it clearer that we're conditionally adding
elements to a list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
padreug 2025-12-24 17:13:26 +01:00
parent ebd13a2c87
commit ab188f03f8

View file

@ -261,8 +261,8 @@ in {
systemd.services.lnd = {
wantedBy = [ "multi-user.target" ];
requires = optional (cfg.backend == "bitcoind") "bitcoind.service";
after = optional (cfg.backend == "bitcoind") "bitcoind.service" ++ [ "nix-bitcoin-secrets.target" ];
requires = optionals (cfg.backend == "bitcoind") [ "bitcoind.service" ];
after = optionals (cfg.backend == "bitcoind") [ "bitcoind.service" ] ++ [ "nix-bitcoin-secrets.target" ];
preStart = ''
install -m600 ${configFile} '${cfg.dataDir}/lnd.conf'
${optionalString (cfg.backend == "bitcoind") ''
@ -324,7 +324,7 @@ in {
users.users.${cfg.user} = {
isSystemUser = true;
group = cfg.group;
extraGroups = optional (cfg.backend == "bitcoind") "bitcoinrpc-public";
extraGroups = optionals (cfg.backend == "bitcoind") [ "bitcoinrpc-public" ];
home = cfg.dataDir; # lnd creates .lnd dir in HOME
};
users.groups.${cfg.group} = {};