2008-11-18 18:00:15 +00:00
|
|
|
# Disnix server
|
2009-10-12 17:36:19 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
2008-07-06 19:34:19 +01:00
|
|
|
|
|
|
|
let
|
2009-10-12 17:36:19 +01:00
|
|
|
|
|
|
|
cfg = config.services.disnix;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
2009-09-02 11:27:44 +01:00
|
|
|
|
2008-11-18 18:00:15 +00:00
|
|
|
options = {
|
2009-10-12 17:36:19 +01:00
|
|
|
|
|
|
|
services.disnix = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to enable Disnix";
|
|
|
|
};
|
|
|
|
|
2008-11-18 18:00:15 +00:00
|
|
|
};
|
2009-10-12 17:36:19 +01:00
|
|
|
|
2008-11-18 18:00:15 +00:00
|
|
|
};
|
2009-10-12 17:36:19 +01:00
|
|
|
|
2008-11-18 18:00:15 +00:00
|
|
|
|
2009-10-12 17:36:19 +01:00
|
|
|
###### implementation
|
2008-11-18 18:00:15 +00:00
|
|
|
|
2009-10-12 17:36:19 +01:00
|
|
|
config = mkIf cfg.enable {
|
2008-07-06 19:34:19 +01:00
|
|
|
|
2009-10-12 17:36:19 +01:00
|
|
|
environment.systemPackages = [ pkgs.disnix ];
|
2008-11-18 18:00:15 +00:00
|
|
|
|
2009-10-12 17:36:19 +01:00
|
|
|
services.dbus.enable = true;
|
|
|
|
services.dbus.packages = [ pkgs.disnix ];
|
2008-11-18 18:00:15 +00:00
|
|
|
|
2010-04-19 14:26:21 +01:00
|
|
|
users.extraGroups = singleton
|
|
|
|
{ name = "disnix";
|
|
|
|
gid = config.ids.gids.disnix;
|
|
|
|
};
|
|
|
|
|
2009-10-12 19:09:34 +01:00
|
|
|
jobs.disnix =
|
2009-10-12 17:36:19 +01:00
|
|
|
{ description = "Disnix server";
|
|
|
|
|
2009-11-06 22:19:17 +00:00
|
|
|
startOn = "started dbus";
|
2009-10-12 17:36:19 +01:00
|
|
|
|
|
|
|
script =
|
2010-04-01 15:53:17 +01:00
|
|
|
''
|
|
|
|
export PATH=/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin
|
2009-10-12 17:36:19 +01:00
|
|
|
export HOME=/root
|
|
|
|
|
2010-04-01 15:53:17 +01:00
|
|
|
${pkgs.disnix}/bin/disnix-service --activation-modules-dir=${pkgs.disnix_activation_scripts}/libexec/disnix/activation-scripts
|
2009-10-12 17:36:19 +01:00
|
|
|
'';
|
|
|
|
};
|
2008-11-23 01:28:58 +00:00
|
|
|
|
2008-11-18 18:00:15 +00:00
|
|
|
};
|
2009-10-12 17:36:19 +01:00
|
|
|
|
2008-07-06 19:34:19 +01:00
|
|
|
}
|