diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-20 14:06:07 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-20 14:06:07 +0100 |
commit | 2a2ac56cf78cccad11eb30ad20a356b91337f0ac (patch) | |
tree | f59c48a211410d271d34665fce9541f999e7d952 /modules/by-name/re | |
parent | refactor({modules,test}): Migrate to a `by-name` structure (diff) | |
download | nixos-server-2a2ac56cf78cccad11eb30ad20a356b91337f0ac.tar.gz nixos-server-2a2ac56cf78cccad11eb30ad20a356b91337f0ac.zip |
refactor(system/services/libreddit): Migrate to `by-name`
This also includes a rename into `redlib` because of upstream changes.
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/re/redlib/module.nix | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/modules/by-name/re/redlib/module.nix b/modules/by-name/re/redlib/module.nix new file mode 100644 index 0000000..393a8b9 --- /dev/null +++ b/modules/by-name/re/redlib/module.nix @@ -0,0 +1,36 @@ +{ + config, + pkgsUnstable, + lib, + ... +}: let + domain = "libreddit.vhack.eu"; + + cfg = config.vhack.redlib; +in { + options.vhack.redlib = { + enable = lib.mkEnableOption '' + the redlib reddit frontend + ''; + }; + + config = lib.mkIf cfg.enable { + services.redlib = { + enable = true; + package = pkgsUnstable.redlib; + port = 8080; + address = "127.0.0.1"; + openFirewall = false; + }; + + services.nginx = { + enable = true; + virtualHosts.${domain} = { + locations."/".proxyPass = "http://127.0.0.1:${toString config.services.redlib.port}"; + + enableACME = lib.mkDefault true; + forceSSL = lib.mkDefault true; + }; + }; + }; +} |