removed experimental system modules

This commit is contained in:
Bryan Ramos 2024-05-13 16:05:41 -04:00
parent 0d1d7aa28c
commit 7ba9dc50e7
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
19 changed files with 0 additions and 462 deletions

View file

@ -1,63 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.system.bitcoin;
in
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
imports = [ ./modules ];
config = mkIf cfg.enable {
programs.bash.shellAliases = {
btc = "bitcoin-cli";
};
users = {
users = {
"bitcoind" = {
description = "bitcoind system user";
isSystemUser = true;
group = "bitcoin";
home = /var/lib/bitcoind;
createHome = true;
};
};
groups = {
"bitcoin" = {
members = [ "clightning" "electrs" ];
};
};
};
services.bitcoind = {
"bitcoind" = {
enable = true;
testnet = false;
user = "bitcoind";
group = "bitcoin";
configFile = /var/lib/bitcoind/bitcoin.conf;
rpc = {
port = 8332;
};
extraConfig = ''
server=1
mempoolfullrbf=1
v2transport=1
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
proxy=127.0.0.1:9050
listen=1
listenonion=1
torcontrol=127.0.0.1:9051
torenablecircuit=1
'';
};
};
};
}

View file

@ -1,73 +0,0 @@
{ lib, pkgs, config, ... }:
#TODO: c-lightning config file
with lib;
let cfg = config.modules.system.bitcoin.core-lightning;
in
{ options.modules.system.bitcoin.core-lightning = { enable = mkEnableOption "system.bitcoin.core-lightning"; };
config = mkIf cfg.enable {
imports = [ ./modules ];
programs.bash.shellAliases = {
cln = "lightningd";
};
environment.systemPackages = with pkgs; [
clightning
];
users = {
users = {
"c-lightning" = {
description = "core-lightning system user";
isSystemUser = true;
group = "bitcoin";
home = /var/lib/c-lightning;
createHome = true;
};
};
};
systemd.services.lightningd = {
Unit = {
Description = "Core Lightning daemon";
Requires = [ "bitcoind.service" ];
After = [ "bitcoind.service" "network-online.target" ];
Wants = [ "network-online.target" ];
};
Service = {
ExecStartPre =
let
lightningConf = ''
''; #put lightning conf here
in
"${pkgs.writeShellScript "prepare-clightning-config" ''
mkdir -p /var/lib/c-lightning/.lightning
chown -R c-lightning:bitcoin /var/lib/c-lightning
echo "${lightningConf}" > /var/lib/c-lightning/.lightning/config
chmod 600 /var/lib/c-lightning/.lightning/config
''}";
ExecStart = "${pkgs.clightning}/bin/lightningd --conf=/var/lib/c-lightning/.lightning/config";
RuntimeDirectory = "lightningd";
User = "c-lightning";
Group = "bitcoin";
Type = "forking";
PIDFile = "/run/lightningd/lightningd.pid";
Restart = "on-failute";
PrivateTmp = true;
ProtectSystem = "full";
NoNewPrivileges = true;
PrivateDevies = true;
MemoryDenyWriteAccess = false;
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
};
}

View file

@ -1,18 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.modules.system.bitcoin.core-lightning.REST;
cln = config.modules.system.bitcoin.core-lightning;
c-lightning-REST = import ./derivation.nix { inherit pkgs; };
in
{ options.modules.system.bitcoin.core-lightning.REST = {
enable = mkEnableOption "system.bitcoin.core-lightning.REST";
};
config = mkIf (cfg.enable && cln.enable) {
environment.systemPackages = with pkgs; [
c-lightning-REST
];
};
}

View file

@ -1,28 +0,0 @@
{ pkgs, ... }:
with pkgs;
stdenv.mkDerivation rec {
pname = "c-lightning-REST";
version = "0.10.7";
src = fetchurl {
url = "https://github.com/Ride-The-Lightning/c-lightning-REST/archive/refs/tags/v${version}.tar.gz";
sha256 = "1swg53vbacsrsgy79lni07dy2h44b0yf2kad7j4fv17az4gwnxk7";
};
buildInputs = with pkgs; [
nodejs
];
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
meta = {
description = "c-lighting REST API";
homepage = "https://github.com/Ride-The-Lightning/c-lightning-REST";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
};
}

View file

@ -1,5 +0,0 @@
{
imports = [
./c-lightning-REST
];
}

View file

@ -1,7 +0,0 @@
{
imports = [
./core-lightning
./electrs
./sparrow-server
];
}

View file

@ -1,49 +0,0 @@
{ lib, pkgs, config, ... }:
#TODO: electrs configuration file
with lib;
let cfg = config.modules.bitcoin.electrs;
in
{ options.modules.bitcoin.electrs = { enable = mkEnableOption "bitcoin.electrs"; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
electrs
];
users = {
users = {
"electrs" = {
description = "electrs system user";
isSystemUser = true;
group = "bitcoin";
home = /var/lib/electrs;
createHome = true;
};
};
};
systemd.services.electrs = {
Unit = {
Description = "Electrs Bitcoin Indexer";
After = [ "network.target" "bitcoind.service" ];
Requires = [ "bitcoind.service" ];
};
Service = {
ExecStartPre = "/usr/bin/sleep 10";
ExecStart = "${pkgs.electrs}/bin/electrs";
User = "electrs";
Group = "bitcoin";
Type = "simple";
KillMode = "process";
TimeoutSec = 60;
Restart = "always";
RestartSec = 60;
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
};
}

View file

@ -1,14 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.modules.system.bitcoin.sparrow-server;
sparrow-server = import ./derivation.nix { inherit pkgs; };
in
{ options.modules.system.bitcoin.sparrow-server = { enable = mkEnableOption "system.bitcoin.sparrow-server"; };
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
sparrow-server
];
};
}

View file

@ -1,24 +0,0 @@
{ pkgs, ... }:
with pkgs;
stdenv.mkDerivation rec {
pname = "sparrow-server";
version = "1.8.2";
src = fetchurl {
url = "https://github.com/sparrowwallet/sparrow/releases/download/${version}/sparrow-server-${version}-x86_64.tar.gz";
sha256 = "16hyrf8j7mv3m1ry7r2k3w70yxbf6smgcm5d35xy2hjqfmahv65m";
};
installPhase = ''
mkdir -p $out/bin
cp -r * $out/bin
'';
meta = {
description = "Sparrow Server";
homepage = "https://sparrowwallet.com/";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux;
};
}