This commit is contained in:
Bryan Ramos 2024-03-01 15:49:38 -05:00
parent 1d52958cde
commit 974f185b00
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
12 changed files with 168 additions and 7 deletions

View file

@ -7,10 +7,7 @@ let
in
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
imports = [
./core-lightning
./sparrow-cli
];
imports = [ ./modules ];
config = mkIf cfg.enable {
programs.bash.shellAliases = {

View file

@ -2,6 +2,6 @@
imports = [
./core-lightning
./electrs
./sparrow-cli
./sparrow-server
];
}

View file

@ -1,5 +1,7 @@
{
imports = [
./bitcoin
./nginx
./tor
];
}

View file

@ -0,0 +1,21 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.system.nginx;
in
{ options.modules.system.nginx = { enable = mkEnableOption "system.nginx"; };
config = mkIf cfg.enable {
imports = [ ./sites ];
security.acme = {
defaults = {
email = config.user.email;
};
};
services.nginx = {
enable = true;
package = pkgs.nginxMainLine;
};
};
}

View file

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

View file

@ -0,0 +1,30 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.nginx.mySite;
nginxCfg = config.modules.system.nginx;
in
{ options.modules.system.nginx.mySite = { enable = mkEnableOption "system.nginx.mySite"; };
config = mkIf (cfg.enable && nginxCfg) {
security.acme = {
certs = {
"*.ramos.codes" = {
#TODO: configure ACME certs
};
};
};
services.nginx = {
#TODO: check if configure as vhost or stream
virtualHosts = {
"*.ramos.codes" = {
addSSL = true;
onlySSL = true;
forceSSL = true;
acmeRoot = null;
};
};
};
};
}

View file

@ -0,0 +1,31 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.nginx.mySite.btc;
mySiteCfg = config.modules.system.nginx.mySite;
btcCfg = config.modules.system.bitcoin;
in
{ options.modules.system.nginx.mySite.btc = { enable = mkEnableOption "system.nginx.mySite.btc"; };
config = mkIf (cfg.enable && mySiteCfg && btcCfg) {
#security.acme = {
# certs = {
# "btc.ramos.codes" = {
# #TODO: configure ACME certs
# };
# };
#};
#services.nginx = {
# #TODO: check if configure as vhost or stream
# virtualHosts = {
# "btc.ramos.codes" = {
# addSSL = true;
# onlySSL = true;
# forceSSL = true;
# acmeRoot = null;
# };
# };
#};
};
}

View file

@ -0,0 +1,30 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.nginx.mySite.git;
mySiteCfg = config.modules.system.nginx.mySite;
in
{ options.modules.system.nginx.mySite.git = { enable = mkEnableOption "system.nginx.mySite.git"; };
config = mkIf (cfg.enable && mySiteCfg) {
#security.acme = {
# certs = {
# "ramos.codes" = {
# #TODO: configure ACME certs
# };
# };
#};
#services.nginx = {
# #TODO: check if configure as vhost or stream
# streamConfig = services.nginx.streamConfig ++ {
# "*.ramos.codes" = {
# addSSL = true;
# onlySSL = true;
# forceSSL = true;
# acmeRoot = null;
# };
# };
#};
};
}

View file

@ -0,0 +1,23 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.tor;
in
{ options.modules.system.tor = { enable = mkEnableOption "system.tor"; };
config = mkIf cfg.enable {
imports = [ ./modules ];
services.tor = {
enable = true;
client = {
enable = lib.mkDefault true;
dns.enable = mkIf services.tor.client.enable true;
};
relay.enable = lib.mkDefault false;
enableGeoIP = false;
DoSConnectionEnabled = true;
DoSCircuitCreationEnabled = true;
};
};
}

View file

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

View file

@ -0,0 +1,16 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.system.tor.relay;
torCfg = config.modules.system.tor;
in
{ options.modules.system.tor.relay = { enable = mkEnableOption "system.tor.relay"; };
config = mkIf (cfg.enable && torCfg.enable) {
services.tor = {
client.enable = false;
relay.enable = true;
};
};
}

View file

@ -3,10 +3,11 @@
# Replace symlink at root of repo with user configs
{
options = {
user = lib.mkOption {
user = lib.mkOption rec {
type = lib.types.attrs;
default = {
name = "bryan";
email = "bryan@ramos.codes";
shell = pkgs.bash;
groups = [
@ -20,7 +21,7 @@
gitConfig = {
userName = "Bryan Ramos";
userEmail = "bryan@ramos.codes";
userEmail = "${default.user.email}";
signing = {
key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D";
signByDefault = true;