diff options
-rw-r--r-- | third_party/radicle-explorer/default.nix | 21 | ||||
-rw-r--r-- | users/tazjin/nixos/koptevo/default.nix | 12 |
2 files changed, 29 insertions, 4 deletions
diff --git a/third_party/radicle-explorer/default.nix b/third_party/radicle-explorer/default.nix index 7fe9539ddf74..0241eaef5d3e 100644 --- a/third_party/radicle-explorer/default.nix +++ b/third_party/radicle-explorer/default.nix @@ -2,7 +2,7 @@ # # They have an upstream Nix derivation, but it only works with experimental # features Nix and is quite messy, so this is a copy of the relevant parts. -{ pkgs, ... }: +{ lib, pkgs, ... }: let twemoji-assets = pkgs.fetchFromGitHub { @@ -14,7 +14,7 @@ let httpdSrc = pkgs.radicle-httpd.src; in -pkgs.buildNpmPackage rec { +lib.fix (self: pkgs.buildNpmPackage rec { pname = "radicle-explorer"; version = (builtins.fromJSON (builtins.readFile "${src}/package.json")).version; @@ -44,4 +44,19 @@ pkgs.buildNpmPackage rec { runHook postInstall ''; -} + # Override the build-time configuration with other preferred seeds which are + # displayed on the landing page. + passthru.withPreferredSeeds = seeds: + let + originalConfig = builtins.fromJSON (builtins.readFile "${src}/config/default.json"); + config = originalConfig // { + preferredSeeds = seeds; + }; + newConfig = pkgs.writeText "local.json" (builtins.toJSON config); + in + self.overrideAttrs (_: { + preBuild = '' + cp ${newConfig} config/local.json + ''; + }); +}) diff --git a/users/tazjin/nixos/koptevo/default.nix b/users/tazjin/nixos/koptevo/default.nix index 426495d77fa3..86abae119449 100644 --- a/users/tazjin/nixos/koptevo/default.nix +++ b/users/tazjin/nixos/koptevo/default.nix @@ -270,9 +270,13 @@ in services.nginx.virtualHosts."src.tazj.in" = { enableACME = true; forceSSL = true; + root = depot.third_party.radicle-explorer.withPreferredSeeds [{ + hostname = "rad.tazj.in"; + port = 443; + scheme = "https"; + }]; locations."/" = { - root = depot.third_party.radicle-explorer; index = "index.html"; extraConfig = '' try_files $uri $uri/ /index.html; @@ -283,6 +287,12 @@ in services.nginx.virtualHosts."src.y.tazj.in" = { enableSSL = true; useACMEHost = "y.tazj.in"; + root = depot.third_party.radicle-explorer.withPreferredSeeds [{ + hostname = "rad.y.tazj.in"; + port = 443; + scheme = "https"; + }]; + locations = config.services.nginx.virtualHosts."src.tazj.in".locations; }; |