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:
parent
ebd13a2c87
commit
ab188f03f8
1 changed files with 3 additions and 3 deletions
|
|
@ -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} = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue