This commit is contained in:
Bryan Ramos 2024-02-28 21:27:03 -05:00
parent b126c84401
commit 8258e82891
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
25 changed files with 36 additions and 15 deletions

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.bitcoin;
cfg = config.modules.system.bitcoin;
in
{ options.modules.bitcoin = { enable = mkEnableOption "bitcoin"; };
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
imports = [
./core-lightning

View file

@ -1,11 +1,12 @@
{ lib, pkgs, config, ... }:
with lib;
let cfg = config.modules.bitcoin.core-lightning;
let cfg = config.modules.system.bitcoin.core-lightning;
in
{ options.modules.bitcoin.core-lightning = { enable = mkEnableOption "bitcoin.core-lightning"; };
{ options.modules.system.bitcoin.core-lightning = { enable = mkEnableOption "system.bitcoin.core-lightning"; };
config = mkIf cfg.enable {
imports = [ ./modules ];
programs.bash.shellAliases = {
cln = "lightningd";
};
@ -24,16 +25,33 @@ in
};
};
systemd.services.clightning = {
systemd.services.lightningd = {
Unit = {
after = [ "network.target" "bitcoind.service" ];
wantedBy = [ "multi-user.target" ];
Description = "Core Lightning daemon";
Requires = [ "bitcoind.service" ];
After = [ "bitcoind.service" "network-online.target" ];
Wants = [ "network-online.target" ];
};
Service = {
ExecStart = "${pkgs.clightning}/bin/lightningd --conf=...";
Restart = "always";
ExecStartPre = "/usr/bin/sleep 10";
ExecStart = "${pkgs.clightning}/bin/lightningd --conf=/var/lib/clightning/.lightning/config";
RuntimeDirectory = "lightningd";
User = "clightning";
Group = "bitcoin";
Type = "forking";
PIDFile = "/run/lightningd/lightningd.pid";
Restart = "on-failute";
PrivateTmp = true;
ProtectSystem = "full";
NoNetPrivileges = true;
PrivateDevies = true;
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
};

View file

@ -2,10 +2,10 @@
with lib;
let
cfg = config.modules.bitcoin.sparrow-server;
cfg = config.modules.gui.bitcoin.sparrow-server;
sparrow-server = import ./derivation.nix { inherit pkgs; };
in
{ options.modules.bitcoin.sparrow-server = { enable = mkEnableOption "bitcoin.sparrow-server"; };
{ options.modules.gui.bitcoin.sparrow-server = { enable = mkEnableOption "gui.bitcoin.sparrow-server"; };
config = mkIf cfg.enable {
home.packages = with pkgs; [
sparrow-server

View file

@ -1,6 +1,6 @@
{
imports = [
./corn
./bitcoin
./security
];
}