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 = {
|
systemd.services.lnd = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
requires = optional (cfg.backend == "bitcoind") "bitcoind.service";
|
requires = optionals (cfg.backend == "bitcoind") [ "bitcoind.service" ];
|
||||||
after = optional (cfg.backend == "bitcoind") "bitcoind.service" ++ [ "nix-bitcoin-secrets.target" ];
|
after = optionals (cfg.backend == "bitcoind") [ "bitcoind.service" ] ++ [ "nix-bitcoin-secrets.target" ];
|
||||||
preStart = ''
|
preStart = ''
|
||||||
install -m600 ${configFile} '${cfg.dataDir}/lnd.conf'
|
install -m600 ${configFile} '${cfg.dataDir}/lnd.conf'
|
||||||
${optionalString (cfg.backend == "bitcoind") ''
|
${optionalString (cfg.backend == "bitcoind") ''
|
||||||
|
|
@ -324,7 +324,7 @@ in {
|
||||||
users.users.${cfg.user} = {
|
users.users.${cfg.user} = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = cfg.group;
|
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
|
home = cfg.dataDir; # lnd creates .lnd dir in HOME
|
||||||
};
|
};
|
||||||
users.groups.${cfg.group} = {};
|
users.groups.${cfg.group} = {};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue