mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-05-20 05:12:34 +02:00
d71c9d8169
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (import ./mk-container.nix {inherit lib config;}) mkContainer;
|
|
in {
|
|
imports = [
|
|
(mkContainer {
|
|
name = "wallpapers";
|
|
hostIp = "10.233.4.1";
|
|
containerIp = "10.233.4.2";
|
|
nixosConfig = {pkgs, ...}: {
|
|
services.nginx = {
|
|
enable = true;
|
|
virtualHosts."wallpapers" = {
|
|
root = "${inputs.awesome-wallpapers.packages.${pkgs.system}.default}/share/awesome-wallpapers";
|
|
listen = [
|
|
{
|
|
addr = "0.0.0.0";
|
|
port = 8080;
|
|
}
|
|
];
|
|
locations."/" = {
|
|
tryFiles = "$uri $uri/ /index.html";
|
|
};
|
|
extraConfig = ''
|
|
port_in_redirect off;
|
|
absolute_redirect off;
|
|
'';
|
|
};
|
|
};
|
|
networking.firewall.allowedTCPPorts = [8080];
|
|
system.stateVersion = "24.05";
|
|
};
|
|
})
|
|
];
|
|
|
|
services.cloudflared.tunnels."${config.var.tunnelId}".ingress."wallpapers.${config.var.domain}" = "http://10.233.4.2:8080";
|
|
}
|