* Synced with trunk @ 14801

svn path=/nixos/branches/modular-nixos/; revision=14953
This commit is contained in:
Nicolas Pierron 2009-04-08 14:01:16 +00:00
commit 3f1dd56e9e
19 changed files with 131 additions and 77 deletions

View File

@ -53,9 +53,11 @@ rec {
cp ${pkgs.e2fsprogs}/sbin/e2fsck $out/bin
cp ${pkgs.e2fsprogs}/sbin/tune2fs $out/bin
cp ${pkgs.e2fsprogs}/sbin/fsck $out/bin
cp ${pkgs.reiserfsprogs}/sbin/reiserfsck $out/bin
ln -s e2fsck $out/bin/fsck.ext2
ln -s e2fsck $out/bin/fsck.ext3
ln -s e2fsck $out/bin/fsck.ext4
ln -s reiserfsck $out/bin/fsck.reiserfs
cp -pd ${pkgs.e2fsprogs}/lib/lib*.so.* $out/lib
@ -66,6 +68,9 @@ rec {
cp $lvm2/sbin/lvm $out/bin/lvm
fi
# Add RAID mdadm tool.
cp ${pkgs.mdadm}/sbin/mdadm $out/bin/mdadm
# Copy udev.
cp ${pkgs.udev}/sbin/udevd ${pkgs.udev}/sbin/udevadm $out/bin
cp ${pkgs.udev}/lib/udev/*_id $out/bin
@ -100,6 +105,8 @@ rec {
$out/bin/dmsetup --version | grep "version:"
LVM_SYSTEM_DIR=$out $out/bin/lvm 2>&1 | grep "LVM"
fi
$out/bin/reiserfsck -V
$out/bin/mdadm --version
''; # */

View File

@ -4,9 +4,9 @@ let
let env = builtins.getEnv name; in
if env == "" then default else env;
configuration = import (fromEnv "NIXOS_CONFIG" /etc/nixos/configuration.nix);
nixpkgsPath = fromEnv "NIXPKGS" /etc/nixos/nixpkgs;
nixpkgs = fromEnv "NIXPKGS" /etc/nixos/nixpkgs;
system = import system/system.nix { inherit configuration nixpkgsPath; };
system = import system/system.nix { inherit configuration nixpkgs; };
in

View File

@ -1,14 +1,12 @@
{nixpkgsPath ? ../../../nixpkgs, nixpkgs ? null}:
{nixpkgs ? ../../../nixpkgs}:
let
pkgs = if nixpkgs == null then
import "${nixpkgsPath}/pkgs/top-level/all-packages.nix" {}
else nixpkgs;
pkgs = import nixpkgs {};
options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext
(builtins.toXML (pkgs.lib.optionAttrSetToDocList ""
(import ../../system/system.nix {inherit nixpkgsPath; configuration = {};}).optionDeclarations)));
(import ../../system/system.nix {inherit nixpkgs; configuration = {};}).optionDeclarations)));
optionsDocBook = pkgs.runCommand "options-db.xml" {} ''
${pkgs.libxslt}/bin/xsltproc -o $out ${./options-to-docbook.xsl} ${options}

View File

@ -190,6 +190,7 @@ let
"useradd"
"chsh"
"xlock"
"samba"
"cups"
"ftp"
"common"

4
etc/pam.d/samba Normal file
View File

@ -0,0 +1,4 @@
auth include common
account include common
password include common
session include common

View File

