2008-11-18 19:00:15 +01:00
|
|
|
# Disnix server
|
2009-10-12 18:36:19 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
2008-07-06 20:34:19 +02:00
|
|
|
|
|
|
|
let
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
cfg = config.services.disnix;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
2009-09-02 12:27:44 +02:00
|
|
|
|
2008-11-18 19:00:15 +01:00
|
|
|
options = {
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
services.disnix = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to enable Disnix";
|
|
|
|
};
|
|
|
|
|
2008-11-18 19:00:15 +01:00
|
|
|
};
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2008-11-18 19:00:15 +01:00
|
|
|
};
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2008-11-18 19:00:15 +01:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
###### implementation
|
2008-11-18 19:00:15 +01:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
config = mkIf cfg.enable {
|
2008-07-06 20:34:19 +02:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
environment.systemPackages = [ pkgs.disnix ];
|
2008-11-18 19:00:15 +01:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
services.dbus.enable = true;
|
|
|
|
services.dbus.packages = [ pkgs.disnix ];
|
2008-11-18 19:00:15 +01:00
|
|
|
|
2009-10-12 20:09:34 +02:00
|
|
|
jobs.disnix =
|
2009-10-12 18:36:19 +02:00
|
|
|
{ description = "Disnix server";
|
|
|
|
|
2009-11-06 23:19:17 +01:00
|
|
|
startOn = "started dbus";
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
2008-11-23 02:28:58 +01:00
|
|
|
|
2008-11-18 19:00:15 +01:00
|
|
|
};
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2008-07-06 20:34:19 +02:00
|
|
|
}
|