From a3c76503d16e42edfcb01b57eeb9a2dddb75abec Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Fri, 25 Oct 2024 21:50:23 +0800 Subject: [PATCH] flake: bump --- flake.lock | 56 ++++++++++++------------ hosts/aws/tyo0/default.nix | 3 -- hosts/vultr/sin0/services/ip-checker.nix | 24 ++++++++-- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/flake.lock b/flake.lock index 818b372..f4d1b56 100644 --- a/flake.lock +++ b/flake.lock @@ -31,11 +31,11 @@ }, "crane": { "locked": { - "lastModified": 1729273024, - "narHash": "sha256-Mb5SemVsootkn4Q2IiY0rr9vrXdCCpQ9HnZeD/J3uXs=", + "lastModified": 1729741221, + "narHash": "sha256-8AHZZXs1lFkERfBY0C8cZGElSo33D/et7NKEpLRmvzo=", "owner": "ipetkov", "repo": "crane", - "rev": "fa8b7445ddadc37850ed222718ca86622be01967", + "rev": "f235b656ee5b2bfd6d94c3bfd67896a575d4a6ed", "type": "github" }, "original": { @@ -51,11 +51,11 @@ ] }, "locked": { - "lastModified": 1729281548, - "narHash": "sha256-MuojlSnwAJAwfhgmW8ZtZrwm2Sko4fqubCvReqbUzYw=", + "lastModified": 1729712798, + "narHash": "sha256-a+Aakkb+amHw4biOZ0iMo8xYl37uUL48YEXIC5PYJ/8=", "owner": "nix-community", "repo": "disko", - "rev": "a6a3179ddf396dfc28a078e2f169354d0c137125", + "rev": "09a776702b004fdf9c41a024e1299d575ee18a7d", "type": "github" }, "original": { @@ -146,11 +146,11 @@ ] }, "locked": { - "lastModified": 1729321331, - "narHash": "sha256-KVyQq+ez/oB30/WbdNgVD8g/bda34z8NiU187QKQb74=", + "lastModified": 1729844616, + "narHash": "sha256-LZdokf9Xave80URxsHAZehogjC16dDPBZb285hh5OAM=", "owner": "nix-community", "repo": "home-manager", - "rev": "122f70545b29ccb922e655b08acfe05bfb44ec68", + "rev": "5feb9dba3cc095cd0d5d0d34a39dbee9cc469530", "type": "github" }, "original": { @@ -175,11 +175,11 @@ ] }, "locked": { - "lastModified": 1729329289, - "narHash": "sha256-49QKrohNJzmrLBjI9yqy/z8qdntfwrwqqb2EhQbrvKc=", - "rev": "51621426b862bced548fe9f88a5a36d02fd4b551", + "lastModified": 1729861979, + "narHash": "sha256-KmqB/9N5cub85vYX39FVSRnQfq3HrObbO/UcoLuKxt4=", + "rev": "f12b0561073ea546a3f560621b242d9f0ad52d6a", "type": "tarball", - "url": "https://git.ny4.dev/api/v1/repos/nyancat/ip-checker/archive/51621426b862bced548fe9f88a5a36d02fd4b551.tar.gz" + "url": "https://git.ny4.dev/api/v1/repos/nyancat/ip-checker/archive/f12b0561073ea546a3f560621b242d9f0ad52d6a.tar.gz" }, "original": { "type": "tarball", @@ -237,11 +237,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1729333370, - "narHash": "sha256-NU+tYe3QWzDNpB8RagpqR3hNQXn4BNuBd7ZGosMHLL8=", + "lastModified": 1729742320, + "narHash": "sha256-u3Of8xRkN//me8PU+RucKA59/6RNy4B2jcGAF36P4jI=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "38279034170b1e2929b2be33bdaedbf14a57bfeb", + "rev": "e8a2f6d5513fe7b7d15701b2d05404ffdc3b6dda", "type": "github" }, "original": { @@ -252,11 +252,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1729406543, - "narHash": "sha256-vDMZdl6A74/eqoDKGHb/k0lAXVUBYoMyuwfS/ces/EI=", + "lastModified": 1729788628, + "narHash": "sha256-3suayUinicnvE/4shMZwp9FHT5izUM8gMpdEO/NHBTo=", "owner": "Guanran928", "repo": "nixpkgs", - "rev": "56e7f831b33c3a8c42e3ee44e91096bb8342eefd", + "rev": "63487b2f26fa065cfeeaa47dddb08e2856ba53e8", "type": "github" }, "original": { @@ -339,11 +339,11 @@ ] }, "locked": { - "lastModified": 1729391507, - "narHash": "sha256-as0I9xieJUHf7kiK2a9znDsVZQTFWhM1pLivII43Gi0=", + "lastModified": 1729823394, + "narHash": "sha256-RiinJqorqSLKh1oSpiMHnBe6nQdJzE45lX6fSnAuDnI=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "784981a9feeba406de38c1c9a3decf966d853cca", + "rev": "7e52e80f5faa374ad4c607d62c6d362589cb523f", "type": "github" }, "original": { @@ -362,11 +362,11 @@ ] }, "locked": { - "lastModified": 1729394972, - "narHash": "sha256-fADlzOzcSaGsrO+THUZ8SgckMMc7bMQftztKFCLVcFI=", + "lastModified": 1729775275, + "narHash": "sha256-J2vtHq9sw1wWm0aTMXpEEAzsVCUMZDTEe5kiBYccpLE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c504fd7ac946d7a1b17944d73b261ca0a0b226a5", + "rev": "78a0e634fc8981d6b564f08b6715c69a755c4c7d", "type": "github" }, "original": { @@ -397,11 +397,11 @@ ] }, "locked": { - "lastModified": 1729242555, - "narHash": "sha256-6jWSWxv2crIXmYSEb3LEVsFkCkyVHNllk61X4uhqfCs=", + "lastModified": 1729613947, + "narHash": "sha256-XGOvuIPW1XRfPgHtGYXd5MAmJzZtOuwlfKDgxX5KT3s=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "d986489c1c757f6921a48c1439f19bfb9b8ecab5", + "rev": "aac86347fb5063960eccb19493e0cadcdb4205ca", "type": "github" }, "original": { diff --git a/hosts/aws/tyo0/default.nix b/hosts/aws/tyo0/default.nix index b89625c..c9fbc67 100644 --- a/hosts/aws/tyo0/default.nix +++ b/hosts/aws/tyo0/default.nix @@ -32,9 +32,6 @@ size = 4 * 1024; # 4 GiB }; - # FIXME: error: builder for '/nix/store/...-ena-2.12.3-6.11.drv' failed with exit code 2 - boot.kernelPackages = lib.mkForce pkgs.linuxPackages_6_10; - ### Secrets sops.secrets = lib.mapAttrs (_name: value: value // { sopsFile = ./secrets.yaml; }) { "prometheus/auth" = { diff --git a/hosts/vultr/sin0/services/ip-checker.nix b/hosts/vultr/sin0/services/ip-checker.nix index 2fd3d5d..7efd631 100644 --- a/hosts/vultr/sin0/services/ip-checker.nix +++ b/hosts/vultr/sin0/services/ip-checker.nix @@ -13,11 +13,12 @@ in wantedBy = [ "multi-user.target" ]; environment = { IP_CHECKER_LISTEN = "127.0.0.1:${toString port}"; - IP_CHECKER_COUNTRY_DB = "${pkgs.clash-geoip}/etc/clash/Country.mmdb"; + IP_CHECKER_MODE = "prod"; + IP_CHECKER_ASN_DB = pkgs.dbip-asn-lite.mmdb; + IP_CHECKER_CITY_DB = pkgs.dbip-city-lite.mmdb; }; serviceConfig = { ExecStart = lib.getExe inputs.ip-checker.packages.${pkgs.stdenv.hostPlatform.system}.default; - WorkingDirectory = inputs.ip-checker; CapabilityBoundingSet = ""; DynamicUser = true; @@ -49,8 +50,23 @@ in services.caddy.settings.apps.http.servers.srv0.routes = lib.singleton { match = lib.singleton { host = [ "ip.ny4.dev" ]; }; handle = lib.singleton { - handler = "reverse_proxy"; - upstreams = lib.singleton { dial = "127.0.0.1:${toString port}"; }; + handler = "subroute"; + routes = [ + # TODO: make `curl ip.ny4.dev` work + { + match = [ { path = [ "/api/v1/*" ]; } ]; + handle = lib.singleton { + handler = "reverse_proxy"; + upstreams = lib.singleton { dial = "127.0.0.1:${toString port}"; }; + }; + } + { + handle = lib.singleton { + handler = "file_server"; + root = "${inputs.ip-checker}/ui"; + }; + } + ]; }; }; }