@ -1,4 +1,4 @@
{ stdenv, perl, cdrkit, nixpkgsPath
{ stdenv, perl, cdrkit, nixpkgs
, # The file name of the resulting ISO image.
isoName ? "cd.iso"
@ -11,13 +11,11 @@
, # In addition to `contents', the closure of the store paths listed
# in `packages' are also placed in the Nix store of the CD. This is
# a list of attribute sets {source, target} where `source' if a
# store path whose closure will be copied, and `target' is a symlink
# to `source' that will be added to the CD.
# a list of attribute sets {object, symlink} where `object' if a
# store path whose closure will be copied, and `symlink' is a
# symlink to `object' that will be added to the CD.
storeContents ? []
, buildStoreContents ? []
, # Whether this should be an El-Torito bootable CD.
bootable ? false
@ -52,7 +50,5 @@ stdenv.mkDerivation {
# For obtaining the closure of `storeContents'.
exportReferencesGraph =
map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
exportBuildReferencesGraph =
map (x: [("closure-build-" + baseNameOf x.object) x.object]) buildStoreContents;
pathsFromGraph = "${nixpkgsPath}/pkgs/build-support/kernel/paths-from-graph.pl";
pathsFromGraph = "${nixpkgs}/pkgs/build-support/kernel/paths-from-graph.pl";
}

View File

@ -461,22 +461,17 @@ rec {
};
# Closures to be copied to the Nix store on the CD.
storeContents = lib.uniqListExt {
inputList= lib.concatLists
(map systemPackInstallClosures systemPacks);
getter = x : x.object.drvPath;
compare = lib.eqStrings;
};
buildStoreContents = lib.uniqList
{
inputList=([]
++
(if includeBuildDeps then lib.concatLists
(map systemPackInstallBuildClosure systemPacks)
else [])
);
};
storeContents =
lib.uniqListExt {
inputList = lib.concatLists
(map systemPackInstallClosures systemPacks);
getter = x: x.object.drvPath;
compare = lib.eqStrings;
}
++ lib.uniqList {
inputList = lib.optionals includeBuildDeps
(lib.concatLists (map systemPackInstallBuildClosure systemPacks));
};
bootable = true;
bootImage = "boot/grub/stage2_eltorito";

View File

@ -4,7 +4,7 @@
then builtins.readFile ../../relname
else "nixos-${builtins.readFile ../../VERSION}"
, compressImage ? false
, nixpkgsPath ? ../../../nixpkgs
, nixpkgs ? ../../../nixpkgs
}:
rec {
@ -190,7 +190,7 @@ rec {
pkgs.gdb # for debugging Nix
pkgs.testdisk # useful for repairing boot problems
pkgs.mssys # for writing Microsoft boot sectors / MBRs
pkgs.ntfsprogs # for resizing NTFS partitions
pkgs.sshfsFuse
pkgs.screen
];
@ -200,7 +200,7 @@ rec {
system = import ../../system/system.nix {
inherit configuration platform nixpkgsPath;
inherit configuration platform nixpkgs;
};
@ -211,7 +211,7 @@ rec {
# 0.11 (you won't get the manual).
manual =
if builtins ? unsafeDiscardStringContext
then "${import ../../doc/manual {inherit nixpkgsPath;}}/manual.html"
then "${import ../../doc/manual {inherit nixpkgs;}}/manual.html"
else pkgs.writeText "dummy-manual" "Manual not included in this build!";
@ -230,7 +230,7 @@ rec {
# Put Nixpkgs in a tarball.
nixpkgsTarball = makeTarball "nixpkgs.tar.bz2" nixpkgsPath;
nixpkgsTarball = makeTarball "nixpkgs.tar.bz2" nixpkgs;
# The configuration file for Grub.
@ -255,7 +255,7 @@ rec {
# Create an ISO image containing the Grub boot loader, the kernel,
# the initrd produced above, and the closure of the stage 2 init.
rescueCD = import ../../helpers/make-iso9660-image.nix {
inherit nixpkgsPath;
inherit nixpkgs;
inherit (pkgs) stdenv perl cdrkit;
isoName = "${relName}-${platform}.iso";

View File

@ -1,3 +1,5 @@
{ nixpkgs ? ../nixpkgs-wc }:
let
@ -5,12 +7,11 @@ let
tarball =
{ nixosSrc ? {path = ./.; rev = 1234;}
, nixpkgs ? {path = ../nixpkgs-wc;}
{ nixosSrc ? {outPath = ./.; rev = 1234;}
, officialRelease ? false
}:
with import nixpkgs.path {};
with import nixpkgs {};
releaseTools.makeSourceTarball {
name = "nixos-tarball";
@ -22,7 +23,7 @@ let
inherit officialRelease;
distPhase = ''
releaseName=nixos-$VERSION
releaseName=nixos-$VERSION$VERSION_SUFFIX
ensureDir "$out/tarballs"
mkdir ../$releaseName
cp -prd . ../$releaseName
@ -33,34 +34,32 @@ let
manual =
{ nixosSrc ? {path = ./.; rev = 1234;}
, nixpkgs ? {path = ../nixpkgs-wc;}
{ nixosSrc ? {outPath = ./.; rev = 1234;}
, officialRelease ? false
}:
import "${nixosSrc.path}/doc/manual" {
nixpkgsPath = nixpkgs.path;
import "${nixosSrc}/doc/manual" {
inherit nixpkgs;
};
iso =
{ nixosSrc ? {path = ./.; rev = 1234;}
, nixpkgs ? {path = ../nixpkgs-wc;}
{ nixosSrc ? {outPath = ./.; rev = 1234;}
, officialRelease ? false
, system ? "i686-linux"
}:
with import nixpkgs.path {inherit system;};
with import nixpkgs {inherit system;};
let
version = builtins.readFile ./VERSION + (if officialRelease then "" else "pre${toString nixosSrc.rev}");
iso = (import "${nixosSrc.path}/installer/cd-dvd/rescue-cd.nix" {
iso = (import "${nixosSrc}/installer/cd-dvd/rescue-cd.nix" {
platform = system;
compressImage = true;
nixpkgsPath = nixpkgs.path;
relName = "nixos-${version}";
inherit nixpkgs;
}).rescueCD;
in
@ -79,4 +78,4 @@ let
};
in jobs
in jobs

View File

@ -19,7 +19,7 @@ let
Additional attributes may be needed depending on your
configuration. For instance, if you use the NVIDIA X driver,
then it also needs to contain an attribute
<varname>nvidiaDrivers</varname>.
<varname>nvidia_x11</varname>.
";
};
@ -52,7 +52,7 @@ let
extraModulePackages = mkOption {
default = [];
# !!! example = [pkgs.aufs pkgs.nvidiaDrivers];
# !!! example = [pkgs.aufs pkgs.nvidia_x11];
description = ''
A list of additional packages supplying kernel modules.
'';

View File

@ -164,7 +164,7 @@ in
mount = mkOption {
internal = true;
default = pkgs.utillinux.passthru.function {
default = pkgs.utillinuxng.override {
buildMountOnly = true;
mountHelpers = pkgs.buildEnv {
name = "mount-helpers";

View File

@ -1,7 +1,6 @@
{ platform ? __currentSystem
, configuration
, nixpkgsPath ? ../../nixpkgs
, nixpkgs ? null
, nixpkgs ? ../../nixpkgs
}:
rec {
@ -25,9 +24,7 @@ rec {
pkgs configComponents
config;
pkgs = if nixpkgs == null then
import "${nixpkgsPath}/pkgs/top-level/all-packages.nix" {system = platform;}
else nixpkgs;
pkgs = import nixpkgs {system = platform;};
manifests = config.installer.manifests; # exported here because nixos-rebuild uses it

View File

@ -19,7 +19,7 @@ let
# Build a Subversion instance with Apache modules and Swig/Python bindings.
subversion = pkgs.subversion15.function (origArgs: {
subversion = pkgs.subversion15.override (origArgs: {
bdbSupport = true;
httpServer = true;
sslSupport = true;

View File

@ -48,6 +48,9 @@ let
configFile = writeText "ntp.conf" ''
driftfile ${stateDir}/ntp.drift
# Keep the drift file in ${stateDir}/ntp.drift. However, since we
# chroot to ${stateDir}, we have to specify it as /ntp.drift.
driftfile /ntp.drift
${toString (map (server: "server " + server + "\n") servers)}
'';

View File

@ -70,7 +70,7 @@ mkIf config.services.portmap.enable {
job =
let portmap = pkgs.makePortmap { daemonUID = uid; daemonGID = gid; };
let portmap = pkgs.portmap.override { daemonUID = uid; daemonGID = gid; };
in
''
description "ONC RPC portmap"

View File

@ -27,7 +27,12 @@ let
user = "smbguest";
group = "smbguest";
smbConfig = ./smb.conf ;
#smbConfig = ./smb.conf ;
smbConfig = pkgs.substituteAll {
src = ./smb.conf;
inherit samba;
};
inherit (pkgs) samba;
@ -79,13 +84,13 @@ mkIf config.services.samba.enable {
${samba}/sbin/nmbd -D -s ${smbConfig} &
${samba}/sbin/smbd -D -s ${smbConfig} &
${samba}/sbin/winbindd -B -s ${smbConfig} &
${samba}/sbin/winbindd -s ${smbConfig} &
ln -fs ${smbConfig} /var/samba/config
end script
respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd -B &
respawn ${samba}/sbin/nmbd -D -s ${smbConfig} &; ${samba}/sbin/smbd -D -s ${smbConfig} &; ${samba}/sbin/winbindd &
'';
}];

View File

@ -1,10 +1,35 @@
[global]
workgroup = Users
security = share
server string = %h
comment = Samba
local master = no
[default]
path = /home/smbd
log file = /var/log/samba/log.%m
log level = 10
max log size = 50000
security = user
#must be set to 'no' to use PAM
encrypt passwords = No
client plaintext auth = yes
client lanman auth = Yes
dns proxy = no
invalid users = root
passdb backend = tdbsam
passwd program = /usr/bin/passwd %u
# encrypt passwords = yes
# smb passwd file = @samba@/private/smbpasswd
#[default]
# path = /home/smbd
# read only = no
# guest ok = yes
[raidbackup]
path = /home/raidbackup/files
read only = no
guest ok = yes
guest ok = no
available = yes
browseable = yes
public = yes
valid users = raidbackup
comment = Raid backup Files

View File

@ -48,6 +48,27 @@ let
Whether mkdir is permitted to anonymous users.
";
};
chrootlocalUser = mkOption {
default = false;
description = "
Whether u can like out of ur home dir.
";
};
userlistEnable = mkOption {
default = false;
description = "
Whether users are included.
";
};
userlistDeny = mkOption {
default = false;
description = "
Whether users are excluded.
";
};
};
};
};
@ -57,7 +78,8 @@ in
let
inherit (config.services.vsftpd) anonymousUser localUsers writeEnable anonymousUploadEnable anonymousMkdirEnable;
inherit (config.services.vsftpd) anonymousUser localUsers writeEnable anonymousUploadEnable anonymousMkdirEnable
chrootlocalUser userlistEnable userlistDeny;
inherit (pkgs) vsftpd;
yesNoOption = p : name :
@ -110,6 +132,9 @@ mkIf config.services.vsftpd.enable {
${yesNoOption writeEnable "write_enable"}
${yesNoOption anonymousUploadEnable "anon_upload_enable"}
${yesNoOption anonymousMkdirEnable "anon_mkdir_write_enable"}
${yesNoOption chrootlocalUser "chroot_local_user"}
${yesNoOption userlistEnable "userlist_enable"}
${yesNoOption userlistDeny "userlist_deny"}
background=NO
listen=YES
nopriv_user=vsftpd

View File

@ -289,7 +289,7 @@ let
stdenv = pkgs.stdenv;
knownVideoDrivers = {
nvidia = { modulesFirst = [ kernelPackages.nvidiaDrivers ]; }; #make sure it first loads the nvidia libs
nvidia = { modulesFirst = [ kernelPackages.nvidia_x11 ]; }; #make sure it first loads the nvidia libs
vesa = { modules = [xorg.xf86videovesa]; };
vga = { modules = [xorg.xf86videovga]; };
sis = { modules = [xorg.xf86videosis]; };
@ -462,7 +462,6 @@ let
};
nvidiaDrivers = (config.boot.kernelPackages pkgs).nvidiaDrivers;
in
@ -491,7 +490,7 @@ mkIf cfg.enable {
boot = {
extraModulePackages = mkIf (cfg.videoDriver == "nvidia") [
kernelPackages.nvidiaDrivers
kernelPackages.nvidia_x11
];
};
@ -509,7 +508,7 @@ mkIf cfg.enable {
xorg.iceauth # required for KDE applications (it's called by dcopserver)
]
++ optional (videoDriver == "nvidia") [
kernelPackages.nvidiaDrivers
kernelPackages.nvidia_x11
];
};
@ -539,7 +538,7 @@ mkIf cfg.enable {
rm -f /var/run/opengl-driver
${if videoDriver == "nvidia"
then ''
ln -sf ${kernelPackages.nvidiaDrivers} /var/run/opengl-driver
ln -sf ${kernelPackages.nvidia_x11} /var/run/opengl-driver
''
else if cfg.driSupport
then "ln -sf ${pkgs.mesa} /var/run/opengl-driver"
@ -557,7 +556,7 @@ mkIf cfg.enable {
env XKB_BINDIR=${xorg.xkbcomp}/bin # Needed for the Xkb extension.
${if videoDriver == "nvidia"
then "env LD_LIBRARY_PATH=${xorg.libX11}/lib:${xorg.libXext}/lib:${kernelPackages.nvidiaDrivers}/lib"
then "env LD_LIBRARY_PATH=${xorg.libX11}/lib:${xorg.libXext}/lib:${kernelPackages.nvidia_x11}/lib"
else ""
}