summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/tomcat.nix
diff options
context:
space:
mode:
authorSander van der Burg <svanderburg@gmail.com>2022-03-12 00:56:44 +0100
committerSander van der Burg <svanderburg@gmail.com>2022-03-13 14:00:09 +0100
commitd12186a6017e7fddaa0e97db90c4924485aca92c (patch)
treed6b87cbde02be146dda53e75c30bdb6bd6e10fd9 /nixos/modules/services/web-servers/tomcat.nix
parent9afbaab4d2a85e0b14433ee22baf7cd54a4cd6ed (diff)
downloadnixpkgs-d12186a6017e7fddaa0e97db90c4924485aca92c.tar
nixpkgs-d12186a6017e7fddaa0e97db90c4924485aca92c.tar.gz
nixpkgs-d12186a6017e7fddaa0e97db90c4924485aca92c.tar.bz2
nixpkgs-d12186a6017e7fddaa0e97db90c4924485aca92c.tar.lz
nixpkgs-d12186a6017e7fddaa0e97db90c4924485aca92c.tar.xz
nixpkgs-d12186a6017e7fddaa0e97db90c4924485aca92c.tar.zst
nixpkgs-d12186a6017e7fddaa0e97db90c4924485aca92c.zip
nixos/tomcat: configure default group and fix broken default package reference
Without this fix, evaluating a NixOS configuration with Tomcat enabled and the
default settings results in the following evaluation error:

Failed assertions:
- users.users.tomcat.group is unset. This used to default to
nogroup, but this is unsafe. For example you can create a group
for this user with:
users.users.tomcat.group = "tomcat";
users.groups.tomcat = {};
Diffstat (limited to 'nixos/modules/services/web-servers/tomcat.nix')
-rw-r--r--nixos/modules/services/web-servers/tomcat.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/services/web-servers/tomcat.nix b/nixos/modules/services/web-servers/tomcat.nix
index f9446fe125a..877097cf378 100644
--- a/nixos/modules/services/web-servers/tomcat.nix
+++ b/nixos/modules/services/web-servers/tomcat.nix
@@ -23,8 +23,8 @@ in
 
       package = mkOption {
         type = types.package;
-        default = pkgs.tomcat85;
-        defaultText = literalExpression "pkgs.tomcat85";
+        default = pkgs.tomcat9;
+        defaultText = literalExpression "pkgs.tomcat9";
         example = lib.literalExpression "pkgs.tomcat9";
         description = ''
           Which tomcat package to use.
@@ -127,7 +127,7 @@ in
       webapps = mkOption {
         type = types.listOf types.path;
         default = [ tomcat.webapps ];
-        defaultText = literalExpression "[ pkgs.tomcat85.webapps ]";
+        defaultText = literalExpression "[ config.services.tomcat.package.webapps ]";
         description = "List containing WAR files or directories with WAR files which are web applications to be deployed on Tomcat";
       };
 
@@ -201,6 +201,7 @@ in
       { uid = config.ids.uids.tomcat;
         description = "Tomcat user";
         home = "/homeless-shelter";
+        group = "tomcat";
         extraGroups = cfg.extraGroups;
       };