1
0
Fork 0

Add startpage

This commit is contained in:
Malte Brandy 2021-07-20 23:34:24 +02:00
parent 507e40abaf
commit 87dc899860
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
2 changed files with 14 additions and 5 deletions

View file

@ -47,10 +47,15 @@ let
{ pkgs, lib, ... }: {
systemd.user.services.blockserver = {
Unit.Description = "Serve a blocklist";
Service = {
ExecStart = "${pkgs.python3}/bin/python -m http.server 8842 -d ${pkgs.writeTextDir "blocklist" (lib.concatStringsSep "\r\n" list)}";
Restart = "always";
};
Service =
let
blocklist = pkgs.writeTextDir "blocklist" (lib.concatStringsSep "\r\n" list);
startpage = pkgs.writeTextDir "index.html" (builtins.readFile ./startpage.html);
in
{
ExecStart = "${pkgs.python3}/bin/python -m http.server 8842 -d ${pkgs.symlinkJoin { name = "blockserver-dir"; paths = [ blocklist startpage ]; }}";
Restart = "always";
};
Install.WantedBy = [ "default.target" ];
};
};
@ -137,7 +142,7 @@ in
./roles/update_tasks.nix
./roles/vdirsyncer.nix
(import ./roles/mode-switching.nix { modeDir = ".volatile/modes"; modeFile = ".mode"; })
(setStartpage "https://stats.maralorn.de")
(setStartpage "http://localhost:8842")
(makeAutostart "kassandra2")
(makeAutostart "unlock-ssh")
];

View file

@ -0,0 +1,4 @@
<html>
<title>Maralorns Startpage</title>
<body style="background: #f0f0ff"></body>
</html>