elnudrop: get git.elnu.com working
This commit is contained in:
parent
bbbea14c45
commit
e5f2d96e8e
4 changed files with 41 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
programs.git.enable = true;
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixVersions.stable; # flakes
|
||||
|
|
|
@ -13,9 +13,11 @@
|
|||
#./modules/headscale.nix
|
||||
./modules/tailscale.nix
|
||||
|
||||
./hosts/git.elnu.com
|
||||
#./hosts/jichan.org
|
||||
#./hosts/tegakituesday.com
|
||||
];
|
||||
fileSystems."/mnt/data" = { device = "/dev/sda"; fsType = "ext4"; };
|
||||
|
||||
networking = {
|
||||
# May cause some issues
|
||||
|
@ -33,12 +35,14 @@
|
|||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
/*
|
||||
virtualHosts."default" = {
|
||||
default = true;
|
||||
serverName = null;
|
||||
# https://stackoverflow.com/a/42802777
|
||||
locations."/".return = "444";
|
||||
};
|
||||
*/
|
||||
};
|
||||
|
||||
#services.do-agent.enable = true;
|
||||
|
|
|
@ -6,4 +6,5 @@
|
|||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/vda1"; fsType = "ext4"; };
|
||||
fileSystems."/mnt/data" = { device = "/dev/sda"; fsType = "ext4" };
|
||||
}
|
35
hosts/elnudrop/hosts/git.elnu.com/default.nix
Normal file
35
hosts/elnudrop/hosts/git.elnu.com/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, pkgs, lib, enableSSL, ... }:
|
||||
|
||||
let
|
||||
host = "git.elnu.com";
|
||||
port = 3000;
|
||||
in {
|
||||
services.forgejo = {
|
||||
package = pkgs.forgejo; # Don't use LTS
|
||||
enable = true;
|
||||
stateDir = "/mnt/data/forgejo";
|
||||
settings = {
|
||||
server = {
|
||||
HTTP_PORT = port;
|
||||
DOMAIN = host;
|
||||
SSH_DOMAIN = host;
|
||||
# security keys will get messed up if this isn't set exactly
|
||||
# will default to http://git.elnu.com:3000/ otherwise
|
||||
ROOT_URL = "https://${host}/";
|
||||
# make gravatar etc work
|
||||
OFFLINE_MODE = false;
|
||||
};
|
||||
service = {
|
||||
DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts."${host}" = {
|
||||
forceSSL = enableSSL;
|
||||
enableACME = enableSSL;
|
||||
default = true;
|
||||
locations = {
|
||||
"/".proxyPass = "http://localhost:${builtins.toString port}";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue