summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorLuca Bruno <lucabru@src.gnome.org>2015-03-18 14:09:24 +0000
committerLuca Bruno <lucabru@src.gnome.org>2015-03-18 14:09:24 +0000
commitcb45b7ec3e94fc5e19c319e43bf28319714a50f1 (patch)
tree9c971dde96b24faea30e9365facdd7ac4cb7d0c7 /nixos/modules/services
parent7ef59c4fe2a87682054572a504fc7c6046c282e5 (diff)
downloadnixlib-cb45b7ec3e94fc5e19c319e43bf28319714a50f1.tar
nixlib-cb45b7ec3e94fc5e19c319e43bf28319714a50f1.tar.gz
nixlib-cb45b7ec3e94fc5e19c319e43bf28319714a50f1.tar.bz2
nixlib-cb45b7ec3e94fc5e19c319e43bf28319714a50f1.tar.lz
nixlib-cb45b7ec3e94fc5e19c319e43bf28319714a50f1.tar.xz
nixlib-cb45b7ec3e94fc5e19c319e43bf28319714a50f1.tar.zst
nixlib-cb45b7ec3e94fc5e19c319e43bf28319714a50f1.zip
Revert "nixos: Multiple service instances, apply to nginx. See #6784"
This reverts commit 7ef59c4fe2a87682054572a504fc7c6046c282e5.

Wrong push! Sorry!
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix20
1 files changed, 10 insertions, 10 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
index 94dad49f9fd1..0f21ef012639 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -1,12 +1,9 @@
-{ config, lib, pkgs, ... }@args:
+{ config, lib, pkgs, ... }:
 
 with lib;
 
-let topconfig = config;
-in mkMultiInstance [ "services" "nginx" ] args ({ config, name, ... }:
-
 let
-  cfg = config;
+  cfg = config.services.nginx;
   nginx = cfg.package;
   configFile = pkgs.writeText "nginx.conf" ''
     user ${cfg.user} ${cfg.group};
@@ -23,6 +20,7 @@ in
 
 {
   options = {
+    services.nginx = {
       enable = mkOption {
         default = false;
         type = types.bool;
@@ -84,13 +82,15 @@ in
         description = "Group account under which nginx runs.";
       };
 
+    };
+
   };
 
   config = mkIf cfg.enable {
     # TODO: test user supplied config file pases syntax test
 
-    systemd.services."nginx-${name}" = {
-      description = "Nginx Web Server - ${name}";
+    systemd.services.nginx = {
+      description = "Nginx Web Server";
       after = [ "network.target" ];
       wantedBy = [ "multi-user.target" ];
       path = [ nginx ];
@@ -111,12 +111,12 @@ in
     users.extraUsers = optionalAttrs (cfg.user == "nginx") (singleton
       { name = "nginx";
         group = cfg.group;
-        uid = topconfig.ids.uids.nginx;
+        uid = config.ids.uids.nginx;
       });
 
     users.extraGroups = optionalAttrs (cfg.group == "nginx") (singleton
       { name = "nginx";
-        gid = topconfig.ids.gids.nginx;
+        gid = config.ids.gids.nginx;
       });
   };
-})
+}