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

disnix module: make dbus service configurable

+10 -4
+10 -4
nixos/modules/services/misc/disnix.nix
··· 32 32 description = "Whether to enable Disnix"; 33 33 }; 34 34 35 + enableMultiUser = mkOption { 36 + type = types.bool; 37 + default = true; 38 + description = "Whether to support multi-user mode by enabling the Disnix D-Bus service"; 39 + }; 40 + 35 41 useWebServiceInterface = mkOption { 36 42 default = false; 37 43 description = "Whether to enable the DisnixWebService interface running on Apache Tomcat"; 38 44 }; 39 - 45 + 40 46 package = mkOption { 41 47 type = types.path; 42 48 description = "The Disnix package"; ··· 52 58 53 59 config = mkIf cfg.enable { 54 60 dysnomia.enable = true; 55 - 61 + 56 62 environment.systemPackages = [ pkgs.disnix ] ++ optional cfg.useWebServiceInterface pkgs.DisnixWebService; 57 63 58 64 services.dbus.enable = true; ··· 71 77 }; 72 78 73 79 systemd.services = { 74 - disnix = { 80 + disnix = mkIf cfg.enableMultiUser { 75 81 description = "Disnix server"; 76 82 wants = [ "dysnomia.target" ]; 77 83 wantedBy = [ "multi-user.target" ]; ··· 92 98 } 93 99 // (if config.environment.variables ? DYSNOMIA_CONTAINERS_PATH then { inherit (config.environment.variables) DYSNOMIA_CONTAINERS_PATH; } else {}) 94 100 // (if config.environment.variables ? DYSNOMIA_MODULES_PATH then { inherit (config.environment.variables) DYSNOMIA_MODULES_PATH; } else {}); 95 - 101 + 96 102 serviceConfig.ExecStart = "${cfg.package}/bin/disnix-service"; 97 103 }; 98 104