Compare commits

..

No commits in common. "77ac1db6980902ce57ae5ec80d12337d3eebc5b6" and "0efadb66ebffa566d392f335b8c10c4d14fbeb25" have entirely different histories.

13 changed files with 31 additions and 110 deletions

View file

@ -2,7 +2,6 @@
let let
theme = import ../modules/theme; theme = import ../modules/theme;
tailscale = import ../modules/tailscale;
in in
{ {
services = { services = {
@ -60,7 +59,6 @@ in
networking.extraHosts = '' networking.extraHosts = ''
192.168.0.26 elnuhub 192.168.0.26 elnuhub
24.199.72.8 elnudrop 24.199.72.8 elnudrop
${tailscale.hosts}
''; '';
#sound.enable = true; #sound.enable = true;
@ -79,8 +77,8 @@ in
}; };
fonts = { fonts = {
enableDefaultPackages = false; enableDefaultFonts = false;
packages = with pkgs; [ fonts = with pkgs; [
noto-fonts-cjk noto-fonts-cjk
noto-fonts noto-fonts
(nerdfonts.override { fonts = [ "FiraCode" ]; }) # required for icons (nerdfonts.override { fonts = [ "FiraCode" ]; }) # required for icons

View file

@ -1,4 +1,4 @@
{ config, ... }: { ... }:
{ {
imports = [ (import ./hardware-configuration.nix) ]; imports = [ (import ./hardware-configuration.nix) ];
@ -15,13 +15,6 @@
services.blueman.enable = true; services.blueman.enable = true;
services.tailscale.enable = true;
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport32Bit = true; # Required for Touhou driSupport32Bit = true; # Required for Touhou

View file

@ -1,10 +0,0 @@
{ config, ... }:
{
services.tailscale.enable = true;
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
}

View file

@ -1,37 +1,48 @@
{ lib, user, ... }: { lib, user, ... }:
let keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQNlGt62dBMojVCX7EUIia+wfSDfLzV4YCPi8SZ2xrp elnu@elnu.com"
]; in
{ {
imports = [ imports = [
./hardware-configuration.nix ./hardware-configuration.nix
# Remember to update for new instances # Remember to update for new instances
./networking.nix # generated at runtime by nixos-infect ./networking.nix # generated at runtime by nixos-infect
./modules/ssh.nix
./modules/headscale.nix
./modules/tailscale.nix
./hosts/jichan.org
]; ];
networking.firewall = { networking.firewall = {
enable = true; enable = true;
allowedTCPPorts = [ 80 443 ]; allowedTCPPorts = [ 80 443 ];
}; };
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
defaults.email = "elnu@elnu.com"; defaults.email = "elnu@elnu.com";
}; };
services.nginx = { services.nginx = {
enable = true; enable = true;
virtualHosts."default" = { virtualHosts = {
default = true; "default" = {
serverName = null; default = true;
# https://stackoverflow.com/a/42802777 serverName = null;
locations."/".return = "444"; # https://stackoverflow.com/a/42802777
locations."/".return = "444";
};
"jichan.org" = {
extraConfig = ''
error_page 502 /502.html;
'';
locations = {
"/" = {
proxyPass = "http://127.0.0.1:8000";
proxyWebsockets = true;
};
"/502.html".root = "${./hosts/jichan.org}";
"/logo.svg".root = "${./hosts/jichan.org}";
"/missing.min.css".root = "${./hosts/jichan.org}";
};
};
}; };
}; };
services.do-agent.enable = true; services.do-agent.enable = true;
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = keys;
users.users.${user}.openssh.authorizedKeys.keys = keys;
} }

View file

@ -1,18 +0,0 @@
{
services.nginx.virtualHosts."jichan.org" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
error_page 502 /502.html;
'';
locations = {
"/" = {
proxyPass = with import ../../../../modules/tailscale/default.nix; "http://${elnuhub}:3334";
proxyWebsockets = true;
};
"/502.html".root = "${./502}";
"/logo.svg".root = "${./502}";
"/missing.min.css".root = "${./502}";
};
};
}

View file

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View file

@ -1,25 +0,0 @@
{ config, ... }:
let
baseDomain = "elnu.com";
domain = "headscale.${baseDomain}";
in {
services.headscale = {
enable = true;
address = "0.0.0.0";
port = 8080;
settings = {
server_url = "https://${domain}";
dns_config.base_domain = baseDomain;
};
};
environment.systemPackages = [ config.services.headscale.package ];
services.nginx.virtualHosts.${domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${ toString config.services.headscale.port }";
proxyWebsockets = true;
};
};
}

View file

@ -1,10 +0,0 @@
{ user, ... }:
let keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQNlGt62dBMojVCX7EUIia+wfSDfLzV4YCPi8SZ2xrp elnu@elnu.com"
]; in
{
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = keys;
users.users.${user}.openssh.authorizedKeys.keys = keys;
}

View file

@ -1,10 +0,0 @@
{ config, ... }:
{
services.tailscale.enable = true;
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
}

View file

@ -21,7 +21,7 @@ in
../modules/terminal ../modules/terminal
../modules/todo-txt ../modules/todo-txt
#../modules/fantasia-archive ../modules/fantasia-archive
]; ];
home.file."./.background-image".source = theme.wallpaper; home.file."./.background-image".source = theme.wallpaper;

View file

@ -1,8 +0,0 @@
rec {
elnu = "100.64.0.1";
elnudrop = "100.64.0.2";
elnuhub = "100.64.0.3";
hosts = ''
elnu ${elnu}
'';
}