Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #204474 from peperunas/libreddit

libreddit: Add package option to module

authored by Bobby Rong and committed by GitHub d44e752f b2c0afa4

+8 -1
+8 -1
nixos/modules/services/misc/libreddit.nix
··· 15 15 services.libreddit = { 16 16 enable = mkEnableOption (lib.mdDoc "Private front-end for Reddit"); 17 17 18 + package = mkOption { 19 + type = types.package; 20 + default = pkgs.libreddit; 21 + defaultText = literalExpression "pkgs.libreddit"; 22 + description = lib.mdDoc "Libreddit package to use."; 23 + }; 24 + 18 25 address = mkOption { 19 26 default = "0.0.0.0"; 20 27 example = "127.0.0.1"; ··· 45 52 after = [ "network.target" ]; 46 53 serviceConfig = { 47 54 DynamicUser = true; 48 - ExecStart = "${pkgs.libreddit}/bin/libreddit ${args}"; 55 + ExecStart = "${cfg.package}/bin/libreddit ${args}"; 49 56 AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ]; 50 57 Restart = "on-failure"; 51 58 RestartSec = "2s";