summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSilas Schöffel <sils@sils.li>2024-03-28 16:05:27 +0100
committerSilas Schöffel <sils@sils.li>2024-03-28 16:16:29 +0100
commitccefd04ee0d4df2091eca031bc998f4e1fb8480c (patch)
tree2315dbc23fde7d5894e503e1cc0c9e6dea318409
parentfeat(system/servics/libreddit): Use the continued redlib package (diff)
downloadnixos-server-ccefd04ee0d4df2091eca031bc998f4e1fb8480c.tar.gz
nixos-server-ccefd04ee0d4df2091eca031bc998f4e1fb8480c.zip
fix(system/services/libreddit): correct binary location in systemd service
This is a manual fix until we get this merged into nixpkgs

Co-authored-by: Benedikt Peetz <benedikt.peetz@b-peetz.de>
-rw-r--r--system/services/libreddit/default.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/system/services/libreddit/default.nix b/system/services/libreddit/default.nix
index 9a7c459..e527ec2 100644
--- a/system/services/libreddit/default.nix
+++ b/system/services/libreddit/default.nix
@@ -5,14 +5,25 @@
   ...
 }: let
   domain = "libreddit.vhack.eu";
+  cfg = config.services.libreddit;
+
+  # Taken from nixpkgs module
+  args = lib.concatStringsSep " " [
+    "--port ${toString cfg.port}"
+    "--address ${cfg.address}"
+  ];
 in {
   services.libreddit = {
     enable = true;
     package = pkgs-unstable.redlib;
+    port = 8080;
     address = "127.0.0.1";
     openFirewall = false;
   };
 
+  # Force systemd service to use correct binary
+  systemd.services.libreddit.serviceConfig.ExecStart = lib.mkForce "${lib.getExe cfg.package} ${args}";
+
   services.nginx = {
     enable = true;
     virtualHosts.${domain} = {