Skip to content

Commit

Permalink
disnix module: make dbus service configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
svanderburg committed Feb 28, 2018
1 parent 275bc74 commit 8fbfd67
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions nixos/modules/services/misc/disnix.nix
Expand Up @@ -32,11 +32,17 @@ in
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 {
default = false;
description = "Whether to enable the DisnixWebService interface running on Apache Tomcat";
};

package = mkOption {
type = types.path;
description = "The Disnix package";
Expand All @@ -52,7 +58,7 @@ in

config = mkIf cfg.enable {
dysnomia.enable = true;

environment.systemPackages = [ pkgs.disnix ] ++ optional cfg.useWebServiceInterface pkgs.DisnixWebService;

services.dbus.enable = true;
Expand All @@ -71,7 +77,7 @@ in
};

systemd.services = {
disnix = {
disnix = mkIf cfg.enableMultiUser {
description = "Disnix server";
wants = [ "dysnomia.target" ];
wantedBy = [ "multi-user.target" ];
Expand All @@ -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_MODULES_PATH then { inherit (config.environment.variables) DYSNOMIA_MODULES_PATH; } else {});

serviceConfig.ExecStart = "${cfg.package}/bin/disnix-service";
};

Expand Down

0 comments on commit 8fbfd67

Please sign in to comment.