mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-23 16:29:42 -04:00
progress
This commit is contained in:
parent
1d52958cde
commit
974f185b00
12 changed files with 168 additions and 7 deletions
|
|
@ -7,10 +7,7 @@ let
|
||||||
in
|
in
|
||||||
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
|
{ options.modules.system.bitcoin = { enable = mkEnableOption "system.bitcoin"; };
|
||||||
|
|
||||||
imports = [
|
imports = [ ./modules ];
|
||||||
./core-lightning
|
|
||||||
./sparrow-cli
|
|
||||||
];
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.bash.shellAliases = {
|
programs.bash.shellAliases = {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./core-lightning
|
./core-lightning
|
||||||
./electrs
|
./electrs
|
||||||
./sparrow-cli
|
./sparrow-server
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./bitcoin
|
./bitcoin
|
||||||
|
./nginx
|
||||||
|
./tor
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
21
src/system/modules/nginx/default.nix
Normal file
21
src/system/modules/nginx/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
5
src/system/modules/nginx/sites/default.nix
Normal file
5
src/system/modules/nginx/sites/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./mySite
|
||||||
|
];
|
||||||
|
}
|
||||||
30
src/system/modules/nginx/sites/mySite/default.nix
Normal file
30
src/system/modules/nginx/sites/mySite/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#};
|
||||||
|
};
|
||||||
|
}
|
||||||
23
src/system/modules/tor/default.nix
Normal file
23
src/system/modules/tor/default.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
5
src/system/modules/tor/modules/default.nix
Normal file
5
src/system/modules/tor/modules/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./relay
|
||||||
|
];
|
||||||
|
}
|
||||||
16
src/system/modules/tor/modules/relay.nix
Normal file
16
src/system/modules/tor/modules/relay.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -3,10 +3,11 @@
|
||||||
# Replace symlink at root of repo with user configs
|
# Replace symlink at root of repo with user configs
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
user = lib.mkOption {
|
user = lib.mkOption rec {
|
||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
default = {
|
default = {
|
||||||
name = "bryan";
|
name = "bryan";
|
||||||
|
email = "bryan@ramos.codes";
|
||||||
shell = pkgs.bash;
|
shell = pkgs.bash;
|
||||||
|
|
||||||
groups = [
|
groups = [
|
||||||
|
|
@ -20,7 +21,7 @@
|
||||||
|
|
||||||
gitConfig = {
|
gitConfig = {
|
||||||
userName = "Bryan Ramos";
|
userName = "Bryan Ramos";
|
||||||
userEmail = "bryan@ramos.codes";
|
userEmail = "${default.user.email}";
|
||||||
signing = {
|
signing = {
|
||||||
key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D";
|
key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D";
|
||||||
signByDefault = true;
|
signByDefault = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue