This repository has no description
1.8 kB
61 lines
1{ config, pkgs, ... }:
2let
3 # ANSI-terminal-style homepage, inline HTML with clickable links. The IBM
4 # VGA webfont (CC BY-SA 4.0, int10h.org/oldschool-pc-fonts) is base64-inlined
5 # so the page is a single self-contained file.
6 webroot = pkgs.runCommand "lassul.us-webroot" { } ''
7 mkdir $out
8 substitute ${./lassul.us/index.html} $out/index.html \
9 --replace-fail @font_woff_b64@ "$(base64 -w0 ${./lassul.us/Web437_IBM_VGA_8x16.woff})"
10 cp ${./lassul.us/robots.txt} $out/robots.txt
11 cp ${./lassul.us/profile.nix} $out/profile.nix
12 '';
13in
14{
15 imports = [
16 ./default.nix
17 ];
18
19 security.acme = {
20 defaults.email = "acme@lassul.us";
21 acceptTerms = true;
22 certs."lassul.us" = {
23 group = "lasscert";
24 };
25 };
26
27 users.groups.lasscert.members = [
28 "nginx"
29 ];
30
31 services.nginx.virtualHosts."lassul.us" = {
32 addSSL = true;
33 enableACME = true;
34 default = true;
35 locations."/".extraConfig = ''
36 root ${webroot};
37 '';
38 locations."= /profile.nix".extraConfig = ''
39 root ${webroot};
40 default_type text/plain;
41 '';
42 locations."= /hosts".extraConfig = ''
43 alias ${pkgs.krebs-hosts_combined};
44 '';
45 locations."= /retiolum.hosts".extraConfig = ''
46 alias ${pkgs.krebs-hosts-retiolum};
47 '';
48 locations."= /wireguard-key".extraConfig = ''
49 alias ${pkgs.writeText "neoprism.wg" config.krebs.hosts.neoprism.nets.wiregrill.wireguard.pubkey};
50 '';
51 locations."= /ssh.pub".extraConfig = ''
52 alias ${pkgs.writeText "pub" config.krebs.users.lass.pubkey};
53 '';
54 locations."= /gpg.pub".extraConfig = ''
55 alias ${pkgs.writeText "pub" config.krebs.users.lass.pgp.pubkeys.default};
56 '';
57 locations."= /ip".extraConfig = ''
58 return 200 '$remote_addr';
59 '';
60 };
61}