New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/clightning: init module #50531
Conversation
Signed-off-by: William Casarin <jb55@jb55.com>
options = { | ||
|
||
dataDir = mkOption { | ||
type = types.path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot default here
{ | ||
options = { | ||
services.clightning = { | ||
networks = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name networks
seems to be a leftover from openvpn. I think nodes
would be more fitting.
# clightning requires bitcoin-cli to talk to either spruned or bitcoind | ||
path = [ pkgs.altcoins.bitcoind ]; | ||
|
||
after = [ "network.target" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no network.target
for user units (see systemctl --user list-units -t target
). You can remove this dependency.
config = mkIf (cfg.networks != {}) { | ||
|
||
systemd.user.services = | ||
listToAttrs (mapAttrsFlatten (name: value: nameValuePair "clightning-${name}" (mkLightningNode value name)) cfg.networks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified to
mapAttrs' (name: value: nameValuePair "clightning-${name}" (mkLightningNode value name)) cfg.networks;
}; | ||
} | ||
''; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd remove the whitespace here, one blank line should be enough.
}; | ||
}; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: These blank lines between brackets can be removed. There's more of them down below.
config = mkOption { | ||
type = types.lines; | ||
description = '' | ||
Configuration of this clightning node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you link to the docs for the configuration here?
I'm having trouble getting both mainnet and testnet nodes to play nice together on the same machine, so I'm going to shelve this for now ... |
ooops nm I was just confused... |
I'm going to close this for now until I have time to fix some issues with it |
I copied a lot of stuff from the openvpn module for this one to support multiple networks at once.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)