2008-05-22 12:59:46 +01:00
|
|
|
{config, pkgs, nix, modprobe, nssModulesPath, nixEnvVars, optionDeclarations, kernelPackages}:
|
2006-12-11 15:32:10 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
makeJob = import ../upstart-jobs/make-job.nix {
|
|
|
|
inherit (pkgs) runCommand;
|
|
|
|
};
|
|
|
|
|
2007-11-09 18:49:45 +00:00
|
|
|
optional = cond: service: pkgs.lib.optional cond (makeJob service);
|
2006-12-16 18:24:49 +00:00
|
|
|
|
2007-04-04 18:10:38 +01:00
|
|
|
requiredTTYs =
|
2008-01-04 16:11:12 +00:00
|
|
|
config.services.mingetty.ttys
|
|
|
|
++ config.boot.extraTTYs
|
|
|
|
++ [config.services.syslogd.tty];
|
2007-04-04 18:10:38 +01:00
|
|
|
|
2008-03-16 01:05:40 +00:00
|
|
|
# looks for a job file foreach attr name found in services from config
|
|
|
|
# passes { thisConfig, config, pkgs }
|
|
|
|
# a job must return { options = {}; job =; }
|
|
|
|
# options is the same format as options.nix, but only contains documentation for this job
|
|
|
|
# TODO check validation
|
|
|
|
newProposalJobs =
|
2008-03-16 11:03:03 +00:00
|
|
|
(
|
2008-03-16 01:05:40 +00:00
|
|
|
let
|
|
|
|
inherit (pkgs.lib) getAttr;
|
|
|
|
inherit (builtins) attrNames pathExists map;
|
2008-03-16 11:03:03 +00:00
|
|
|
services = getAttr [ "servicesProposal" ] {} config;
|
2008-03-16 01:05:40 +00:00
|
|
|
nameToJobs = name : (
|
2008-03-16 11:03:03 +00:00
|
|
|
(
|
2008-03-16 15:52:52 +00:00
|
|
|
let p = ./new-proposal + "/${name}.nix";
|
|
|
|
p2 = ./new-proposal + "/${name}/default.nix";
|
2008-03-16 01:05:40 +00:00
|
|
|
thisConfig = getAttr [ name ] {} services;
|
|
|
|
path = [name];
|
|
|
|
args = confgiV : {
|
|
|
|
inherit config pkgs thisConfig path;
|
|
|
|
lib = pkgs.lib;
|
|
|
|
upstartHelpers = { # some useful functions
|
|
|
|
inherit configV; # the first time a error function is passed to get the option list
|
|
|
|
# the second time a function is passed getting the option for you automatically,
|
|
|
|
# either returning the default option or the user supplied value (the function apply is applied when given)
|
|
|
|
# maybe this is complicated, but easy to use (IMHO)
|
|
|
|
mkOption = pkgs.lib.mkOption; # the same function used in options.nix
|
|
|
|
autoGeneratedEtcFile = { name, commentChar ? "#", content } :
|
|
|
|
{ source = pkgs.writeText name
|
|
|
|
("${commentChar} nixos autogenerated etc file based on /etc/nixos/configuration.nix\n" + content);
|
|
|
|
target = name;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
jobFunc = if pathExists p
|
|
|
|
then import p
|
|
|
|
else if pathExists p2 then import p2
|
|
|
|
else abort "service ${name} requested but there is no ${p}.nix or ${p}/default.nix file!";
|
|
|
|
options = (jobFunc (args (abort "you can't use configV within options!"))).options;
|
2008-03-25 00:06:58 +00:00
|
|
|
errorWhere = name : "${name} of service ${builtins.toString path}";
|
2008-03-16 01:05:40 +00:00
|
|
|
configV = name : if (__hasAttr name options ) then
|
|
|
|
let opt = (__getAttr name options ); # this config option description
|
|
|
|
in if (__hasAttr name thisConfig )
|
|
|
|
then let v = (__getAttr name thisConfig); in if opt ? apply then opt.apply v else v
|
2008-03-25 00:06:58 +00:00
|
|
|
else if opt ? default then opt.default else abort "you need to specify the configuration option ${errorWhere name}"
|
|
|
|
else abort "unkown option ${errorWhere name}";
|
2008-03-16 01:05:40 +00:00
|
|
|
checkConfig = (pkgs.lib.getAttr ["environment" "checkConfigurationOptions"]
|
|
|
|
optionDeclarations.environment.checkConfigurationOptions.default
|
|
|
|
config);
|
|
|
|
in # TODO: pass path to checker so it can show full path in the abort case
|
|
|
|
pkgs.checker ( (jobFunc (args configV)).jobs )
|
|
|
|
checkConfig
|
|
|
|
options
|
|
|
|
thisConfig
|
|
|
|
|
|
|
|
));
|
|
|
|
in pkgs.lib.concatLists ( map nameToJobs (attrNames services)));
|
2007-11-23 10:56:12 +00:00
|
|
|
|
2008-03-16 01:05:40 +00:00
|
|
|
jobs = map makeJob
|
2008-05-08 13:27:01 +01:00
|
|
|
(newProposalJobs ++ [
|
|
|
|
|
2006-12-11 15:32:10 +00:00
|
|
|
# Syslogd.
|
|
|
|
(import ../upstart-jobs/syslogd.nix {
|
2008-04-01 13:50:47 +01:00
|
|
|
inherit (pkgs) sysklogd writeText;
|
2008-05-08 13:27:01 +01:00
|
|
|
inherit config;
|
2006-12-11 15:32:10 +00:00
|
|
|
})
|
|
|
|
|
2008-05-08 14:47:44 +01:00
|
|
|
# Klogd.
|
|
|
|
(import ../upstart-jobs/klogd.nix {
|
|
|
|
inherit (pkgs) sysklogd writeText;
|
|
|
|
inherit config;
|
|
|
|
})
|
|
|
|
|
2006-12-13 12:17:38 +00:00
|
|
|
# The udev daemon creates devices nodes and runs programs when
|
|
|
|
# hardware events occur.
|
|
|
|
(import ../upstart-jobs/udev.nix {
|
2008-07-03 11:45:14 +01:00
|
|
|
inherit modprobe config;
|
2007-03-03 23:20:08 +00:00
|
|
|
inherit (pkgs) stdenv writeText substituteAll udev procps;
|
2007-01-15 09:20:34 +00:00
|
|
|
inherit (pkgs.lib) cleanSource;
|
2007-03-03 23:20:08 +00:00
|
|
|
firmwareDirs =
|
2008-01-12 22:53:13 +00:00
|
|
|
pkgs.lib.optional config.networking.enableIntel2200BGFirmware pkgs.ipw2200fw
|
|
|
|
++ pkgs.lib.optional config.networking.enableIntel3945ABGFirmware pkgs.iwlwifi3945ucode
|
2008-02-18 16:50:08 +00:00
|
|
|
++ pkgs.lib.optional config.networking.enableIntel4965AGNFirmware pkgs.iwlwifi4965ucode
|
2008-02-20 09:01:26 +00:00
|
|
|
++ pkgs.lib.optional config.networking.enableZydasZD1211Firmware pkgs.zd1211fw
|
2008-06-20 17:10:20 +01:00
|
|
|
++ pkgs.lib.optional config.hardware.enableGo7007 "${kernelPackages.wis_go7007}/firmware"
|
2008-07-23 15:13:27 +01:00
|
|
|
++ config.services.udev.addFirmware;
|
2007-07-22 03:07:02 +01:00
|
|
|
extraUdevPkgs =
|
2008-02-04 10:52:58 +00:00
|
|
|
pkgs.lib.optional config.services.hal.enable pkgs.hal
|
2008-06-20 17:10:20 +01:00
|
|
|
++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007;
|
2006-12-13 12:17:38 +00:00
|
|
|
})
|
|
|
|
|
2006-12-24 01:07:28 +00:00
|
|
|
# Makes LVM logical volumes available.
|
|
|
|
(import ../upstart-jobs/lvm.nix {
|
2007-03-04 01:16:24 +00:00
|
|
|
inherit modprobe;
|
2007-06-28 10:57:36 +01:00
|
|
|
inherit (pkgs) lvm2 devicemapper;
|
2006-12-24 01:07:28 +00:00
|
|
|
})
|
|
|
|
|
2007-01-11 00:40:28 +00:00
|
|
|
# Activate software RAID arrays.
|
|
|
|
(import ../upstart-jobs/swraid.nix {
|
2007-03-04 01:16:24 +00:00
|
|
|
inherit modprobe;
|
|
|
|
inherit (pkgs) mdadm;
|
2007-01-11 00:40:28 +00:00
|
|
|
})
|
|
|
|
|
2006-12-21 14:22:40 +00:00
|
|
|
# Mount file systems.
|
|
|
|
(import ../upstart-jobs/filesystems.nix {
|
2006-12-21 20:08:15 +00:00
|
|
|
inherit (pkgs) utillinux e2fsprogs;
|
2007-11-09 18:49:45 +00:00
|
|
|
fileSystems = config.fileSystems;
|
2006-12-21 14:22:40 +00:00
|
|
|
})
|
|
|
|
|
2006-12-21 01:07:23 +00:00
|
|
|
# Swapping.
|
|
|
|
(import ../upstart-jobs/swap.nix {
|
2008-02-11 11:51:51 +00:00
|
|
|
inherit (pkgs) utillinux lib;
|
2007-11-09 18:49:45 +00:00
|
|
|
swapDevices = config.swapDevices;
|
2006-12-21 01:07:23 +00:00
|
|
|
})
|
|
|
|
|
2006-12-11 15:32:10 +00:00
|
|
|
# Network interfaces.
|
|
|
|
(import ../upstart-jobs/network-interfaces.nix {
|
2007-11-23 17:12:37 +00:00
|
|
|
inherit modprobe config;
|
2007-05-24 15:50:17 +01:00
|
|
|
inherit (pkgs) nettools wirelesstools bash writeText;
|
2006-12-11 15:32:10 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
# Nix daemon - required for multi-user Nix.
|
|
|
|
(import ../upstart-jobs/nix-daemon.nix {
|
2007-11-15 17:16:16 +00:00
|
|
|
inherit config pkgs nix nixEnvVars;
|
2006-12-11 15:32:10 +00:00
|
|
|
})
|
|
|
|
|
2007-01-10 17:09:00 +00:00
|
|
|
# Cron daemon.
|
|
|
|
(import ../upstart-jobs/cron.nix {
|
2008-02-01 12:01:27 +00:00
|
|
|
inherit config pkgs;
|
2007-01-10 17:09:00 +00:00
|
|
|
})
|
|
|
|
|
2007-01-11 23:55:25 +00:00
|
|
|
# Name service cache daemon.
|
|
|
|
(import ../upstart-jobs/nscd.nix {
|
2007-06-10 21:13:12 +01:00
|
|
|
inherit (pkgs) glibc;
|
2007-01-15 17:19:41 +00:00
|
|
|
inherit nssModulesPath;
|
2007-01-11 23:55:25 +00:00
|
|
|
})
|
|
|
|
|
2007-04-04 18:10:38 +01:00
|
|
|
# Console font and keyboard maps.
|
|
|
|
(import ../upstart-jobs/kbd.nix {
|
|
|
|
inherit (pkgs) glibc kbd gzip;
|
|
|
|
ttyNumbers = requiredTTYs;
|
2007-11-09 18:49:45 +00:00
|
|
|
defaultLocale = config.i18n.defaultLocale;
|
|
|
|
consoleFont = config.i18n.consoleFont;
|
|
|
|
consoleKeyMap = config.i18n.consoleKeyMap;
|
2007-04-04 18:10:38 +01:00
|
|
|
})
|
|
|
|
|
2006-12-11 15:32:10 +00:00
|
|
|
# Handles the maintenance/stalled event (single-user shell).
|
|
|
|
(import ../upstart-jobs/maintenance-shell.nix {
|
|
|
|
inherit (pkgs) bash;
|
|
|
|
})
|
|
|
|
|
|
|
|
# Ctrl-alt-delete action.
|
|
|
|
(import ../upstart-jobs/ctrl-alt-delete.nix)
|
|
|
|
|
2008-03-16 01:05:40 +00:00
|
|
|
])
|
2006-12-11 15:32:10 +00:00
|
|
|
|
2008-04-01 11:16:35 +01:00
|
|
|
# At daemon.
|
|
|
|
++ optional config.services.atd.enable
|
|
|
|
(import ../upstart-jobs/atd.nix {
|
|
|
|
at = pkgs.at;
|
|
|
|
})
|
|
|
|
|
2007-02-12 16:00:55 +00:00
|
|
|
# DHCP client.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.networking.useDHCP
|
2007-02-12 16:00:55 +00:00
|
|
|
(import ../upstart-jobs/dhclient.nix {
|
2007-02-22 14:26:53 +00:00
|
|
|
inherit (pkgs) nettools dhcp lib;
|
2007-11-09 18:49:45 +00:00
|
|
|
interfaces = config.networking.interfaces;
|
2007-02-12 16:00:55 +00:00
|
|
|
})
|
|
|
|
|
2007-08-14 17:43:56 +01:00
|
|
|
# ifplugd daemon for monitoring Ethernet cables.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.networking.interfaceMonitor.enable
|
2007-08-14 17:43:56 +01:00
|
|
|
(import ../upstart-jobs/ifplugd.nix {
|
|
|
|
inherit (pkgs) ifplugd writeScript bash;
|
|
|
|
inherit config;
|
|
|
|
})
|
|
|
|
|
2007-03-16 16:41:38 +00:00
|
|
|
# DHCP server.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.dhcpd.enable
|
2007-03-16 16:41:38 +00:00
|
|
|
(import ../upstart-jobs/dhcpd.nix {
|
2007-12-04 14:53:37 +00:00
|
|
|
inherit pkgs config;
|
2007-03-16 16:41:38 +00:00
|
|
|
})
|
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
# SSH daemon.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.sshd.enable
|
2006-12-16 18:24:49 +00:00
|
|
|
(import ../upstart-jobs/sshd.nix {
|
2007-06-10 21:13:12 +01:00
|
|
|
inherit (pkgs) writeText openssh glibc;
|
2007-01-07 10:19:16 +00:00
|
|
|
inherit (pkgs.xorg) xauth;
|
2007-01-15 17:19:41 +00:00
|
|
|
inherit nssModulesPath;
|
2007-11-09 18:49:45 +00:00
|
|
|
forwardX11 = config.services.sshd.forwardX11;
|
|
|
|
allowSFTP = config.services.sshd.allowSFTP;
|
2008-03-14 12:53:14 +00:00
|
|
|
permitRootLogin = config.services.sshd.permitRootLogin;
|
2006-12-16 18:24:49 +00:00
|
|
|
})
|
|
|
|
|
2008-03-05 16:03:09 +00:00
|
|
|
# GNU lshd SSH2 deamon.
|
|
|
|
++ optional config.services.lshd.enable
|
|
|
|
(import ../upstart-jobs/lshd.nix {
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
inherit (pkgs) lsh;
|
|
|
|
inherit (pkgs.xorg) xauth;
|
|
|
|
inherit nssModulesPath;
|
|
|
|
lshdConfig = config.services.lshd;
|
|
|
|
})
|
|
|
|
|
2006-12-21 23:43:17 +00:00
|
|
|
# NTP daemon.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.ntp.enable
|
2006-12-21 23:43:17 +00:00
|
|
|
(import ../upstart-jobs/ntpd.nix {
|
2007-03-04 01:16:24 +00:00
|
|
|
inherit modprobe;
|
2007-06-10 21:13:12 +01:00
|
|
|
inherit (pkgs) ntp glibc writeText;
|
2007-11-09 18:49:45 +00:00
|
|
|
servers = config.services.ntp.servers;
|
2006-12-21 23:43:17 +00:00
|
|
|
})
|
|
|
|
|
2008-03-15 23:40:44 +00:00
|
|
|
# portmap daemon.
|
|
|
|
++ optional config.services.portmap.enable
|
|
|
|
(import ../upstart-jobs/portmap.nix {
|
|
|
|
inherit (pkgs) makePortmap;
|
|
|
|
})
|
|
|
|
|
2008-03-06 17:11:22 +00:00
|
|
|
# Avahi daemon.
|
|
|
|
++ optional config.services.avahi.enable
|
|
|
|
(import ../upstart-jobs/avahi-daemon.nix {
|
|
|
|
inherit (pkgs) avahi writeText lib;
|
|
|
|
config = config.services.avahi;
|
|
|
|
})
|
|
|
|
|
2006-12-16 18:24:49 +00:00
|
|
|
# X server.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.xserver.enable
|
2006-12-16 18:24:49 +00:00
|
|
|
(import ../upstart-jobs/xserver.nix {
|
2008-06-06 10:13:16 +01:00
|
|
|
inherit config pkgs kernelPackages;
|
2007-09-25 20:00:20 +01:00
|
|
|
fontDirectories = import ../system/fonts.nix {inherit pkgs config;};
|
2006-12-16 18:24:49 +00:00
|
|
|
})
|
|
|
|
|
2006-12-18 19:20:03 +00:00
|
|
|
# Apache httpd.
|
2008-02-04 10:52:58 +00:00
|
|
|
++ optional (config.services.httpd.enable && !config.services.httpd.experimental)
|
2006-12-18 19:20:03 +00:00
|
|
|
(import ../upstart-jobs/httpd.nix {
|
2006-12-18 19:46:48 +00:00
|
|
|
inherit config pkgs;
|
2007-06-10 21:13:12 +01:00
|
|
|
inherit (pkgs) glibc;
|
2007-11-23 10:56:12 +00:00
|
|
|
extraConfig = pkgs.lib.concatStringsSep "\n"
|
|
|
|
(map (job: job.extraHttpdConfig) jobs);
|
2006-12-18 19:20:03 +00:00
|
|
|
})
|
|
|
|
|
2008-01-04 10:36:14 +00:00
|
|
|
# Apache httpd (new style).
|
2008-02-04 10:52:58 +00:00
|
|
|
++ optional (config.services.httpd.enable && config.services.httpd.experimental)
|
2008-01-04 10:36:14 +00:00
|
|
|
(import ../upstart-jobs/apache-httpd {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-01-28 14:30:18 +00:00
|
|
|
# MySQL server
|
|
|
|
++ optional config.services.mysql.enable
|
|
|
|
(import ../upstart-jobs/mysql.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2007-12-03 04:48:31 +00:00
|
|
|
# Postgres SQL server
|
|
|
|
++ optional config.services.postgresql.enable
|
|
|
|
(import ../upstart-jobs/postgresql.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-02-04 13:40:01 +00:00
|
|
|
# EJabberd service
|
|
|
|
++ optional config.services.ejabberd.enable
|
|
|
|
(import ../upstart-jobs/ejabberd.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-03-03 19:28:10 +00:00
|
|
|
# OpenFire XMPP server
|
|
|
|
++ optional config.services.openfire.enable
|
|
|
|
(import ../upstart-jobs/openfire.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-01-28 15:16:14 +00:00
|
|
|
# JBoss service
|
|
|
|
++ optional config.services.jboss.enable
|
|
|
|
(import ../upstart-jobs/jboss.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-01-30 11:00:00 +00:00
|
|
|
# Apache Tomcat service
|
|
|
|
++ optional config.services.tomcat.enable
|
|
|
|
(import ../upstart-jobs/tomcat.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2007-05-28 16:39:25 +01:00
|
|
|
# Samba service.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.samba.enable
|
2007-05-28 16:39:25 +01:00
|
|
|
(import ../upstart-jobs/samba.nix {
|
|
|
|
inherit pkgs;
|
2007-06-10 21:13:12 +01:00
|
|
|
inherit (pkgs) glibc samba;
|
2007-05-28 16:39:25 +01:00
|
|
|
})
|
|
|
|
|
2007-04-02 18:31:58 +01:00
|
|
|
# CUPS (printing) daemon.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.printing.enable
|
2007-04-02 18:31:58 +01:00
|
|
|
(import ../upstart-jobs/cupsd.nix {
|
|
|
|
inherit (pkgs) writeText cups;
|
|
|
|
})
|
|
|
|
|
2007-07-09 12:21:04 +01:00
|
|
|
# Gateway6
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.gw6c.enable
|
2007-07-09 12:21:04 +01:00
|
|
|
(import ../upstart-jobs/gw6c.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-02-07 12:41:18 +00:00
|
|
|
# VSFTPd server
|
|
|
|
++ optional config.services.vsftpd.enable
|
|
|
|
(import ../upstart-jobs/vsftpd.nix {
|
|
|
|
inherit (pkgs) vsftpd;
|
2008-02-07 13:37:20 +00:00
|
|
|
inherit (config.services.vsftpd) anonymousUser;
|
2008-02-07 12:41:18 +00:00
|
|
|
})
|
|
|
|
|
2007-11-05 08:54:30 +00:00
|
|
|
# X Font Server
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.xfs.enable
|
2008-01-04 10:54:33 +00:00
|
|
|
(import ../upstart-jobs/xfs.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
2007-11-05 08:54:30 +00:00
|
|
|
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.ircdHybrid.enable
|
2007-08-08 21:42:25 +01:00
|
|
|
(import ../upstart-jobs/ircd-hybrid.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-02-18 09:15:10 +00:00
|
|
|
++ optional config.services.bitlbee.enable
|
|
|
|
(import ../upstart-jobs/bitlbee.nix {
|
|
|
|
inherit (pkgs) bitlbee;
|
|
|
|
inherit (config.services.bitlbee) portNumber interface;
|
|
|
|
})
|
|
|
|
|
2007-03-01 00:36:00 +00:00
|
|
|
# ALSA sound support.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.sound.enable
|
2007-03-01 00:36:00 +00:00
|
|
|
(import ../upstart-jobs/alsa.nix {
|
2007-03-04 01:16:24 +00:00
|
|
|
inherit modprobe;
|
|
|
|
inherit (pkgs) alsaUtils;
|
2007-03-01 00:36:00 +00:00
|
|
|
})
|
|
|
|
|
2007-06-08 19:56:55 +01:00
|
|
|
# D-Bus system-wide daemon.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.dbus.enable
|
2007-06-08 19:56:55 +01:00
|
|
|
(import ../upstart-jobs/dbus.nix {
|
|
|
|
inherit (pkgs) stdenv dbus;
|
2007-06-09 21:05:04 +01:00
|
|
|
dbusServices =
|
2008-07-23 15:13:27 +01:00
|
|
|
pkgs.lib.optional config.services.hal.enable pkgs.hal ++
|
|
|
|
pkgs.lib.optional config.services.avahi.enable pkgs.avahi ++
|
|
|
|
pkgs.lib.optional config.services.disnix.enable pkgs.disnix
|
|
|
|
;
|
2007-06-09 21:05:04 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
# HAL daemon.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ optional config.services.hal.enable
|
2007-06-09 21:05:04 +01:00
|
|
|
(import ../upstart-jobs/hal.nix {
|
|
|
|
inherit (pkgs) stdenv hal;
|
2007-06-08 19:56:55 +01:00
|
|
|
})
|
|
|
|
|
2008-06-03 08:06:35 +01:00
|
|
|
++ optional config.services.gpm.enable
|
|
|
|
(import ../upstart-jobs/gpm.nix {
|
|
|
|
inherit (pkgs) gpm;
|
|
|
|
gpmConfig = config.services.gpm;
|
|
|
|
})
|
|
|
|
|
2007-11-12 16:43:35 +00:00
|
|
|
# Nagios system/network monitoring daemon.
|
|
|
|
++ optional config.services.nagios.enable
|
|
|
|
(import ../upstart-jobs/nagios {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-06-06 10:13:16 +01:00
|
|
|
# Zabbix agent daemon.
|
|
|
|
++ optional config.services.zabbixAgent.enable
|
|
|
|
(import ../upstart-jobs/zabbix-agent.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
|
|
|
# Zabbix server daemon.
|
|
|
|
++ optional config.services.zabbixServer.enable
|
|
|
|
(import ../upstart-jobs/zabbix-server.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
2008-06-30 16:13:02 +01:00
|
|
|
|
|
|
|
# Postfix mail server.
|
|
|
|
++ optional config.services.postfix.enable
|
|
|
|
(import ../upstart-jobs/postfix.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
2008-06-06 10:13:16 +01:00
|
|
|
|
2008-06-30 22:12:02 +01:00
|
|
|
# Dovecot POP3/IMAP server.
|
|
|
|
++ optional config.services.dovecot.enable
|
|
|
|
(import ../upstart-jobs/dovecot.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-07-01 13:15:56 +01:00
|
|
|
# ISC BIND domain name server.
|
|
|
|
++ optional config.services.bind.enable
|
|
|
|
(import ../upstart-jobs/bind.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2008-07-06 19:34:19 +01:00
|
|
|
# Disnix server
|
|
|
|
++ optional config.services.disnix.enable
|
|
|
|
(import ../upstart-jobs/disnix.nix {
|
|
|
|
inherit config pkgs;
|
|
|
|
})
|
|
|
|
|
2006-12-11 15:32:10 +00:00
|
|
|
# Handles the reboot/halt events.
|
|
|
|
++ (map
|
|
|
|
(event: makeJob (import ../upstart-jobs/halt.nix {
|
|
|
|
inherit (pkgs) bash utillinux;
|
|
|
|
inherit event;
|
|
|
|
}))
|
|
|
|
["reboot" "halt" "system-halt" "power-off"]
|
|
|
|
)
|
|
|
|
|
|
|
|
# The terminals on ttyX.
|
|
|
|
++ (map
|
|
|
|
(ttyNumber: makeJob (import ../upstart-jobs/mingetty.nix {
|
2007-01-08 22:41:41 +00:00
|
|
|
inherit (pkgs) mingetty;
|
|
|
|
inherit ttyNumber;
|
|
|
|
loginProgram = "${pkgs.pam_login}/bin/login";
|
2006-12-11 15:32:10 +00:00
|
|
|
}))
|
2007-11-09 18:49:45 +00:00
|
|
|
(config.services.mingetty.ttys)
|
2006-12-11 15:32:10 +00:00
|
|
|
)
|
|
|
|
|
2007-01-08 22:41:41 +00:00
|
|
|
# Transparent TTY backgrounds.
|
2008-06-10 17:10:23 +01:00
|
|
|
++ optional (config.services.ttyBackgrounds.enable && kernelPackages.splashutils != null)
|
2007-01-08 22:41:41 +00:00
|
|
|
(import ../upstart-jobs/tty-backgrounds.nix {
|
2008-05-22 12:59:46 +01:00
|
|
|
inherit (pkgs) stdenv;
|
|
|
|
inherit (kernelPackages) splashutils;
|
2007-01-08 22:41:41 +00:00
|
|
|
|
|
|
|
backgrounds =
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
specificThemes =
|
2007-11-09 18:49:45 +00:00
|
|
|
config.services.ttyBackgrounds.defaultSpecificThemes
|
|
|
|
++ config.services.ttyBackgrounds.specificThemes;
|
2007-01-08 22:41:41 +00:00
|
|
|
|
|
|
|
overridenTTYs = map (x: x.tty) specificThemes;
|
|
|
|
|
|
|
|
# Use the default theme for all the mingetty ttys and for the
|
|
|
|
# syslog tty, except those for which a specific theme is
|
|
|
|
# specified.
|
|
|
|
defaultTTYs =
|
2008-02-11 11:51:51 +00:00
|
|
|
pkgs.lib.filter (x: !(pkgs.lib.elem x overridenTTYs)) requiredTTYs;
|
2007-01-08 22:41:41 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
(map (ttyNumber: {
|
|
|
|
tty = ttyNumber;
|
2007-11-09 18:49:45 +00:00
|
|
|
theme = config.services.ttyBackgrounds.defaultTheme;
|
2007-01-08 22:41:41 +00:00
|
|
|
}) defaultTTYs)
|
|
|
|
++ specificThemes;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
2006-12-18 17:41:46 +00:00
|
|
|
# User-defined events.
|
2007-11-09 18:49:45 +00:00
|
|
|
++ (map makeJob (config.services.extraJobs))
|
2006-12-18 17:41:46 +00:00
|
|
|
|
2006-12-18 19:46:48 +00:00
|
|
|
# For the built-in logd job.
|
2007-06-08 16:41:12 +01:00
|
|
|
++ [(makeJob { jobDrv = pkgs.upstart; })];
|
2007-11-23 10:56:12 +00:00
|
|
|
|
2006-12-18 19:46:48 +00:00
|
|
|
|
2007-11-23 10:56:12 +00:00
|
|
|
in import ../upstart-jobs/gather.nix {
|
|
|
|
inherit (pkgs) runCommand;
|
|
|
|
inherit jobs;
|
2006-12-11 15:32:10 +00:00
|
|
|
}
|