mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
cont
This commit is contained in:
parent
b126c84401
commit
8258e82891
25 changed files with 36 additions and 15 deletions
|
|
@ -6,7 +6,6 @@
|
||||||
home-manager.users.${config.user.name} = {
|
home-manager.users.${config.user.name} = {
|
||||||
imports = [
|
imports = [
|
||||||
../../../user
|
../../../user
|
||||||
../../../user/modules
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
home-manager.users.${config.user.name} = {
|
home-manager.users.${config.user.name} = {
|
||||||
imports = [
|
imports = [
|
||||||
../../../user
|
../../../user
|
||||||
../../../user/modules
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
home-manager.users.${config.user.name} = {
|
home-manager.users.${config.user.name} = {
|
||||||
imports = [
|
imports = [
|
||||||
../../../user
|
../../../user
|
||||||
../../../user/modules
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.home-manager.enable = true;
|
programs.home-manager.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.modules.bitcoin;
|
cfg = config.modules.system.bitcoin;
|
||||||
|
|
||||||
in
|
in
|
||||||
{ options.modules.bitcoin = { enable = mkEnableOption "bitcoin"; };
|
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./core-lightning
|
./core-lightning
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
{ lib, pkgs, config, ... }:
|
{ lib, pkgs, config, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let cfg = config.modules.bitcoin.core-lightning;
|
let cfg = config.modules.system.bitcoin.core-lightning;
|
||||||
|
|
||||||
in
|
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 {
|
config = mkIf cfg.enable {
|
||||||
|
imports = [ ./modules ];
|
||||||
programs.bash.shellAliases = {
|
programs.bash.shellAliases = {
|
||||||
cln = "lightningd";
|
cln = "lightningd";
|
||||||
};
|
};
|
||||||
|
|
@ -24,16 +25,33 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.clightning = {
|
systemd.services.lightningd = {
|
||||||
Unit = {
|
Unit = {
|
||||||
after = [ "network.target" "bitcoind.service" ];
|
Description = "Core Lightning daemon";
|
||||||
wantedBy = [ "multi-user.target" ];
|
Requires = [ "bitcoind.service" ];
|
||||||
|
After = [ "bitcoind.service" "network-online.target" ];
|
||||||
|
Wants = [ "network-online.target" ];
|
||||||
};
|
};
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = "${pkgs.clightning}/bin/lightningd --conf=...";
|
ExecStartPre = "/usr/bin/sleep 10";
|
||||||
Restart = "always";
|
ExecStart = "${pkgs.clightning}/bin/lightningd --conf=/var/lib/clightning/.lightning/config";
|
||||||
|
|
||||||
|
RuntimeDirectory = "lightningd";
|
||||||
|
|
||||||
User = "clightning";
|
User = "clightning";
|
||||||
Group = "bitcoin";
|
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" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.modules.bitcoin.sparrow-server;
|
cfg = config.modules.gui.bitcoin.sparrow-server;
|
||||||
sparrow-server = import ./derivation.nix { inherit pkgs; };
|
sparrow-server = import ./derivation.nix { inherit pkgs; };
|
||||||
in
|
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 {
|
config = mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
sparrow-server
|
sparrow-server
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./corn
|
./bitcoin
|
||||||
./security
|
./security
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
src/user/default.nix
Normal file
6
src/user/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./configs
|
||||||
|
./modules
|
||||||
|
];
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue