diff --git a/hosts/desktop.nix b/hosts/desktop.nix index 25233e0..9d51130 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -2,7 +2,6 @@ let theme = import ../modules/theme; - tailscale = import ../modules/tailscale; in { services = { @@ -60,7 +59,6 @@ in networking.extraHosts = '' 192.168.0.26 elnuhub 24.199.72.8 elnudrop - ${tailscale.hosts} ''; #sound.enable = true; @@ -79,8 +77,8 @@ in }; fonts = { - enableDefaultPackages = false; - packages = with pkgs; [ + enableDefaultFonts = false; + fonts = with pkgs; [ noto-fonts-cjk noto-fonts (nerdfonts.override { fonts = [ "FiraCode" ]; }) # required for icons diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 810905a..ee97a05 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ ... }: { imports = [ (import ./hardware-configuration.nix) ]; @@ -15,13 +15,6 @@ services.blueman.enable = true; - services.tailscale.enable = true; - networking.firewall = { - checkReversePath = "loose"; - trustedInterfaces = [ "tailscale0" ]; - allowedUDPPorts = [ config.services.tailscale.port ]; - }; - hardware.opengl = { enable = true; driSupport32Bit = true; # Required for Touhou diff --git a/hosts/desktop/modules/tailscale.nix b/hosts/desktop/modules/tailscale.nix deleted file mode 100644 index 8ef6967..0000000 --- a/hosts/desktop/modules/tailscale.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, ... }: - -{ - services.tailscale.enable = true; - networking.firewall = { - checkReversePath = "loose"; - trustedInterfaces = [ "tailscale0" ]; - allowedUDPPorts = [ config.services.tailscale.port ]; - }; -} \ No newline at end of file diff --git a/hosts/elnudrop/default.nix b/hosts/elnudrop/default.nix index d29a299..c514b77 100644 --- a/hosts/elnudrop/default.nix +++ b/hosts/elnudrop/default.nix @@ -1,37 +1,48 @@ { lib, user, ... }: - +let keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQNlGt62dBMojVCX7EUIia+wfSDfLzV4YCPi8SZ2xrp elnu@elnu.com" +]; in { imports = [ ./hardware-configuration.nix # Remember to update for new instances ./networking.nix # generated at runtime by nixos-infect - - ./modules/ssh.nix - ./modules/headscale.nix - ./modules/tailscale.nix - - ./hosts/jichan.org ]; - networking.firewall = { enable = true; allowedTCPPorts = [ 80 443 ]; }; - security.acme = { acceptTerms = true; defaults.email = "elnu@elnu.com"; }; - services.nginx = { enable = true; - virtualHosts."default" = { - default = true; - serverName = null; - # https://stackoverflow.com/a/42802777 - locations."/".return = "444"; + virtualHosts = { + "default" = { + default = true; + serverName = null; + # 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.openssh.enable = true; + users.users.root.openssh.authorizedKeys.keys = keys; + users.users.${user}.openssh.authorizedKeys.keys = keys; } \ No newline at end of file diff --git a/hosts/elnudrop/hosts/jichan.org/502/502.html b/hosts/elnudrop/hosts/jichan.org/502.html similarity index 100% rename from hosts/elnudrop/hosts/jichan.org/502/502.html rename to hosts/elnudrop/hosts/jichan.org/502.html diff --git a/hosts/elnudrop/hosts/jichan.org/default.nix b/hosts/elnudrop/hosts/jichan.org/default.nix deleted file mode 100644 index 9cdf1b9..0000000 --- a/hosts/elnudrop/hosts/jichan.org/default.nix +++ /dev/null @@ -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}"; - }; - }; -} \ No newline at end of file diff --git a/hosts/elnudrop/hosts/jichan.org/502/logo.svg b/hosts/elnudrop/hosts/jichan.org/logo.svg similarity index 100% rename from hosts/elnudrop/hosts/jichan.org/502/logo.svg rename to hosts/elnudrop/hosts/jichan.org/logo.svg diff --git a/hosts/elnudrop/hosts/jichan.org/502/missing.min.css b/hosts/elnudrop/hosts/jichan.org/missing.min.css similarity index 100% rename from hosts/elnudrop/hosts/jichan.org/502/missing.min.css rename to hosts/elnudrop/hosts/jichan.org/missing.min.css diff --git a/hosts/elnudrop/modules/headscale.nix b/hosts/elnudrop/modules/headscale.nix deleted file mode 100644 index 909f233..0000000 --- a/hosts/elnudrop/modules/headscale.nix +++ /dev/null @@ -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; - }; - }; -} \ No newline at end of file diff --git a/hosts/elnudrop/modules/ssh.nix b/hosts/elnudrop/modules/ssh.nix deleted file mode 100644 index e21f15c..0000000 --- a/hosts/elnudrop/modules/ssh.nix +++ /dev/null @@ -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; -} \ No newline at end of file diff --git a/hosts/elnudrop/modules/tailscale.nix b/hosts/elnudrop/modules/tailscale.nix deleted file mode 100644 index 8ef6967..0000000 --- a/hosts/elnudrop/modules/tailscale.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, ... }: - -{ - services.tailscale.enable = true; - networking.firewall = { - checkReversePath = "loose"; - trustedInterfaces = [ "tailscale0" ]; - allowedUDPPorts = [ config.services.tailscale.port ]; - }; -} \ No newline at end of file diff --git a/hosts/home-desktop.nix b/hosts/home-desktop.nix index 6f3a0b4..9857763 100644 --- a/hosts/home-desktop.nix +++ b/hosts/home-desktop.nix @@ -21,7 +21,7 @@ in ../modules/terminal ../modules/todo-txt - #../modules/fantasia-archive + ../modules/fantasia-archive ]; home.file."./.background-image".source = theme.wallpaper; diff --git a/modules/tailscale/default.nix b/modules/tailscale/default.nix deleted file mode 100644 index 870cf93..0000000 --- a/modules/tailscale/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -rec { - elnu = "100.64.0.1"; - elnudrop = "100.64.0.2"; - elnuhub = "100.64.0.3"; - hosts = '' - elnu ${elnu} - ''; -} \ No newline at end of file