From 86e8c8c9ece43a2287349ff852cc602b76f70b01 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Thu, 10 Aug 2023 15:29:06 -0700 Subject: [PATCH 1/7] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/b2ac1d2c32ac11b8d231d23622cdc4b2f28d07d2' (2023-08-02) → 'github:nix-community/home-manager/6e1eff9aac0e8d84bda7f2d60ba6108eea9b7e79' (2023-08-10) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/9e1960bc196baf6881340d53dccb203a951745a2' (2023-08-01) → 'github:nixos/nixpkgs/ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e' (2023-08-10) • Updated input 'nixvim': 'github:nix-community/nixvim/4c25722d73694245e767839b462026ab2296542b' (2023-07-23) → 'github:nix-community/nixvim/36a6ab4ba7403dca50b2ca2de5fd5fd57fb19335' (2023-08-10) • Updated input 'nixvim/nixpkgs': 'github:NixOS/nixpkgs/12303c652b881435065a98729eb7278313041e49' (2023-07-22) → 'github:NixOS/nixpkgs/18036c0be90f4e308ae3ebcab0e14aae0336fe42' (2023-08-04) • Updated input 'nixvim/pre-commit-hooks': 'github:cachix/pre-commit-hooks.nix/eb433bff05b285258be76513add6f6c57b441775' (2023-07-18) → 'github:cachix/pre-commit-hooks.nix/3139c4d1f7732cab89f06492bdd4677b877e3785' (2023-08-05) --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index d42abbb..25d927f 100644 --- a/flake.lock +++ b/flake.lock @@ -104,11 +104,11 @@ ] }, "locked": { - "lastModified": 1690982105, - "narHash": "sha256-32AzoLuwhtxBItcULRiCnxRfJcbVXbPZSH9TDVg21mU=", + "lastModified": 1691672736, + "narHash": "sha256-HNPA/dKHerA0p4OsToEcW/DtTSXBcK5gFRsy/yPgV/Y=", "owner": "nix-community", "repo": "home-manager", - "rev": "b2ac1d2c32ac11b8d231d23622cdc4b2f28d07d2", + "rev": "6e1eff9aac0e8d84bda7f2d60ba6108eea9b7e79", "type": "github" }, "original": { @@ -119,11 +119,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1690881714, - "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9e1960bc196baf6881340d53dccb203a951745a2", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", "type": "github" }, "original": { @@ -151,11 +151,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1690031011, - "narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=", + "lastModified": 1691186842, + "narHash": "sha256-wxBVCvZUwq+XS4N4t9NqsHV4E64cPVqQ2fdDISpjcw0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12303c652b881435065a98729eb7278313041e49", + "rev": "18036c0be90f4e308ae3ebcab0e14aae0336fe42", "type": "github" }, "original": { @@ -173,11 +173,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1690107839, - "narHash": "sha256-ll3j+g3qz239sfLHYhHynKRWhMkxFXsJ9MOAXzSqQMc=", + "lastModified": 1691674049, + "narHash": "sha256-M9SA4MZ3IuFCP4XI2IGAepvEYp3stmTwltUcnGu3Ml8=", "owner": "nix-community", "repo": "nixvim", - "rev": "4c25722d73694245e767839b462026ab2296542b", + "rev": "36a6ab4ba7403dca50b2ca2de5fd5fd57fb19335", "type": "github" }, "original": { @@ -225,11 +225,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1689668210, - "narHash": "sha256-XAATwDkaUxH958yXLs1lcEOmU6pSEIkatY3qjqk8X0E=", + "lastModified": 1691256628, + "narHash": "sha256-M0YXHemR3zbyhM7PvJa5lzGhWVf6kM/fpZ4cWe/VIhI=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "eb433bff05b285258be76513add6f6c57b441775", + "rev": "3139c4d1f7732cab89f06492bdd4677b877e3785", "type": "github" }, "original": { From 6176753e711738b4db011ed5d7e74da6953e1706 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Fri, 11 Aug 2023 11:44:06 -0700 Subject: [PATCH 2/7] elnudrop: define enableSSL special argument --- hosts/default.nix | 23 ++++++++++--------- hosts/elnudrop/hosts/jichan.org/default.nix | 10 ++++---- .../hosts/tegakituesday.com/default.nix | 10 ++++---- hosts/elnudrop/modules/headscale.nix | 6 ++--- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/hosts/default.nix b/hosts/default.nix index 670037b..69d2b16 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -7,6 +7,9 @@ let config.allowUnfree = true; }; lib = nixpkgs.lib; + configImports = [ + ./configuration.nix + ]; hmImports = [ (import ./home.nix) inputs.nixvim.homeManagerModules.nixvim @@ -20,9 +23,8 @@ in desktop = lib.nixosSystem { inherit system; specialArgs = { inherit user; }; - modules = [ + modules = configImports ++ [ ./desktop - ./configuration.nix ./desktop.nix { boot.loader.grub.gfxmodeEfi = "1920x1080"; @@ -46,9 +48,8 @@ in x220 = lib.nixosSystem { inherit system; specialArgs = { inherit user; }; - modules = [ + modules = configImports ++ [ ./thinkpads - ./configuration.nix ./desktop.nix { # 1024x768 is the closest supported resolution to X220's native 1366x768 @@ -74,9 +75,8 @@ in t430 = lib.nixosSystem { inherit system; specialArgs = { inherit user; }; - modules = [ + modules = configImports ++ [ ./thinkpads - ./configuration.nix ./desktop.nix { boot.loader.grub.gfxmodeEfi = "1600x900"; @@ -99,9 +99,8 @@ in virtualbox = lib.nixosSystem { inherit system; specialArgs = { inherit user; }; - modules = [ + modules = configImports ++ [ ./virtualbox - ./configuration.nix ./desktop.nix { networking.hostName = "virtualbox"; @@ -122,10 +121,12 @@ in elnudrop = lib.nixosSystem { inherit system; - specialArgs = { inherit user; }; - modules = [ + specialArgs = { + inherit user; + enableSSL = true; + }; + modules = configImports ++ [ ./elnudrop - ./configuration.nix { networking.hostName = "elnudrop"; } diff --git a/hosts/elnudrop/hosts/jichan.org/default.nix b/hosts/elnudrop/hosts/jichan.org/default.nix index 372a65a..a5f5c0c 100644 --- a/hosts/elnudrop/hosts/jichan.org/default.nix +++ b/hosts/elnudrop/hosts/jichan.org/default.nix @@ -1,12 +1,14 @@ +{ enableSSL, ... }: + let host = "jichan.org"; in { services.nginx.virtualHosts."www.${host}" = { - forceSSL = true; - enableACME = true; + forceSSL = enableSSL; + enableACME = enableSSL; globalRedirect = host; }; services.nginx.virtualHosts."${host}" = { - forceSSL = true; - enableACME = true; + forceSSL = enableSSL; + enableACME = enableSSL; extraConfig = '' error_page 502 /502.html; ''; diff --git a/hosts/elnudrop/hosts/tegakituesday.com/default.nix b/hosts/elnudrop/hosts/tegakituesday.com/default.nix index 64d256c..726af23 100644 --- a/hosts/elnudrop/hosts/tegakituesday.com/default.nix +++ b/hosts/elnudrop/hosts/tegakituesday.com/default.nix @@ -1,13 +1,15 @@ +{ enableSSL, ... }: + with import ../../../../modules/tailscale/default.nix; let host = "tegakituesday.com"; in { services.nginx.virtualHosts."www.${host}" = { - forceSSL = true; - enableACME = true; + forceSSL = enableSSL; + enableACME = enableSSL; globalRedirect = host; }; services.nginx.virtualHosts."${host}" = { - forceSSL = true; - enableACME = true; + forceSSL = enableSSL; + enableACME = enableSSL; extraConfig = '' error_page 502 /502.html; ''; diff --git a/hosts/elnudrop/modules/headscale.nix b/hosts/elnudrop/modules/headscale.nix index 6463a0f..878b638 100644 --- a/hosts/elnudrop/modules/headscale.nix +++ b/hosts/elnudrop/modules/headscale.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, enableSSL, ... }: let baseDomain = "elnu.com"; @@ -18,8 +18,8 @@ in { }; environment.systemPackages = [ config.services.headscale.package ]; services.nginx.virtualHosts.${domain} = { - forceSSL = true; - enableACME = true; + forceSSL = enableSSL; + enableACME = enableSSL; locations."/" = { proxyPass = "http://localhost:${ toString config.services.headscale.port }"; proxyWebsockets = true; From f3849e3eb66c9497587f0ad8a67ecccf0b37cf54 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Fri, 11 Aug 2023 12:20:19 -0700 Subject: [PATCH 3/7] desktop: make nameservers work with resolvconf, switch to quad9 --- hosts/desktop.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosts/desktop.nix b/hosts/desktop.nix index 6f5152c..fd9d3a0 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -34,7 +34,9 @@ in networking = { networkmanager.enable = true; - nameservers = [ "1.1.1.1" "1.0.0.1" ]; + # networking.nameservers doesn't apply to resolvconf + # nameservers = [ "9.9.9.9" "1.1.1.1" ]; + resolvconf.extraConfig = "name_servers=\"9.9.9.9 1.1.1.1\""; }; xdg.portal.enable = true; From 2ce25bb2186957dcc949c7fddcf81304665b5b6c Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Fri, 11 Aug 2023 19:29:28 -0700 Subject: [PATCH 4/7] Explicitly declare hosts and nameservers in general config --- hosts/configuration.nix | 15 +++++++++++++++ hosts/desktop.nix | 7 ------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hosts/configuration.nix b/hosts/configuration.nix index d4096ba..16c4b23 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -22,6 +22,21 @@ extraOptions = "experimental-features = nix-command flakes"; }; + networking = { + networkmanager.enable = true; + # networking.nameservers doesn't apply to resolvconf + #nameservers = [ "9.9.9.9" "1.1.1.1" ]; + resolvconf.extraConfig = "name_servers=\"9.9.9.9 1.1.1.1\""; + # Temporary since MagicDNS is broken + hosts = { + "192.168.0.26" = [ "elnuhub.local" ]; + "24.199.72.8" = [ "elnudrop.local" ]; + "100.64.0.1" = [ "elnu" ]; + "100.64.0.2" = [ "elnuhub" ]; + "100.64.0.3" = [ "elnudrop" ]; + }; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/hosts/desktop.nix b/hosts/desktop.nix index fd9d3a0..23afc22 100644 --- a/hosts/desktop.nix +++ b/hosts/desktop.nix @@ -32,13 +32,6 @@ in gvfs.enable = true; # For Trash }; - networking = { - networkmanager.enable = true; - # networking.nameservers doesn't apply to resolvconf - # nameservers = [ "9.9.9.9" "1.1.1.1" ]; - resolvconf.extraConfig = "name_servers=\"9.9.9.9 1.1.1.1\""; - }; - xdg.portal.enable = true; environment.systemPackages = with pkgs; [ yubioath-flutter ]; From 4bbd00cc9f6c6c49170f4c2dd31fde63fea27c8b Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 12 Aug 2023 12:03:40 -0700 Subject: [PATCH 5/7] elnudrop: disable networkmanager --- hosts/elnudrop/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hosts/elnudrop/default.nix b/hosts/elnudrop/default.nix index 116aede..6f6db61 100644 --- a/hosts/elnudrop/default.nix +++ b/hosts/elnudrop/default.nix @@ -14,9 +14,13 @@ ./hosts/tegakituesday.com ]; - networking.firewall = { - enable = true; - allowedTCPPorts = [ 80 443 ]; + networking = { + # May cause some issues + networkmanager.enable = lib.mkForce false; + firewall = { + enable = true; + allowedTCPPorts = [ 80 443 ]; + }; }; security.acme = { From c393cbb98f8a412d8219eec1d7d4105272fb8c63 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 12 Aug 2023 12:04:37 -0700 Subject: [PATCH 6/7] elnudrop: host tatoeba API --- flake.lock | 126 ++++++++++++++++++-- flake.nix | 1 + hosts/default.nix | 1 + hosts/elnudrop/default.nix | 2 + hosts/elnudrop/hosts/jichan.org/default.nix | 8 +- 5 files changed, 123 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 25d927f..33bba77 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,24 @@ { "nodes": { + "apis": { + "inputs": { + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1691779970, + "narHash": "sha256-NMrLx5FJ/ueTw4FYKqZ9FBh+H1fVXnAs7Vvr+9By8N0=", + "ref": "refs/heads/main", + "rev": "e90adfaf87c68785af0f66becb0d5c8fc59b9e2f", + "revCount": 15, + "type": "git", + "url": "https://git.elnu.com/jichan.org/apis.git" + }, + "original": { + "type": "git", + "url": "https://git.elnu.com/jichan.org/apis.git" + } + }, "beautysh": { "inputs": { "nixpkgs": [ @@ -43,6 +62,24 @@ "inputs": { "systems": "systems" }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, "locked": { "lastModified": 1689068808, "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", @@ -57,9 +94,9 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_3": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1685518550, @@ -119,15 +156,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1691654369, - "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", - "owner": "nixos", + "lastModified": 1691472822, + "narHash": "sha256-XVfYZ2oB3lNPVq6sHCY9WkdQ8lHoIDzzbpg8bB6oBxA=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", + "rev": "41c7605718399dcfa53dd7083793b6ae3bc969ff", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -150,6 +187,38 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1681358109, + "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1691186842, "narHash": "sha256-wxBVCvZUwq+XS4N4t9NqsHV4E64cPVqQ2fdDISpjcw0=", @@ -168,8 +237,8 @@ "nixvim": { "inputs": { "beautysh": "beautysh", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_4", "pre-commit-hooks": "pre-commit-hooks" }, "locked": { @@ -216,7 +285,7 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "gitignore": "gitignore", "nixpkgs": [ "nixvim", @@ -240,11 +309,31 @@ }, "root": { "inputs": { + "apis": "apis", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_3", "nixvim": "nixvim" } }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1691591308, + "narHash": "sha256-eeErUrPWCQwFHESL3vpNwkl8oyJPV6SRrVS9cPTEvYI=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "094512d7a7573ae2cb6db1a5ce4745a69b16fa46", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -275,6 +364,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1678901627, diff --git a/flake.nix b/flake.nix index 299fbb2..800babe 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixvim.url = "github:nix-community/nixvim"; + apis.url = "git+https://git.elnu.com/jichan.org/apis.git"; home-manager = { url = github:nix-community/home-manager; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/default.nix b/hosts/default.nix index 69d2b16..d46dd51 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -8,6 +8,7 @@ let }; lib = nixpkgs.lib; configImports = [ + inputs.apis.nixosModules.default ./configuration.nix ]; hmImports = [ diff --git a/hosts/elnudrop/default.nix b/hosts/elnudrop/default.nix index 6f6db61..8092fa7 100644 --- a/hosts/elnudrop/default.nix +++ b/hosts/elnudrop/default.nix @@ -39,4 +39,6 @@ }; services.do-agent.enable = true; + + services.tatoeba.enable = true; } \ No newline at end of file diff --git a/hosts/elnudrop/hosts/jichan.org/default.nix b/hosts/elnudrop/hosts/jichan.org/default.nix index a5f5c0c..0afde18 100644 --- a/hosts/elnudrop/hosts/jichan.org/default.nix +++ b/hosts/elnudrop/hosts/jichan.org/default.nix @@ -19,18 +19,18 @@ let host = "jichan.org"; in { "/missing.min.css".root = "${../shared/502}"; # Formerly tatoeba.elnu.com - # https://git.elnu.com/ElnuDev/tatoeba-api + # https://git.elnu.com/jichan.org/apis "/api/tatoeba/" = { - proxyPass = "http://elnuhub:3001"; + proxyPass = "http://localhost:3001"; extraConfig = '' rewrite ^/api/tatoeba/(.*) /$1 break; ''; }; # Formerly images.elnu.com - # https://git.elnu.com/ElnuDev/image-api + # https://git.elnu.com/jichan.org/apis "/api/images/" = { - proxyPass = "http://elnuhub:3002"; + proxyPass = "http://localhost:3002"; extraConfig = '' rewrite ^/api/images/(.*) /$1 break; ''; From 65ae45eaaf3c35798d8975e6c3997c1bb6c7aa99 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Sat, 12 Aug 2023 14:05:54 -0700 Subject: [PATCH 7/7] elnudrop: host images API, refactoring --- flake.lock | 20 +++++++++---------- hosts/elnudrop/default.nix | 2 -- hosts/elnudrop/hosts/jichan.org/default.nix | 22 ++++----------------- hosts/elnudrop/hosts/jichan.org/images.nix | 11 +++++++++++ hosts/elnudrop/hosts/jichan.org/tatoeba.nix | 11 +++++++++++ 5 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 hosts/elnudrop/hosts/jichan.org/images.nix create mode 100644 hosts/elnudrop/hosts/jichan.org/tatoeba.nix diff --git a/flake.lock b/flake.lock index 33bba77..cf59ef6 100644 --- a/flake.lock +++ b/flake.lock @@ -6,11 +6,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1691779970, - "narHash": "sha256-NMrLx5FJ/ueTw4FYKqZ9FBh+H1fVXnAs7Vvr+9By8N0=", + "lastModified": 1691873908, + "narHash": "sha256-37XNMWtoca8zjNdGq95hbi6idB9pdbv2peqNvFxqfrM=", "ref": "refs/heads/main", - "rev": "e90adfaf87c68785af0f66becb0d5c8fc59b9e2f", - "revCount": 15, + "rev": "412ca4e53890761467de233cf0ed37bebbc8eeac", + "revCount": 27, "type": "git", "url": "https://git.elnu.com/jichan.org/apis.git" }, @@ -156,11 +156,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1691472822, - "narHash": "sha256-XVfYZ2oB3lNPVq6sHCY9WkdQ8lHoIDzzbpg8bB6oBxA=", + "lastModified": 1691654369, + "narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "41c7605718399dcfa53dd7083793b6ae3bc969ff", + "rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e", "type": "github" }, "original": { @@ -321,11 +321,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1691591308, - "narHash": "sha256-eeErUrPWCQwFHESL3vpNwkl8oyJPV6SRrVS9cPTEvYI=", + "lastModified": 1691806075, + "narHash": "sha256-yuq7cNkFOQse4WwLw0rUiXhG58aI6eyXKfcTw5Act/I=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "094512d7a7573ae2cb6db1a5ce4745a69b16fa46", + "rev": "b87a7db512340dea25e95f444db29e9264ff7a63", "type": "github" }, "original": { diff --git a/hosts/elnudrop/default.nix b/hosts/elnudrop/default.nix index 8092fa7..6f6db61 100644 --- a/hosts/elnudrop/default.nix +++ b/hosts/elnudrop/default.nix @@ -39,6 +39,4 @@ }; services.do-agent.enable = true; - - services.tatoeba.enable = true; } \ No newline at end of file diff --git a/hosts/elnudrop/hosts/jichan.org/default.nix b/hosts/elnudrop/hosts/jichan.org/default.nix index 0afde18..b222797 100644 --- a/hosts/elnudrop/hosts/jichan.org/default.nix +++ b/hosts/elnudrop/hosts/jichan.org/default.nix @@ -1,6 +1,10 @@ { enableSSL, ... }: let host = "jichan.org"; in { + imports = [ + ./tatoeba.nix + ./images.nix + ]; services.nginx.virtualHosts."www.${host}" = { forceSSL = enableSSL; enableACME = enableSSL; @@ -17,24 +21,6 @@ let host = "jichan.org"; in { "/502.html".root = "${./502}"; "/logo.svg".root = "${./502}"; "/missing.min.css".root = "${../shared/502}"; - - # Formerly tatoeba.elnu.com - # https://git.elnu.com/jichan.org/apis - "/api/tatoeba/" = { - proxyPass = "http://localhost:3001"; - extraConfig = '' - rewrite ^/api/tatoeba/(.*) /$1 break; - ''; - }; - - # Formerly images.elnu.com - # https://git.elnu.com/jichan.org/apis - "/api/images/" = { - proxyPass = "http://localhost:3002"; - extraConfig = '' - rewrite ^/api/images/(.*) /$1 break; - ''; - }; }; }; } \ No newline at end of file diff --git a/hosts/elnudrop/hosts/jichan.org/images.nix b/hosts/elnudrop/hosts/jichan.org/images.nix new file mode 100644 index 0000000..f1c7961 --- /dev/null +++ b/hosts/elnudrop/hosts/jichan.org/images.nix @@ -0,0 +1,11 @@ +{ config, ... }: + +{ + services.images.enable = true; + services.nginx.virtualHosts."jichan.org".locations."/api/images" = { + proxyPass = "http://localhost:${builtins.toString config.services.images.port}"; + extraConfig = '' + rewrite ^/api/images/(.*) /$1 break; + ''; + }; +} \ No newline at end of file diff --git a/hosts/elnudrop/hosts/jichan.org/tatoeba.nix b/hosts/elnudrop/hosts/jichan.org/tatoeba.nix new file mode 100644 index 0000000..8460218 --- /dev/null +++ b/hosts/elnudrop/hosts/jichan.org/tatoeba.nix @@ -0,0 +1,11 @@ +{ config, ... }: + +{ + services.tatoeba.enable = true; + services.nginx.virtualHosts."jichan.org".locations."/api/tatoeba" = { + proxyPass = "http://localhost:${builtins.toString config.services.tatoeba.port}"; + extraConfig = '' + rewrite ^/api/tatoeba/(.*) /$1 break; + ''; + }; +} \ No newline at end of file