* Continued refactoring the tree: moved most Upstart jobs (namely

those that run daemons) to modules/services.  This probably broke
  some things since there are a few relative paths in modules
  (e.g. imports of system/ids.nix).
* Moved some PAM modules out of etc/pam.d to the directories of NixOS
  modules that use them.

svn path=/nixos/branches/modular-nixos/; revision=15717
This commit is contained in:
Eelco Dolstra 2009-05-24 23:13:23 +00:00
parent f86e2e5d01
commit 5ebdee3577
91 changed files with 140 additions and 315 deletions

View File

@ -34,7 +34,7 @@ let
# not used (e.g., doesn't own any devices). # not used (e.g., doesn't own any devices).
group = { group = {
name = "audio"; name = "audio";
gid = (import ../system/ids.nix).gids.audio; gid = (import ../../../system/ids.nix).gids.audio;
}; };
job = { job = {
@ -72,7 +72,7 @@ in
mkIf config.sound.enable { mkIf config.sound.enable {
require = [ require = [
../upstart-jobs/default.nix # config.services.extraJobs # ../upstart-jobs/default.nix # config.services.extraJobs
# ../system/user.nix # users.* # ../system/user.nix # users.*
# ? # config.environment.extraPackages # ? # config.environment.extraPackages
options options

View File

@ -4,8 +4,8 @@
let let
inherit (pkgs.lib) mkOption mkIf; inherit (pkgs.lib) mkOption mkIf;
uid = (import ../system/ids.nix).uids.pulseaudio; uid = (import ../../../system/ids.nix).uids.pulseaudio;
gid = (import ../system/ids.nix).gids.pulseaudio; gid = (import ../../../system/ids.nix).gids.pulseaudio;
options = { options = {
services = { services = {

View File

@ -36,13 +36,13 @@ let
user = { user = {
name = "haldaemon"; name = "haldaemon";
uid = (import ../system/ids.nix).uids.haldaemon; uid = (import ../../../system/ids.nix).uids.haldaemon;
description = "HAL daemon user"; description = "HAL daemon user";
}; };
group = { group = {
name = "haldaemon"; name = "haldaemon";
gid = (import ../system/ids.nix).gids.haldaemon; gid = (import ../../../system/ids.nix).gids.haldaemon;
}; };
fdi = fdi =
@ -87,10 +87,10 @@ in
mkIf cfg.enable { mkIf cfg.enable {
require = [ require = [
../upstart-jobs/default.nix # config.services.extraJobs # ../upstart-jobs/default.nix # config.services.extraJobs
# ../system/user.nix # users.* # ../system/user.nix # users.*
# ../upstart-jobs/udev.nix # services.udev.* # ../upstart-jobs/udev.nix # services.udev.*
../upstart-jobs/dbus.nix # services.dbus.* # ../upstart-jobs/dbus.nix # services.dbus.*
# ? # config.environment.extraPackages # ? # config.environment.extraPackages
options options
]; ];

View File

@ -44,7 +44,7 @@ let
startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces"; startingDependency = if config.services.gw6c.enable then "gw6c" else "network-interfaces";
cfg = config.services.dovecot; cfg = config.services.dovecot;
idList = import ../system/ids.nix; idList = import ../../../system/ids.nix;
dovecotConf = dovecotConf =
'' ''

View File

@ -156,7 +156,7 @@ let
user = cfg.user; user = cfg.user;
group = cfg.group; group = cfg.group;
setgidGroup = cfg.setgidGroup; setgidGroup = cfg.setgidGroup;
idList = import ../system/ids.nix; idList = import ../../../system/ids.nix;
optionalString = pkgs.lib.optionalString; optionalString = pkgs.lib.optionalString;
concatStringsSep = pkgs.lib.concatStringsSep; concatStringsSep = pkgs.lib.concatStringsSep;

View File

@ -48,8 +48,8 @@ in
mkIf cfg.enable { mkIf cfg.enable {
require = [ require = [
../upstart-jobs/default.nix #../upstart-jobs/default.nix
../upstart-jobs/dbus.nix # services.dbus.* #../upstart-jobs/dbus.nix # services.dbus.*
options options
]; ];

View File

@ -78,7 +78,7 @@ mkIf enable {
services = { services = {
extraJobs = [{ extraJobs = [{
name = "showManual"; name = "nixos-manual";
job = '' job = ''
description "NixOS manual" description "NixOS manual"

View File

@ -137,7 +137,7 @@ let
user = { user = {
name = nagiosUser; name = nagiosUser;
uid = (import ../../system/ids.nix).uids.nagios; uid = (import ../../../../system/ids.nix).uids.nagios;
description = "Nagios monitoring daemon"; description = "Nagios monitoring daemon";
home = nagiosState; home = nagiosState;
}; };
@ -175,7 +175,7 @@ in
mkIf cfg.enable { mkIf cfg.enable {
require = [ require = [
../../upstart-jobs/default.nix # config.services.extraJobs # ../../upstart-jobs/default.nix # config.services.extraJobs
# ../../system/user.nix # users = { .. } # ../../system/user.nix # users = { .. }
# ? # config.environment.etc # ? # config.environment.etc
# ? # config.environment.extraPackages # ? # config.environment.extraPackages

View File

@ -52,7 +52,7 @@ let
user = { user = {
name = "zabbix"; name = "zabbix";
uid = (import ../system/ids.nix).uids.zabbix; uid = (import ../../../system/ids.nix).uids.zabbix;
description = "Zabbix daemon user"; description = "Zabbix daemon user";
}; };
@ -93,7 +93,7 @@ in
{ {
require = [ require = [
../upstart-jobs/default.nix # ../upstart-jobs/default.nix
# ../system/user.nix # users = { .. } # ../system/user.nix # users = { .. }
options options
]; ];

View File

@ -42,7 +42,7 @@ let
user = { user = {
name = "zabbix"; name = "zabbix";
uid = (import ../system/ids.nix).uids.zabbix; uid = (import ../../../system/ids.nix).uids.zabbix;
description = "Zabbix daemon user"; description = "Zabbix daemon user";
}; };
@ -86,7 +86,7 @@ in
{ {
require = [ require = [
../upstart-jobs/default.nix # ../upstart-jobs/default.nix
# ../system/user.nix # users = { .. } # ../system/user.nix # users = { .. }
options options
]; ];

View File

@ -120,12 +120,12 @@ in
mkIf cfg.enable { mkIf cfg.enable {
require = [ require = [
../upstart-jobs/default.nix # config.services.extraJobs # ../upstart-jobs/default.nix # config.services.extraJobs
# ../system/? # system.nssModules # ../system/? # system.nssModules
# ? # config.environment.etc # ? # config.environment.etc
# ../system/user.nix # users.* # ../system/user.nix # users.*
# ../upstart-jobs/udev.nix # services.udev.* # ../upstart-jobs/udev.nix # services.udev.*
../upstart-jobs/dbus.nix # services.dbus.* # ../upstart-jobs/dbus.nix # services.dbus.*
# ? # config.environment.extraPackages # ? # config.environment.extraPackages
options options
]; ];
@ -138,14 +138,17 @@ mkIf cfg.enable {
extraPackages = [avahi]; extraPackages = [avahi];
# Name Service Switch configuration file. Required by the C library. # Name Service Switch configuration file. Required by the C library.
# !!! This should be done in some other way, e.g., this module
# should define an option used by the hypothetical module that
# generates nsswitch.conf.
etc = mkIf cfg.nssmdns (mkThenElse { etc = mkIf cfg.nssmdns (mkThenElse {
thenPart = [{ thenPart = [{
source = ../etc/nsswitch-mdns.conf; source = ../../../etc/nsswitch-mdns.conf;
target = "nsswitch.conf"; target = "nsswitch.conf";
}]; }];
elsePart = [{ elsePart = [{
source = ../etc/nsswitch.conf; source = ../../../etc/nsswitch.conf;
target = "nsswitch.conf"; target = "nsswitch.conf";
}]; }];
}); });

View File

@ -55,7 +55,7 @@ in
{ {
require = [ require = [
../upstart-jobs/default.nix #../upstart-jobs/default.nix
options options
]; ];

View File

@ -72,7 +72,7 @@ mkIf config.services.ntp.enable {
users = [ users = [
{ name = ntpUser; { name = ntpUser;
uid = (import ../system/ids.nix).uids.ntp; uid = (import ../../../system/ids.nix).uids.ntp;
description = "NTP daemon user"; description = "NTP daemon user";
home = stateDir; home = stateDir;
} }

View File

@ -37,8 +37,8 @@ in
###### implementation ###### implementation
let uid = (import ../system/ids.nix).uids.portmap; let uid = (import ../../../system/ids.nix).uids.portmap;
gid = (import ../system/ids.nix).gids.portmap; gid = (import ../../../system/ids.nix).gids.portmap;
in in
mkIf config.services.portmap.enable { mkIf config.services.portmap.enable {

View File

@ -85,7 +85,7 @@ let
''; '';
sshdUid = (import ../system/ids.nix).uids.sshd; sshdUid = (import ../../../../system/ids.nix).uids.sshd;
# !!! is this assertion evaluated anywhere??? # !!! is this assertion evaluated anywhere???
assertion = cfg.permitRootLogin == "yes" || assertion = cfg.permitRootLogin == "yes" ||
@ -104,7 +104,7 @@ mkIf config.services.sshd.enable {
users = { users = {
extraUsers = [ extraUsers = [
{ name = "sshd"; { name = "sshd";
uid = (import ../system/ids.nix).uids.sshd; uid = (import ../../../../system/ids.nix).uids.sshd;
description = "SSH privilege separation user"; description = "SSH privilege separation user";
home = "/var/empty"; home = "/var/empty";
} }

View File

@ -95,13 +95,13 @@ mkIf config.services.vsftpd.enable {
users = { users = {
extraUsers = [ extraUsers = [
{ name = "vsftpd"; { name = "vsftpd";
uid = (import ../system/ids.nix).uids.vsftpd; uid = (import ../../../system/ids.nix).uids.vsftpd;
description = "VSFTPD user"; description = "VSFTPD user";
home = "/homeless-shelter"; home = "/homeless-shelter";
} }
] ++ pkgs.lib.optional anonymousUser ] ++ pkgs.lib.optional anonymousUser
{ name = "ftp"; { name = "ftp";
uid = (import ../system/ids.nix).uids.ftp; uid = (import ../../../system/ids.nix).uids.ftp;
group = "ftp"; group = "ftp";
description = "Anonymous ftp user"; description = "Anonymous ftp user";
home = "/home/ftp"; home = "/home/ftp";
@ -109,7 +109,7 @@ mkIf config.services.vsftpd.enable {
extraGroups = [ extraGroups = [
{ name = "ftp"; { name = "ftp";
gid = (import ../system/ids.nix).gids.ftp; gid = (import ../../../system/ids.nix).gids.ftp;
} }
]; ];

View File

@ -37,14 +37,14 @@ let
user = { user = {
name = "atd"; name = "atd";
uid = (import ../system/ids.nix).uids.atd; uid = (import ../../../system/ids.nix).uids.atd;
description = "atd user"; description = "atd user";
home = "/var/empty"; home = "/var/empty";
}; };
group = { group = {
name = "atd"; name = "atd";
gid = (import ../system/ids.nix).gids.atd; gid = (import ../../../system/ids.nix).gids.atd;
}; };
job = '' job = ''
@ -95,13 +95,13 @@ mkIf cfg.enable {
options options
# config.services.extraJobs # config.services.extraJobs
../upstart-jobs/default.nix #../upstart-jobs/default.nix
# config.environment.etc # config.environment.etc
../etc/default.nix #../etc/default.nix
# users.* # users.*
../system/users-groups.nix #../system/users-groups.nix
# ? # config.environment.extraPackages # ? # config.environment.extraPackages
# ? # config.security.extraSetuidPrograms # ? # config.security.extraSetuidPrograms
@ -121,7 +121,7 @@ mkIf cfg.enable {
extraPackages = [ at ]; extraPackages = [ at ];
etc = [{ etc = [{
source = ../etc/pam.d/atd; source = ./atd.pam;
target = "pam.d/atd"; target = "pam.d/atd";
}]; }];
}; };

View File

@ -54,7 +54,7 @@ in
{ {
require = [ require = [
../upstart-jobs/default.nix # config.services.extraJobs # ../upstart-jobs/default.nix # config.services.extraJobs
# ? # config.time.timeZone # ? # config.time.timeZone
# ? # config.environment.etc # ? # config.environment.etc
# ? # config.environment.extraPackages # ? # config.environment.extraPackages

View File

@ -43,8 +43,8 @@ in
mkIf cfg.enable { mkIf cfg.enable {
require = [ require = [
../upstart-jobs/default.nix # config.services.extraJobs #../upstart-jobs/default.nix # config.services.extraJobs
../upstart-jobs/dbus.nix # services.dbus.* #../upstart-jobs/dbus.nix # services.dbus.*
options options
]; ];

View File

@ -55,7 +55,7 @@ let
user = { user = {
name = "messagebus"; name = "messagebus";
uid = (import ../system/ids.nix).uids.messagebus; uid = (import ../../../system/ids.nix).uids.messagebus;
description = "D-Bus system message bus daemon user"; description = "D-Bus system message bus daemon user";
home = homeDir; home = homeDir;
}; };
@ -96,7 +96,7 @@ in
mkIf cfg.enable { mkIf cfg.enable {
require = [ require = [
../upstart-jobs/default.nix # config.services.extraJobs # ../upstart-jobs/default.nix # config.services.extraJobs
# ../system/user.nix # users.* # ../system/user.nix # users.*
# ? # config.environment.extraPackages # ? # config.environment.extraPackages
options options

View File

@ -13,7 +13,7 @@ in
users = [ users = [
{ name = "nscd"; { name = "nscd";
uid = (import ../system/ids.nix).uids.nscd; uid = (import ../../../system/ids.nix).uids.nscd;
description = "Name service cache daemon user"; description = "Name service cache daemon user";
} }
]; ];

View File

@ -47,7 +47,7 @@ in
mkIf cfg.enable { mkIf cfg.enable {
require = [ require = [
../upstart-jobs/default.nix # config.services.extraJobs # ../upstart-jobs/default.nix # config.services.extraJobs
# /etc/security/console.perms (should be generated ?) # /etc/security/console.perms (should be generated ?)
options options
]; ];

View File

@ -195,7 +195,7 @@ let
}; };
} // # Include the options shared between the main server and virtual hosts. } // # Include the options shared between the main server and virtual hosts.
(import ../../upstart-jobs/apache-httpd/per-server-options.nix { (import ./per-server-options.nix {
inherit mkOption; inherit mkOption;
forMainServer = true; forMainServer = true;
}); });

View File

@ -73,13 +73,13 @@ mkIf config.services.tomcat.enable {
groups = [ groups = [
{ name = "tomcat"; { name = "tomcat";
gid = (import ../system/ids.nix).gids.tomcat; gid = (import ../../../system/ids.nix).gids.tomcat;
} }
]; ];
users = [ users = [
{ name = "tomcat"; { name = "tomcat";
uid = (import ../system/ids.nix).uids.tomcat; uid = (import ../../../system/ids.nix).uids.tomcat;
description = "Tomcat user"; description = "Tomcat user";
home = "/homeless-shelter"; home = "/homeless-shelter";
} }

View File

@ -475,13 +475,13 @@ mkIf cfg.enable {
./desktopManager/default.nix ./desktopManager/default.nix
# services.extraJobs # services.extraJobs
../../upstart-jobs/default.nix # ../../upstart-jobs/default.nix
# environment.etc # environment.etc
../../etc/default.nix # ../../etc/default.nix
# fonts.fonts # fonts.fonts
../../system/fonts.nix # ../../system/fonts.nix
# boot.extraModulePackages # boot.extraModulePackages
# security.extraSetuidPrograms # security.extraSetuidPrograms

View File

@ -68,7 +68,7 @@ mkIf cfg.enable {
]; ];
etc = [ etc = [
{ source = ../../../etc/pam.d/kde; { source = ./kde.pam;
target = "pam.d/kde"; target = "pam.d/kde";
} }
{ source = "${pkgs.xkeyboard_config}/etc/X11/xkb"; { source = "${pkgs.xkeyboard_config}/etc/X11/xkb";

View File

@ -64,7 +64,7 @@ mkIf cfg.enable {
]; ];
etc = [ etc = [
{ source = ../../../etc/pam.d/kde; { source = ./kde.pam;
target = "pam.d/kde"; target = "pam.d/kde";
} }
{ source = "${pkgs.xkeyboard_config}/etc/X11/xkb"; { source = "${pkgs.xkeyboard_config}/etc/X11/xkb";

View File

@ -131,7 +131,7 @@ mkIf cfg.enable {
environment = { environment = {
etc = [ etc = [
{ source = ../../../etc/pam.d/slim; { source = ./slim.pam;
target = "pam.d/slim"; target = "pam.d/slim";
} }
]; ];

View File

@ -42,7 +42,7 @@ in
activateLib = removeAttrs withHeadlines ["activate"]; activateLib = removeAttrs withHeadlines ["activate"];
activateLibNames = attrNames activateLib; activateLibNames = attrNames activateLib;
in { in {
script = pkgs.writeScript "activationScript" script = pkgs.writeScript "nixos-activation-script"
("#!/bin/sh\n" ("#!/bin/sh\n"
+ textClosureMap id activateLib activateLibNames + "\n" + textClosureMap id activateLib activateLibNames + "\n"
# make sure that the activate snippet is added last. # make sure that the activate snippet is added last.

View File

@ -379,133 +379,89 @@ in
}; };
require = [ require = [
#../modules/hardware/network/intel-3945abg.nix
../system/assertion.nix
# boot (is it the right place ?)
../system/kernel.nix
../boot/boot-stage-2.nix ../boot/boot-stage-2.nix
../installer/grub.nix
# system
../system/system-options.nix
../system/activate-configuration.nix
../upstart-jobs/default.nix
../upstart-jobs/acpid.nix # ACPI daemon
../system/unix-odbc-drivers.nix
../upstart-jobs/klogd.nix
../upstart-jobs/lvm.nix # Makes LVM logical volumes available.
../upstart-jobs/swraid.nix # Activate software RAID arrays.
../upstart-jobs/filesystems.nix # Mount file systems.
../upstart-jobs/swap.nix
../upstart-jobs/network-interfaces.nix
../upstart-jobs/nscd.nix # Name service cache daemon.
../upstart-jobs/maintenance-shell.nix # Handles the maintenance/stalled event (single-user shell).
../upstart-jobs/ctrl-alt-delete.nix # Ctrl-alt-delete action.
../upstart-jobs/halt.nix
../upstart-jobs/ifplugd.nix # ifplugd daemon for monitoring Ethernet cables.
# security
../system/sudo.nix
# i18n
../system/i18n.nix
# environment
../etc/default.nix ../etc/default.nix
../installer/grub.nix
../system/nixos-environment.nix ../modules/services/audio/alsa.nix
../modules/services/audio/pulseaudio.nix
# users ../modules/services/databases/mysql.nix
../system/users-groups.nix ../modules/services/databases/postgresql.nix
../modules/services/hardware/acpid.nix
# newtworking ../modules/services/hardware/hal.nix
../upstart-jobs/dhclient.nix ../modules/services/hardware/udev.nix
../modules/services/logging/klogd.nix
# hardware ../modules/services/logging/syslogd.nix
../upstart-jobs/pcmcia.nix ../modules/services/mail/dovecot.nix
../modules/services/mail/postfix.nix
# security ../modules/services/misc/autofs.nix
../system/nixos-security.nix ../modules/services/misc/disnix.nix
../modules/services/misc/nix-daemon.nix
# services ../modules/services/misc/nixos-manual.nix
../upstart-jobs/avahi-daemon.nix ../modules/services/misc/rogue.nix
../upstart-jobs/atd.nix ../modules/services/misc/synergy.nix
../upstart-jobs/dbus.nix ../modules/services/monitoring/nagios/default.nix
../upstart-jobs/hal.nix ../modules/services/monitoring/zabbix-agent.nix
../upstart-jobs/gpm.nix ../modules/services/monitoring/zabbix-server.nix
../upstart-jobs/nagios/default.nix ../modules/services/network-filesystems/nfs-kernel.nix
../upstart-jobs/xserver/default.nix ../modules/services/network-filesystems/samba.nix # TODO: doesn't start here (?)
../upstart-jobs/zabbix-agent.nix ../modules/services/networking/avahi-daemon.nix
../upstart-jobs/zabbix-server.nix ../modules/services/networking/bind.nix
../upstart-jobs/disnix.nix ../modules/services/networking/bitlbee.nix
../upstart-jobs/consolekit.nix ../modules/services/networking/dhclient.nix
../upstart-jobs/cron.nix ../modules/services/networking/dhcpd.nix
../upstart-jobs/fcron.nix ../modules/services/networking/ejabberd.nix # untested, dosen't compile on x86_64-linux
../upstart-jobs/cron/locate.nix ../modules/services/networking/gnunet.nix
../upstart-jobs/manual.nix ../modules/services/networking/gw6c.nix
../upstart-jobs/rogue.nix ../modules/services/networking/ifplugd.nix
../upstart-jobs/guest-users.nix ../modules/services/networking/ircd-hybrid.nix # TODO: doesn't compile on x86_64-linux, can't test
../upstart-jobs/pulseaudio.nix ../modules/services/networking/ntpd.nix
../upstart-jobs/kbd.nix ../modules/services/networking/openfire.nix
../upstart-jobs/gw6c.nix # Gateway6 ../modules/services/networking/openvpn.nix
../upstart-jobs/syslogd.nix ../modules/services/networking/portmap.nix
../upstart-jobs/dhcpd.nix ../modules/services/networking/ssh/lshd.nix # GNU lshd SSH2 deamon (TODO: does neither start nor generate seed file ?)
../upstart-jobs/sshd.nix ../modules/services/networking/ssh/sshd.nix
../upstart-jobs/lshd.nix # GNU lshd SSH2 deamon (TODO: does neither start nor generate seed file ?) ../modules/services/networking/vsftpd.nix
../upstart-jobs/ntpd.nix ../modules/services/printing/cupsd.nix
../upstart-jobs/portmap.nix ../modules/services/scheduling/atd.nix
../upstart-jobs/bitlbee.nix ../modules/services/scheduling/cron.nix
../upstart-jobs/gnunet.nix ../modules/services/scheduling/fcron.nix
../upstart-jobs/ejabberd.nix # untested, dosen't compile on x86_64-linux ../modules/services/system/consolekit.nix
../upstart-jobs/jboss.nix ../modules/services/system/dbus.nix
../upstart-jobs/tomcat.nix # untested, too lazy to get that jdk ../modules/services/system/nscd.nix
../upstart-jobs/httpd.nix # Apache httpd (probably this can be removed ?) ../modules/services/ttys/gpm.nix
../upstart-jobs/apache-httpd # Apache httpd (new style). ../modules/services/ttys/mingetty.nix
../upstart-jobs/vsftpd.nix ../modules/services/web-servers/apache-httpd
../upstart-jobs/cupsd.nix # CUPS printing daemon ../modules/services/web-servers/jboss.nix
../upstart-jobs/udev.nix # The udev daemon creates devices nodes and runs programs when hardware events occur. ../modules/services/web-servers/tomcat.nix # untested, too lazy to get that jdk
../upstart-jobs/samba.nix # TODO: doesn't start here (?) ../modules/services/x11/xfs.nix
../upstart-jobs/ircd-hybrid.nix # TODO: doesn't compile on x86_64-linux, can't test ../modules/services/x11/xserver/default.nix
../upstart-jobs/xfs.nix ../system/activate-configuration.nix
../upstart-jobs/mysql.nix ../system/assertion.nix
../upstart-jobs/postgresql.nix
../upstart-jobs/openfire.nix
../upstart-jobs/postfix.nix
../upstart-jobs/dovecot.nix
../upstart-jobs/bind.nix
../upstart-jobs/mingetty.nix # The terminals on ttyX.
../upstart-jobs/tty-backgrounds.nix
../upstart-jobs/synergy.nix
../upstart-jobs/openvpn.nix
../upstart-jobs/nfs-kernel.nix
../upstart-jobs/autofs.nix
# nix
../upstart-jobs/nix.nix # nix options and daemon
../system/nixos-installer.nix
#users
../upstart-jobs/ldap
# fonts
../system/fonts.nix ../system/fonts.nix
../system/i18n.nix
# sound ../system/kernel.nix
../upstart-jobs/alsa.nix ../system/nixos-environment.nix
../system/nixos-installer.nix
../system/nixos-security.nix
../system/sudo.nix
../system/system-options.nix
../system/unix-odbc-drivers.nix
../system/users-groups.nix
../upstart-jobs/cron/locate.nix
../upstart-jobs/ctrl-alt-delete.nix
../upstart-jobs/default.nix
../upstart-jobs/filesystems.nix
../upstart-jobs/guest-users.nix
../upstart-jobs/halt.nix
../upstart-jobs/kbd.nix
../upstart-jobs/ldap
../upstart-jobs/lvm.nix
../upstart-jobs/maintenance-shell.nix
../upstart-jobs/network-interfaces.nix
../upstart-jobs/pcmcia.nix
../upstart-jobs/swap.nix
../upstart-jobs/swraid.nix
../upstart-jobs/tty-backgrounds.nix
]; ];
} }

View File

@ -45,7 +45,7 @@ in
{ {
require = [ require = [
../../upstart-jobs/cron.nix # config.services.cron # ../../upstart-jobs/cron.nix # config.services.cron
options options
]; ];

View File

@ -1,134 +0,0 @@
{pkgs, config, ...}:
###### interface
let
inherit (pkgs.lib) mkOption mkIf;
# options have been moved to the apache-httpd/default.nix file
in
###### implementation
let
cfg = config.services.httpd;
cfgSvn = cfg.subservices.subversion;
optional = pkgs.lib.optional;
documentRoot = cfg.documentRoot;
hostName = cfg.hostName;
httpPort = cfg.port;
httpsPort = 443;
user = cfg.user;
group = cfg.group;
adminAddr = cfg.adminAddr;
logDir = cfg.logDir;
stateDir = cfg.stateDir;
enableSSL = false;
applicationMappings = cfg.mod_jk.applicationMappings;
startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces";
extraConfig = pkgs.lib.concatStringsSep "\n"
(pkgs.lib.catAttrs "extraHttpdConfig" config.services.extraJobs);
webServer = import ../../services/apache-httpd {
inherit (pkgs) apacheHttpd coreutils;
stdenv = pkgs.stdenv;
php = if cfg.mod_php then pkgs.php else null;
tomcat_connectors = if cfg.mod_jk.enable then pkgs.tomcat_connectors else null;
inherit documentRoot hostName httpPort httpsPort
user group adminAddr logDir stateDir
applicationMappings;
noUserDir = !cfg.enableUserDir;
extraDirectories = extraConfig + "\n" + cfg.extraConfig;
subServices =
# The Subversion subservice.
(optional cfgSvn.enable (
let dataDir = cfgSvn.dataDir; in
import ../../services/subversion ({
reposDir = dataDir + "/repos";
dbDir = dataDir + "/db";
distsDir = dataDir + "/dist";
backupsDir = dataDir + "/backup";
tmpDir = dataDir + "/tmp";
inherit user group logDir adminAddr;
canonicalName =
if webServer.enableSSL then
"https://" + hostName + ":" + (toString httpsPort)
else
"http://" + hostName + ":" + (toString httpPort);
notificationSender = cfgSvn.notificationSender;
autoVersioning = cfgSvn.autoVersioning;
userCreationDomain = cfgSvn.userCreationDomain;
inherit pkgs;
} //
( if cfgSvn.organization.name != null then
{
orgName = cfgSvn.organization.name;
orgLogoFile = cfgSvn.organization.logo;
orgUrl = cfgSvn.organization.url;
}
else
# use the default from the subversion service
{}
)
)
)
);
};
in
mkIf (config.services.httpd.enable && !config.services.httpd.experimental) {
require = [
# options have been moved to the apache-httpd/default.nix file
];
users = {
extraUsers = [
{ name = user;
description = "Apache httpd user";
}
];
extraGroups = [
{ name = group;
}
];
};
services = {
extraJobs = [{
name = "httpd";
job = ''
description \"Apache HTTPD\"
start on ${startingDependency}/started
stop on ${startingDependency}/stop
start script
${webServer}/bin/control prepare
end script
respawn ${webServer}/bin/control run
'';
}];
};
}