nixos/dolibarr: add package option

Allow users to easily use a different dolibarr version, e.g. version 18
(currently in unstable) instead of 16.
This commit is contained in:
Jakob Schöttl 2023-10-31 20:39:35 +01:00
parent 9f689d42a7
commit 7a363cef5f

View file

@ -1,8 +1,8 @@
{ config, pkgs, lib, ... }:
let
inherit (lib) any boolToString concatStringsSep isBool isString mapAttrsToList mkDefault mkEnableOption mkIf mkMerge mkOption optionalAttrs types;
inherit (lib) any boolToString concatStringsSep isBool isString mapAttrsToList mkDefault mkEnableOption mkIf mkMerge mkOption optionalAttrs types mkPackageOptionMD;
package = pkgs.dolibarr.override { inherit (cfg) stateDir; };
package = cfg.package.override { inherit (cfg) stateDir; };
cfg = config.services.dolibarr;
vhostCfg = lib.optionalAttrs (cfg.nginx != null) config.services.nginx.virtualHosts."${cfg.domain}";
@ -50,6 +50,8 @@ in
options.services.dolibarr = {
enable = mkEnableOption (lib.mdDoc "dolibarr");
package = mkPackageOptionMD pkgs "dolibarr" { };
domain = mkOption {
type = types.str;
default = "localhost";