2008-12-04 15:48:27 +00:00
|
|
|
{pkgs, config, ...}:
|
2008-08-08 19:56:58 +01:00
|
|
|
|
|
|
|
let
|
2009-01-25 15:49:12 +00:00
|
|
|
inherit (pkgs.lib) mkOption mergeOneOption;
|
2008-08-08 19:56:58 +01:00
|
|
|
in
|
2007-01-08 22:41:41 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
{
|
2006-12-11 16:10:23 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
time = {
|
2006-12-11 17:36:57 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
timeZone = mkOption {
|
|
|
|
default = "CET";
|
|
|
|
example = "America/New_York";
|
|
|
|
description = "The time zone used when displaying times and dates.";
|
|
|
|
};
|
2006-12-11 17:36:57 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2006-12-22 23:34:42 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
|
|
|
|
boot = {
|
|
|
|
|
2008-01-24 16:56:09 +00:00
|
|
|
isLiveCD = mkOption {
|
2007-11-09 18:12:23 +00:00
|
|
|
default = false;
|
|
|
|
description = "
|
2008-01-24 16:56:09 +00:00
|
|
|
If set to true, the root device will be mounted read-only and
|
|
|
|
a ramdisk will be mounted on top of it using unionfs to
|
|
|
|
provide a writable root. This is used for the NixOS
|
|
|
|
Live-CD/DVD.
|
2007-11-09 18:12:23 +00:00
|
|
|
";
|
|
|
|
};
|
2006-12-19 22:12:44 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
hardwareScan = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = "
|
|
|
|
Whether to try to load kernel modules for all detected hardware.
|
|
|
|
Usually this does a good job of providing you with the modules
|
|
|
|
you need, but sometimes it can crash the system or cause other
|
|
|
|
nasty effects. If the hardware scan is turned on, it can be
|
|
|
|
disabled at boot time by adding the <literal>safemode</literal>
|
|
|
|
parameter to the kernel command line.
|
|
|
|
";
|
|
|
|
};
|
2007-01-22 18:58:04 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
copyKernels = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "
|
|
|
|
Whether the Grub menu builder should copy kernels and initial
|
|
|
|
ramdisks to /boot. This is necessary when /nix is on a
|
|
|
|
different file system than /boot.
|
|
|
|
";
|
|
|
|
};
|
2007-06-15 12:40:57 +01:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
localCommands = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "text=anything; echo You can put $text here.";
|
|
|
|
description = "
|
|
|
|
Shell commands to be executed just before Upstart is started.
|
|
|
|
";
|
|
|
|
};
|
2007-03-03 23:20:08 +00:00
|
|
|
|
2008-01-04 16:11:12 +00:00
|
|
|
extraTTYs = mkOption {
|
|
|
|
default = [];
|
|
|
|
example = [8 9];
|
|
|
|
description = "
|
|
|
|
Tty (virtual console) devices, in addition to the consoles on
|
|
|
|
which mingetty and syslogd run, that must be initialised.
|
|
|
|
Only useful if you have some program that you want to run on
|
|
|
|
some fixed console. For example, the NixOS installation CD
|
|
|
|
opens the manual in a web browser on console 7, so it sets
|
|
|
|
<option>boot.extraTTYs</option> to <literal>[7]</literal>.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2006-11-27 15:07:46 +00:00
|
|
|
|
2008-11-18 18:00:09 +00:00
|
|
|
system = {
|
|
|
|
# NSS modules. Hacky!
|
|
|
|
nssModules = mkOption {
|
|
|
|
internal = true;
|
|
|
|
default = [];
|
|
|
|
description = "
|
|
|
|
Search path for NSS (Name Service Switch) modules. This allows
|
|
|
|
several DNS resolution methods to be specified via
|
|
|
|
<filename>/etc/nsswitch.conf</filename>.
|
|
|
|
";
|
|
|
|
merge = pkgs.lib.mergeListOption;
|
|
|
|
apply = list:
|
|
|
|
let
|
|
|
|
list2 =
|
|
|
|
list
|
2008-11-23 01:28:58 +00:00
|
|
|
++ pkgs.lib.optional config.users.ldap.enable pkgs.nss_ldap;
|
2008-11-18 18:00:09 +00:00
|
|
|
in {
|
|
|
|
list = list2;
|
|
|
|
path = pkgs.lib.makeLibraryPath list2;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
sbin = {
|
2009-04-11 23:12:02 +01:00
|
|
|
# !!! The mount option should not stay in /system/option.nix
|
2008-11-18 18:00:09 +00:00
|
|
|
mount = mkOption {
|
|
|
|
internal = true;
|
2009-04-08 15:01:16 +01:00
|
|
|
default = pkgs.utillinuxng.override {
|
2008-11-18 18:00:09 +00:00
|
|
|
buildMountOnly = true;
|
|
|
|
mountHelpers = pkgs.buildEnv {
|
|
|
|
name = "mount-helpers";
|
|
|
|
paths = [
|
|
|
|
pkgs.ntfs3g
|
|
|
|
pkgs.mount_cifs
|
2009-04-11 23:12:02 +01:00
|
|
|
pkgs.nfsUtils
|
2008-11-18 18:00:09 +00:00
|
|
|
];
|
|
|
|
pathsToLink = "/sbin";
|
|
|
|
} + "/sbin";
|
|
|
|
};
|
|
|
|
description = "
|
2009-05-25 18:41:03 +01:00
|
|
|
A patched `mount' command that looks in a directory in the Nix
|
|
|
|
store instead of in /sbin for mount helpers (like mount.ntfs-3g or
|
|
|
|
mount.cifs).
|
2008-11-18 18:00:09 +00:00
|
|
|
";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2006-11-27 15:07:46 +00:00
|
|
|
|
2008-02-04 10:52:58 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
networking = {
|
2007-02-12 16:00:55 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
hostName = mkOption {
|
|
|
|
default = "nixos";
|
2007-12-04 15:02:48 +00:00
|
|
|
description = "
|
|
|
|
The name of the machine. Leave it empty if you want to obtain
|
|
|
|
it from a DHCP server (if using DHCP).
|
|
|
|
";
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2007-02-12 16:00:55 +00:00
|
|
|
|
2008-06-30 16:13:02 +01:00
|
|
|
nativeIPv6 = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "
|
|
|
|
Whether to use IPv6 even though gw6c is not used. For example,
|
2008-07-23 15:13:27 +01:00
|
|
|
for Postfix.
|
2008-06-30 16:13:02 +01:00
|
|
|
";
|
|
|
|
};
|
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
extraHosts = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "192.168.0.1 lanlocalhost";
|
2008-08-09 13:03:08 +01:00
|
|
|
description = ''
|
|
|
|
Additional entries to be appended to <filename>/etc/hosts</filename>.
|
|
|
|
'';
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2007-03-03 23:20:08 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
defaultGateway = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "131.211.84.1";
|
|
|
|
description = "
|
|
|
|
The default gateway. It can be left empty if it is auto-detected through DHCP.
|
|
|
|
";
|
|
|
|
};
|
2007-08-14 17:43:56 +01:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
nameservers = mkOption {
|
|
|
|
default = [];
|
|
|
|
example = ["130.161.158.4" "130.161.33.17"];
|
|
|
|
description = "
|
|
|
|
The list of nameservers. It can be left empty if it is auto-detected through DHCP.
|
|
|
|
";
|
|
|
|
};
|
2007-08-14 17:43:56 +01:00
|
|
|
|
2007-11-23 17:12:37 +00:00
|
|
|
domain = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "home";
|
|
|
|
description = "
|
|
|
|
The domain. It can be left empty if it is auto-detected through DHCP.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
localCommands = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "text=anything; echo You can put $text here.";
|
|
|
|
description = "
|
|
|
|
Shell commands to be executed at the end of the
|
|
|
|
<literal>network-interfaces</literal> Upstart job. Note that if
|
|
|
|
you are using DHCP to obtain the network configuration,
|
|
|
|
interfaces may not be fully configured yet.
|
|
|
|
";
|
|
|
|
};
|
2007-08-14 17:43:56 +01:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
defaultMailServer = {
|
2007-11-08 18:15:12 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
directDelivery = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "
|
|
|
|
Use the trivial Mail Transfer Agent (MTA)
|
|
|
|
<command>ssmtp</command> package to allow programs to send
|
2007-11-10 13:35:15 +00:00
|
|
|
e-mail. If you don't want to run a ``real'' MTA like
|
2007-11-09 18:12:23 +00:00
|
|
|
<command>sendmail</command> or <command>postfix</command> on
|
|
|
|
your machine, set this option to <literal>true</literal>, and
|
|
|
|
set the option
|
|
|
|
<option>networking.defaultMailServer.hostName</option> to the
|
|
|
|
host name of your preferred mail server.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
|
|
|
hostName = mkOption {
|
|
|
|
example = "mail.example.org";
|
|
|
|
description = "
|
|
|
|
The host name of the default mail server to use to deliver
|
|
|
|
e-mail.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
2007-11-23 17:12:37 +00:00
|
|
|
domain = mkOption {
|
|
|
|
default = "";
|
|
|
|
example = "example.org";
|
|
|
|
description = "
|
|
|
|
The domain from which mail will appear to be sent.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
useTLS = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "
|
|
|
|
Whether TLS should be used to connect to the default mail
|
|
|
|
server.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
|
|
|
useSTARTTLS = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "
|
|
|
|
Whether the STARTTLS should be used to connect to the default
|
|
|
|
mail server. (This is needed for TLS-capable mail servers
|
|
|
|
running on the default SMTP port 25.)
|
|
|
|
";
|
|
|
|
};
|
2007-11-08 18:15:12 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2007-11-08 18:15:12 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2007-11-08 18:15:12 +00:00
|
|
|
|
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
fileSystems = mkOption {
|
2009-03-09 19:18:27 +00:00
|
|
|
default = null;
|
2006-11-27 15:07:46 +00:00
|
|
|
example = [
|
2006-12-21 00:16:20 +00:00
|
|
|
{ mountPoint = "/";
|
|
|
|
device = "/dev/hda1";
|
|
|
|
}
|
|
|
|
{ mountPoint = "/data";
|
|
|
|
device = "/dev/hda2";
|
2006-12-21 14:44:22 +00:00
|
|
|
fsType = "ext3";
|
2006-12-21 00:16:20 +00:00
|
|
|
options = "data=journal";
|
2006-11-27 15:07:46 +00:00
|
|
|
}
|
2007-01-10 13:58:48 +00:00
|
|
|
{ mountPoint = "/bigdisk";
|
|
|
|
label = "bigdisk";
|
|
|
|
}
|
2006-11-27 15:07:46 +00:00
|
|
|
];
|
|
|
|
description = "
|
2006-12-21 00:16:20 +00:00
|
|
|
The file systems to be mounted. It must include an entry for
|
2008-08-09 00:01:30 +01:00
|
|
|
the root directory (<literal>mountPoint = \"/\"</literal>). Each
|
2006-12-21 01:07:23 +00:00
|
|
|
entry in the list is an attribute set with the following fields:
|
|
|
|
<literal>mountPoint</literal>, <literal>device</literal>,
|
2006-12-21 14:44:22 +00:00
|
|
|
<literal>fsType</literal> (a file system type recognised by
|
2006-12-21 01:07:23 +00:00
|
|
|
<command>mount</command>; defaults to
|
2006-12-21 14:44:22 +00:00
|
|
|
<literal>\"auto\"</literal>), and <literal>options</literal>
|
|
|
|
(the mount options passed to <command>mount</command> using the
|
|
|
|
<option>-o</option> flag; defaults to <literal>\"defaults\"</literal>).
|
2007-01-10 13:58:48 +00:00
|
|
|
|
|
|
|
Instead of specifying <literal>device</literal>, you can also
|
2007-01-23 11:18:23 +00:00
|
|
|
specify a volume label (<literal>label</literal>) for file
|
2007-01-10 13:58:48 +00:00
|
|
|
systems that support it, such as ext2/ext3 (see <command>mke2fs
|
|
|
|
-L</command>).
|
2007-12-31 08:52:59 +00:00
|
|
|
|
|
|
|
<literal>autocreate</literal> forces <literal>mountPoint</literal> to be created with
|
|
|
|
<command>mkdir -p</command> .
|
2006-11-27 15:07:46 +00:00
|
|
|
";
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2006-11-27 15:07:46 +00:00
|
|
|
|
2006-12-18 17:41:57 +00:00
|
|
|
|
2007-11-09 18:12:23 +00:00
|
|
|
swapDevices = mkOption {
|
2006-12-21 01:07:23 +00:00
|
|
|
default = [];
|
2007-01-10 13:07:57 +00:00
|
|
|
example = [
|
2007-11-09 18:12:23 +00:00
|
|
|
{ device = "/dev/hda7"; }
|
|
|
|
{ device = "/var/swapfile"; }
|
|
|
|
{ label = "bigswap"; }
|
2007-01-10 13:07:57 +00:00
|
|
|
];
|
2006-12-21 01:07:23 +00:00
|
|
|
description = "
|
|
|
|
The swap devices and swap files. These must have been
|
2007-01-10 13:07:57 +00:00
|
|
|
initialised using <command>mkswap</command>. Each element
|
|
|
|
should be an attribute set specifying either the path of the
|
|
|
|
swap device or file (<literal>device</literal>) or the label
|
|
|
|
of the swap device (<literal>label</literal>, see
|
2007-01-23 11:06:31 +00:00
|
|
|
<command>mkswap -L</command>). Using a label is
|
2007-01-10 13:07:57 +00:00
|
|
|
recommended.
|
2006-12-21 01:07:23 +00:00
|
|
|
";
|
2007-11-09 18:12:23 +00:00
|
|
|
};
|
2006-12-21 01:07:23 +00:00
|
|
|
|
2007-12-20 11:36:30 +00:00
|
|
|
nesting = {
|
2008-01-02 13:05:24 +00:00
|
|
|
children = mkOption {
|
|
|
|
default = [];
|
2008-01-02 15:31:04 +00:00
|
|
|
description = "
|
2008-01-02 13:05:24 +00:00
|
|
|
Additional configurations to build.
|
2008-01-02 15:31:04 +00:00
|
|
|
";
|
2008-01-02 13:05:24 +00:00
|
|
|
};
|
2007-12-20 11:36:30 +00:00
|
|
|
};
|
2007-11-09 18:12:23 +00:00
|
|
|
|
2009-02-22 16:08:33 +00:00
|
|
|
|
2008-10-01 16:56:01 +01:00
|
|
|
passthru = mkOption {
|
|
|
|
default = {};
|
|
|
|
description = "
|
|
|
|
Additional parameters. Ignored. When you want to be sure that
|
|
|
|
/etc/nixos/nixos -A config.passthru.* is that same thing the
|
|
|
|
system rebuild will use.
|
|
|
|
";
|
|
|
|
};
|
|
|
|
|
2009-05-27 10:09:17 +01:00
|
|
|
require = import ../modules/module-list.nix;
|
2007-11-09 18:12:23 +00:00
|
|
|
}
|