stockholm/lass/2configs/realwallpaper.nix

50 lines
1.2 KiB
Nix
Raw Normal View History

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