2018-11-10 20:46:12 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2015-10-03 16:21:01 +00:00
|
|
|
|
2016-06-25 16:38:30 +00:00
|
|
|
let
|
|
|
|
hostname = config.krebs.build.host.name;
|
|
|
|
inherit (lib)
|
|
|
|
nameValuePair
|
|
|
|
;
|
|
|
|
|
|
|
|
in {
|
2015-10-05 12:50:07 +00:00
|
|
|
krebs.realwallpaper.enable = true;
|
2016-06-25 16:38:30 +00:00
|
|
|
|
2021-03-08 00:08:28 +00:00
|
|
|
system.activationScripts.wallpaper-chmod = ''
|
2018-11-10 20:46:12 +00:00
|
|
|
${pkgs.coreutils}/bin/chmod +x /var/realwallpaper
|
|
|
|
'';
|
2016-12-26 13:18:08 +00:00
|
|
|
services.nginx.virtualHosts.wallpaper = {
|
2017-04-15 16:19:15 +00:00
|
|
|
extraConfig = ''
|
|
|
|
if ( $server_addr = "${config.krebs.build.host.nets.internet.ip4.addr}" ) {
|
|
|
|
return 403;
|
|
|
|
}
|
|
|
|
'';
|
2016-12-26 13:18:08 +00:00
|
|
|
serverAliases = [
|
2016-06-25 16:38:30 +00:00
|
|
|
hostname
|
2017-04-15 16:19:45 +00:00
|
|
|
"${hostname}.r"
|
2016-06-25 16:38:30 +00:00
|
|
|
];
|
2017-04-15 15:16:20 +00:00
|
|
|
locations."/realwallpaper.png".extraConfig = ''
|
|
|
|
root /var/realwallpaper/;
|
|
|
|
'';
|
2018-11-10 20:46:35 +00:00
|
|
|
locations."/realwallpaper-krebs.png".extraConfig = ''
|
2017-04-15 15:16:20 +00:00
|
|
|
root /var/realwallpaper/;
|
2016-12-26 13:18:08 +00:00
|
|
|
'';
|
2021-01-23 19:22:17 +00:00
|
|
|
locations."/realwallpaper-video.mp4".extraConfig = ''
|
|
|
|
root /var/realwallpaper/archive;
|
|
|
|
'';
|
2016-06-25 16:38:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
krebs.iptables = {
|
|
|
|
tables = {
|
|
|
|
filter.INPUT.rules = [
|
|
|
|
{ predicate = "-i retiolum -p tcp --dport 80"; target = "ACCEPT"; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2015-10-03 16:21:01 +00:00
|
|
|
}
|