doing box stuff

This commit is contained in:
Anish L 2022-04-26 20:06:44 +10:00
parent 54d3329af7
commit d76bcd0e88
7 changed files with 60 additions and 57 deletions

View file

@ -65,7 +65,7 @@
}; };
networking.hostName = "box"; # Define your hostname. networking.hostName = "box"; # Define your hostname.
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# The global useDHCP flag is deprecated, therefore explicitly set to false here. # The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config # Per-interface useDHCP will be mandatory in the future, so this generated config

View file

@ -19,7 +19,8 @@ let
paths = [ configFile "${cfg.package}/app" ]; paths = [ configFile "${cfg.package}/app" ];
}; };
in { in
{
options = { options = {
@ -86,23 +87,23 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.phpfpm.pools."${poolName}" = { services.phpfpm.pools."${poolName}" = {
user = "${cfg.user}"; user = "${cfg.user}";
group = "nginx"; group = "nginx";
settings = { settings = {
"listen.owner" = "nginx"; "listen.owner" = "nginx";
"listen.group" = "nginx"; "listen.group" = "nginx";
"listen.mode" = "0600"; "listen.mode" = "0600";
"user" = "${cfg.user}"; "user" = "${cfg.user}";
"group" = "nginx"; "group" = "nginx";
"env[WALLABAG_DATA]" = "${cfg.dataDir}"; "env[WALLABAG_DATA]" = "${cfg.dataDir}";
"pm" = "dynamic"; "pm" = "dynamic";
"pm.max_children" = "75"; "pm.max_children" = "75";
"pm.min_spare_servers" = "5"; "pm.min_spare_servers" = "5";
"pm.max_spare_servers" = "20"; "pm.max_spare_servers" = "20";
"pm.max_requests" = "10"; "pm.max_requests" = "10";
"catch_workers_output" = "1"; "catch_workers_output" = "1";
"php_admin_value[error_log]" = "/var/log/nginx/${poolName}-phpfpm-error.log"; "php_admin_value[error_log]" = "/var/log/nginx/${poolName}-phpfpm-error.log";
}; };
}; };
services.phpfpm.phpOptions = '' services.phpfpm.phpOptions = ''
max_execution_time = 120 max_execution_time = 120
@ -176,7 +177,7 @@ in {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
before = [ "phpfpm-wallabag.service" ]; before = [ "phpfpm-wallabag.service" ];
after = [ "mysql.service" "postgresql.service" ]; after = [ "mysql.service" "postgresql.service" ];
path = with pkgs; [ coreutils php phpPackages.composer ]; path = with pkgs; [ coreutils php74 php74Packages.composer ];
serviceConfig = { serviceConfig = {
User = cfg.user; User = cfg.user;
@ -201,6 +202,7 @@ in {
export WALLABAG_DATA="${cfg.dataDir}" export WALLABAG_DATA="${cfg.dataDir}"
if [ ! -f installed ]; then if [ ! -f installed ]; then
echo "Install file not found, installing ..."
php ${cfg.package}/bin/console --env=prod doctrine:database:create --if-not-exists --no-interaction php ${cfg.package}/bin/console --env=prod doctrine:database:create --if-not-exists --no-interaction
php ${cfg.package}/bin/console --env=prod doctrine:migrations:migrate --no-interaction php ${cfg.package}/bin/console --env=prod doctrine:migrations:migrate --no-interaction
# Until https://github.com/wallabag/wallabag/issues/3662 is fixed # Until https://github.com/wallabag/wallabag/issues/3662 is fixed

View file

@ -1,8 +1,8 @@
{config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
services.headphones = { services.headphones = {
enable = true; enable = true;
host = "172.16.11.240"; host = "192.168.1.240";
port = 8181; port = 8181;
user = "headphones"; user = "headphones";
group = "audio"; group = "audio";

View file

@ -1,12 +1,12 @@
{ {
networking.extraHosts = '' networking.extraHosts = ''
10.0.69.4 mossnet.lan 192.168.1.240 mossnet.lan
10.0.69.4 links.mossnet.lan 192.168.1.240 links.mossnet.lan
10.0.69.4 read.mossnet.lan 192.168.1.240 read.mossnet.lan
10.0.69.4 stats.mossnet.lan 192.168.1.240 stats.mossnet.lan
''; '';
#192.168.1.240 mossnet.lan # 10.0.69.4 mossnet.lan
#192.168.1.240 links.mossnet.lan # 10.0.69.4 links.mossnet.lan
#192.168.1.240 read.mossnet.lan # 10.0.69.4 read.mossnet.lan
#192.168.1.240 stats.mossnet.lan # 10.0.69.4 stats.mossnet.lan
} }

View file

@ -8,7 +8,7 @@
enable = true; enable = true;
hostName = "mossnet.lan"; hostName = "mossnet.lan";
home = "/data/nextcloud"; home = "/data/nextcloud";
package = pkgs.nextcloud21; package = pkgs.nextcloud22;
# Use HTTPS for links # Use HTTPS for links
https = false; https = false;
@ -41,16 +41,17 @@
# Ensure the database, user, and permissions always exist # Ensure the database, user, and permissions always exist
ensureDatabases = [ "nextcloud" ]; ensureDatabases = [ "nextcloud" ];
ensureUsers = [ ensureUsers = [
{ name = "nextcloud"; {
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES"; name = "nextcloud";
} ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
]; ];
}; };
# Ensure that postgres is running before running the setup # Ensure that postgres is running before running the setup
systemd.services."nextcloud-setup" = { systemd.services."nextcloud-setup" = {
requires = ["postgresql.service"]; requires = [ "postgresql.service" ];
after = ["postgresql.service"]; after = [ "postgresql.service" ];
}; };
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];

View file

@ -31,7 +31,7 @@
#allowedIPs = [ "10.100.0.1" "91.108.12.0/22" ]; #allowedIPs = [ "10.100.0.1" "91.108.12.0/22" ];
# Set this to the server IP and port. # Set this to the server IP and port.
endpoint = "sealight.xyz:60990"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577 endpoint = "149.28.163.78:60990"; # ToDo: route to endpoint not automatically configured https://wiki.archlinux.org/index.php/WireGuard#Loop_routing https://discourse.nixos.org/t/solved-minimal-firewall-setup-for-wireguard-client/7577
# Send keepalives every 25 seconds. Important to keep NAT tables alive. # Send keepalives every 25 seconds. Important to keep NAT tables alive.
persistentKeepalive = 25; persistentKeepalive = 25;
@ -40,22 +40,22 @@
}; };
}; };
# boot.extraModulePackages = with config.boot.kernelPackages; [ wireguard ]; # boot.extraModulePackages = with config.boot.kernelPackages; [ wireguard ];
# environment.systemPackages = [ pkgs.wireguard ]; # environment.systemPackages = [ pkgs.wireguard ];
# networking.wireguard.enable = true; # networking.wireguard.enable = true;
# networking.wireguard.interfaces = { # networking.wireguard.interfaces = {
# wg0 = { # wg0 = {
# ips = [ "10.0.69.4/32" ]; # ips = [ "10.0.69.4/32" ];
# privateKeyFile = "/home/anish/wg/privkey"; # privateKeyFile = "/home/anish/wg/privkey";
# listenPort = 60990; # listenPort = 60990;
# #
# peers = [ # peers = [
# { # helix - server # { # helix - server
# publicKey = "{c1J4p63rD3IlszugMZiki7UBV3YmDdqa3DU4UejXzAI=}"; # publicKey = "{c1J4p63rD3IlszugMZiki7UBV3YmDdqa3DU4UejXzAI=}";
# allowedIPs = [ "10.0.69.1/24" ]; # allowedIPs = [ "10.0.69.1/24" ];
# endpoint = "sealight.xyz:60990"; # endpoint = "sealight.xyz:60990";
# persistentKeepalive = 25; # persistentKeepalive = 25;
# } ]; # } ];
# }; # };
# }; # };
} }

View file

@ -176,7 +176,7 @@ in
" general commands " general commands
map <leader>t :NERDTreeToggle<CR> map <leader>t :NERDTreeToggle<CR>
map <leader>s :w<CR> map <leader>s :w<CR>
map <leader>q :wq<CR> map <leader>q :q<CR>
map <leader>r :RainbowParenthesesToggleAll<CR> map <leader>r :RainbowParenthesesToggleAll<CR>
map <leader><BS> :noh<CR> map <leader><BS> :noh<CR>
nnoremap Y y$ nnoremap Y y$