2007-01-16 17:09:43 +01:00
|
|
|
{config, pkgs, upstartJobs, systemPath, wrapperDir}:
|
2006-12-11 16:32:10 +01:00
|
|
|
|
2007-01-16 17:09:43 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
optional = option: file:
|
|
|
|
if config.get option then [file] else [];
|
|
|
|
|
2007-01-30 15:58:04 +01:00
|
|
|
envConf = pkgs.writeText "environment" "
|
2007-02-06 11:17:13 +01:00
|
|
|
PATH=${systemPath}/bin:${systemPath}/sbin:${pkgs.openssh}/bin
|
2007-03-01 16:31:05 +01:00
|
|
|
NIX_REMOTE=daemon
|
2007-02-06 11:17:13 +01:00
|
|
|
" /* ${pkgs.openssh}/bin is a hack to get remote scp to work */;
|
2007-01-26 16:32:49 +01:00
|
|
|
|
2007-01-16 17:09:43 +01:00
|
|
|
in
|
|
|
|
|
2006-12-11 16:32:10 +01:00
|
|
|
import ../helpers/make-etc.nix {
|
|
|
|
inherit (pkgs) stdenv;
|
|
|
|
|
|
|
|
configFiles = [
|
|
|
|
|
|
|
|
{ # TCP/UDP port assignments.
|
|
|
|
source = pkgs.iana_etc + "/etc/services";
|
|
|
|
target = "services";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # IP protocol numbers.
|
|
|
|
source = pkgs.iana_etc + "/etc/protocols";
|
|
|
|
target = "protocols";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Hostname-to-IP mappings.
|
|
|
|
source = ./etc/hosts;
|
|
|
|
target = "hosts";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Name Service Switch configuration file. Required by the C library.
|
|
|
|
source = ./etc/nsswitch.conf;
|
|
|
|
target = "nsswitch.conf";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Configuration file for the system logging daemon.
|
|
|
|
source = ./etc/syslog.conf;
|
|
|
|
target = "syslog.conf";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Friendly greeting on the virtual consoles.
|
|
|
|
source = ./etc/issue;
|
|
|
|
target = "issue";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Configuration for pwdutils (login, passwd, useradd, etc.).
|
|
|
|
# You cannot login without it!
|
|
|
|
source = ./etc/login.defs;
|
|
|
|
target = "login.defs";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # The Upstart events defined above.
|
|
|
|
source = upstartJobs + "/etc/event.d";
|
|
|
|
target = "event.d";
|
|
|
|
}
|
|
|
|
|
|
|
|
{ # Configuration for passwd and friends (e.g., hash algorithm
|
|
|
|
# for /etc/passwd).
|
|
|
|
source = ./etc/default/passwd;
|
|
|
|
target = "default/passwd";
|
|
|
|
}
|
|
|
|
|
2006-12-22 18:28:25 +01:00
|
|
|
{ # Dhclient hooks for emitting ip-up/ip-down events.
|
|
|
|
source = pkgs.substituteAll {
|
|
|
|
src = ./etc/dhclient-exit-hooks;
|
2007-01-23 11:22:00 +01:00
|
|
|
inherit (pkgs) upstart glibc;
|
2006-12-22 18:28:25 +01:00
|
|
|
};
|
|
|
|
target = "dhclient-exit-hooks";
|
|
|
|
}
|
2007-01-15 15:43:56 +01:00
|
|
|
|
|
|
|
{ # Script executed when the shell starts.
|
|
|
|
source = pkgs.substituteAll {
|
|
|
|
src = ./etc/profile.sh;
|
|
|
|
inherit systemPath wrapperDir;
|
|
|
|
inherit (pkgs) kernel;
|
2007-01-17 13:33:23 +01:00
|
|
|
timeZone = config.get ["time" "timeZone"];
|
2007-01-15 15:43:56 +01:00
|
|
|
};
|
|
|
|
target = "profile";
|
|
|
|
}
|
2007-01-16 17:09:43 +01:00
|
|
|
|
2006-12-11 16:32:10 +01:00
|
|
|
]
|
|
|
|
|
2007-01-22 17:42:29 +01:00
|
|
|
# Configuration file for fontconfig used to locate
|
|
|
|
# (X11) client-rendered fonts.
|
|
|
|
++ (optional ["fonts" "enableFontConfig"] {
|
|
|
|
source = pkgs.runCommand "fonts.conf"
|
|
|
|
{
|
2007-02-25 16:53:57 +01:00
|
|
|
fontDirectories = import ./fonts.nix {inherit pkgs;};
|
2007-01-22 17:42:29 +01:00
|
|
|
buildInputs = [pkgs.libxslt];
|
|
|
|
inherit (pkgs) fontconfig;
|
|
|
|
}
|
|
|
|
"xsltproc --stringparam fontDirectories \"$fontDirectories\" \\
|
|
|
|
${./etc/fonts/make-fonts-conf.xsl} $fontconfig/etc/fonts/fonts.conf \\
|
|
|
|
> $out
|
|
|
|
";
|
|
|
|
target = "fonts/fonts.conf";
|
|
|
|
})
|
|
|
|
|
2007-01-16 17:09:43 +01:00
|
|
|
# LDAP configuration.
|
|
|
|
++ (optional ["users" "ldap" "enable"] {
|
|
|
|
source = import etc/ldap.conf.nix {
|
|
|
|
inherit (pkgs) writeText;
|
|
|
|
inherit config;
|
|
|
|
};
|
|
|
|
target = "ldap.conf";
|
|
|
|
})
|
|
|
|
|
2006-12-11 16:32:10 +01:00
|
|
|
# A bunch of PAM configuration files for various programs.
|
|
|
|
++ (map
|
|
|
|
(program:
|
|
|
|
{ source = pkgs.substituteAll {
|
|
|
|
src = ./etc/pam.d + ("/" + program);
|
2007-01-16 17:09:43 +01:00
|
|
|
inherit (pkgs) pam_unix2;
|
|
|
|
pam_ldap =
|
|
|
|
if config.get ["users" "ldap" "enable"]
|
|
|
|
then pkgs.pam_ldap
|
|
|
|
else "/no-such-path";
|
2007-01-16 23:25:28 +01:00
|
|
|
inherit (pkgs.xorg) xauth;
|
2007-01-30 15:58:04 +01:00
|
|
|
inherit envConf;
|
2006-12-11 16:32:10 +01:00
|
|
|
};
|
|
|
|
target = "pam.d/" + program;
|
|
|
|
}
|
|
|
|
)
|
|
|
|
[
|
|
|
|
"login"
|
2007-01-11 16:32:48 +01:00
|
|
|
"su"
|
2006-12-16 22:48:12 +01:00
|
|
|
"other"
|
2006-12-11 16:32:10 +01:00
|
|
|
"passwd"
|
2006-12-16 22:48:12 +01:00
|
|
|
"shadow"
|
|
|
|
"sshd"
|
2006-12-11 16:32:10 +01:00
|
|
|
"useradd"
|
2007-02-26 22:18:13 +01:00
|
|
|
"chsh"
|
2007-01-30 16:03:43 +01:00
|
|
|
"common"
|
2006-12-11 16:32:10 +01:00
|
|
|
]
|
|
|
|
);
|
2007-02-26 22:18:13 +01:00
|
|
|
}
|