83a9bf9a6a
(e.g., startOn = "started foo" instead of startOn = "foo"). svn path=/nixos/branches/upstart-0.6/; revision=18230
56 lines
886 B
Nix
56 lines
886 B
Nix
# Disnix server
|
|
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.disnix;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.disnix = {
|
|
|
|
enable = mkOption {
|
|
default = false;
|
|
description = "Whether to enable Disnix";
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ pkgs.disnix ];
|
|
|
|
services.dbus.enable = true;
|
|
services.dbus.packages = [ pkgs.disnix ];
|
|
|
|
jobs.disnix =
|
|
{ description = "Disnix server";
|
|
|
|
startOn = "started dbus";
|
|
|
|
script =
|
|
''
|
|
export ACTIVATION_SCRIPTS=${pkgs.disnix_activation_scripts}/libexec/disnix/activation-scripts
|
|
export PATH=${pkgs.nixUnstable}/bin
|
|
export HOME=/root
|
|
|
|
${pkgs.disnix}/bin/disnix-service
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
}
|