lohr: setup dev service

This commit is contained in:
Antoine Martin 2021-03-28 22:08:19 +02:00
parent 6e894260e5
commit 9d2073011b
3 changed files with 42 additions and 0 deletions

View file

@ -78,6 +78,10 @@ in
enable = true;
};
lohr = {
enable = true;
};
miniflux = {
enable = true;
adminCredentialsFile = "${../../secrets/miniflux-admin-credentials.secret}";

View file

@ -7,6 +7,7 @@
./fail2ban.nix
./gitea.nix
./jellyfin.nix
./lohr.nix
./matrix.nix
./media.nix
./miniflux.nix

37
services/lohr.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, lib, ... }:
with lib;
let
cfg = config.my.services.lohr;
my = config.my;
domain = config.networking.domain;
in
{
options.my.services.lohr = {
enable = lib.mkEnableOption "Lohr Mirroring Daemon";
home = mkOption {
type = types.str;
default = "/var/lib/lohr";
example = "/var/lib/lohr";
description = "Home for the lohr service, where data will be stored";
};
};
config = mkIf cfg.enable {
services.nginx.virtualHosts = {
"lohr.${domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = let
laptopClientNum = my.secrets.wireguard.peers.laptop.clientNum;
in
"http://10.0.0.${toString laptopClientNum}:8000";
};
};
};
};
}