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