forked from mirrors/nixpkgs
disnix module: make dbus service configurable
This commit is contained in:
parent
275bc74aa9
commit
8fbfd67f1f
|
@ -32,11 +32,17 @@ in
|
||||||
description = "Whether to enable Disnix";
|
description = "Whether to enable Disnix";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableMultiUser = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to support multi-user mode by enabling the Disnix D-Bus service";
|
||||||
|
};
|
||||||
|
|
||||||
useWebServiceInterface = mkOption {
|
useWebServiceInterface = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable the DisnixWebService interface running on Apache Tomcat";
|
description = "Whether to enable the DisnixWebService interface running on Apache Tomcat";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
description = "The Disnix package";
|
description = "The Disnix package";
|
||||||
|
@ -52,7 +58,7 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
dysnomia.enable = true;
|
dysnomia.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.disnix ] ++ optional cfg.useWebServiceInterface pkgs.DisnixWebService;
|
environment.systemPackages = [ pkgs.disnix ] ++ optional cfg.useWebServiceInterface pkgs.DisnixWebService;
|
||||||
|
|
||||||
services.dbus.enable = true;
|
services.dbus.enable = true;
|
||||||
|
@ -71,7 +77,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
disnix = {
|
disnix = mkIf cfg.enableMultiUser {
|
||||||
description = "Disnix server";
|
description = "Disnix server";
|
||||||
wants = [ "dysnomia.target" ];
|
wants = [ "dysnomia.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
@ -92,7 +98,7 @@ in
|
||||||
}
|
}
|
||||||
// (if config.environment.variables ? DYSNOMIA_CONTAINERS_PATH then { inherit (config.environment.variables) DYSNOMIA_CONTAINERS_PATH; } else {})
|
// (if config.environment.variables ? DYSNOMIA_CONTAINERS_PATH then { inherit (config.environment.variables) DYSNOMIA_CONTAINERS_PATH; } else {})
|
||||||
// (if config.environment.variables ? DYSNOMIA_MODULES_PATH then { inherit (config.environment.variables) DYSNOMIA_MODULES_PATH; } else {});
|
// (if config.environment.variables ? DYSNOMIA_MODULES_PATH then { inherit (config.environment.variables) DYSNOMIA_MODULES_PATH; } else {});
|
||||||
|
|
||||||
serviceConfig.ExecStart = "${cfg.package}/bin/disnix-service";
|
serviceConfig.ExecStart = "${cfg.package}/bin/disnix-service";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue