website
This commit is contained in:
parent
2897fb75a5
commit
e97d5e7152
|
@ -8,20 +8,17 @@
|
||||||
./services/nginx.nix
|
./services/nginx.nix
|
||||||
./services/openssh.nix
|
./services/openssh.nix
|
||||||
./services/forgejo.nix
|
./services/forgejo.nix
|
||||||
# ./services/nextcloud.nix
|
|
||||||
# ./services/seafile.nix
|
|
||||||
./services/vaultwarden.nix
|
./services/vaultwarden.nix
|
||||||
./services/jellyfin.nix
|
./services/jellyfin.nix
|
||||||
./services/website.nix
|
./services/website.nix
|
||||||
./services/mailserver.nix
|
./services/mailserver.nix
|
||||||
./services/fail2ban.nix
|
./services/fail2ban.nix
|
||||||
|
|
||||||
./services/zed.nix # IMPORTANTE
|
./services/zed.nix # IMPORTANTE
|
||||||
|
|
||||||
./services/auto-torrent.nix
|
./services/auto-torrent.nix
|
||||||
|
|
||||||
./services/misc.nix
|
./services/misc.nix
|
||||||
|
|
||||||
|
./services/website.nix
|
||||||
|
|
||||||
./modules/age.nix
|
./modules/age.nix
|
||||||
./modules/git.nix
|
./modules/git.nix
|
||||||
./modules/nix-settings.nix
|
./modules/nix-settings.nix
|
||||||
|
|
|
@ -5,17 +5,6 @@
|
||||||
recommendedOptimisation = true;
|
recommendedOptimisation = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
|
|
||||||
virtualHosts."spoodythe.one" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
default = true;
|
|
||||||
locations."/" = {
|
|
||||||
extraConfig = ''
|
|
||||||
deny all;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
security.acme.acceptTerms = true;
|
security.acme.acceptTerms = true;
|
||||||
|
|
|
@ -5,12 +5,44 @@
|
||||||
}: let
|
}: let
|
||||||
host = "127.0.0.1";
|
host = "127.0.0.1";
|
||||||
port = 8080;
|
port = 8080;
|
||||||
|
user = "website-host-user";
|
||||||
|
uid = 1900;
|
||||||
in {
|
in {
|
||||||
services.nginx.virtualHosts."spoodythe.one" = {
|
services.nginx.virtualHosts."spoodythe.one" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
default = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${host}:${toString port}";
|
proxyPass = "http://${host}:${toString port}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.users."website-host-user" = {
|
||||||
|
isNormalUser = true;
|
||||||
|
inherit uid;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services."run-website" = {
|
||||||
|
description = "Service for running my website";
|
||||||
|
wants = ["network-online.target"];
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
|
||||||
|
preStart = ''
|
||||||
|
if [ ! -d "/home/${user}/website" ]; then
|
||||||
|
${pkgs.git}/bin/git clone https://gitlab.com/SpoodyTheOne/webbisitey/ "/home/${user}/website"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
cd /home/${user}/website
|
||||||
|
${pkgs.git}/bin/git pull
|
||||||
|
${pkgs.nix}/bin/nix run
|
||||||
|
'';
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
User = user;
|
||||||
|
# WorkingDirectory = "/home/${user}/website";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue