* Synced with trunk @ 14413

svn path=/nixos/branches/modular-nixos/; revision=14951
This commit is contained in:
Nicolas Pierron 2009-04-08 13:50:32 +00:00
commit 9ba1f01479
15 changed files with 104 additions and 60 deletions

View File

@ -41,7 +41,7 @@ let
./manual.xml
cp ${./style.css} $out/style.css
ensureDir $out/nix-support
echo "doc manual $out" >> $out/nix-support/hydra-build-products
echo "doc manual $out manual.html" >> $out/nix-support/hydra-build-products
'';
};

View File

@ -191,6 +191,7 @@ let
"chsh"
"xlock"
"cups"
"ftp"
"common"
"common-console" # shared stuff for interactive local sessions
]

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

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

View File

@ -22,7 +22,7 @@ let
in
(isoFun (rec {
inherit platform;
lib = (import ../pkgs/lib);
lib = (import ../../pkgs/lib);
networkNixpkgs = "";
manualEnabled = true;
@ -171,40 +171,40 @@ in
configList = configuration : [
{
suffix = "X-vesa";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with vesa";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with vesa";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "vesa";};
};
});
}
{
suffix = "X-Intel";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with Intel graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with Intel graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "intel"; driSupport = true;};
};
});
}
{
suffix = "X-ATI";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with ATI graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with ATI graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "ati"; driSupport = true;};
};
});
}
{
suffix = "X-NVIDIA";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with NVIDIA graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with NVIDIA graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "nvidia"; driSupport = true;};
};
});

View File

@ -18,7 +18,6 @@ let
windowManager = "twm";
tty = "9";
};
pkgs
in
(isoFun {
@ -80,40 +79,40 @@ in
configList = configuration : [
{
suffix = "X-vesa";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with vesa";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with vesa";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "vesa";};
};
});
}
{
suffix = "X-Intel";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with Intel graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with Intel graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "intel"; driSupport = true;};
};
});
}
{
suffix = "X-ATI";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with ATI graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with ATI graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "ati"; driSupport = true;};
};
});
}
{
suffix = "X-NVIDIA";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with NVIDIA graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with NVIDIA graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "nvidia"; driSupport = true;};
};
});

View File

@ -20,9 +20,9 @@ let
};
in
(isoFun {
(isoFun (rec {
inherit platform;
lib = (import ../pkgs/lib);
lib = (import ../../pkgs/lib);
networkNixpkgs = "";
manualEnabled = true;
@ -182,43 +182,43 @@ in
configList = configuration : [
{
suffix = "X-vesa";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with vesa";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with vesa";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "vesa";};
};
});
}
{
suffix = "X-Intel";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with Intel graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with Intel graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "intel"; driSupport = true;};
};
});
}
{
suffix = "X-ATI";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with ATI graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with ATI graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "ati"; driSupport = true;};
};
});
}
{
suffix = "X-NVIDIA";
configuration = (configuration //
configuration = args: ((configuration args) //
{
boot=configuration.boot // {configurationName = "X with NVIDIA graphic card";};
services = configuration.services // {
boot=(configuration args).boot // {configurationName = "X with NVIDIA graphic card";};
services = (configuration args).services // {
xserver = xConfiguration // {videoDriver = "nvidia"; driSupport = true;};
};
});
}
];
}).rescueCD
})).rescueCD

View File

@ -14,7 +14,7 @@ mkdir -p /mnt/etc/nixos
cat > /mnt/etc/nixos/configuration.nix <<EOF
pkgs: full_configuration: {
{pkgs, config, ...}: {
boot = {
grubDevice = "/dev/sda";
copyKernels = true;

View File

@ -17,7 +17,7 @@ set -x
echo "Installation starting.." > report
nix-build -o socat /etc/nixos/nixpkgs -A socat || { echo "Failed to build socat" >&2 ; exit 2; };
nix-build -o qemu /etc/nixos/nixpkgs -A qemu || { echo "Failed to build qemu" >&2 ; exit 2; };
nix-build -o qemu /etc/nixos/nixpkgs -A ${QEMU_PACKAGE:-qemu} || { echo "Failed to build qemu" >&2 ; exit 2; };
echo "reboot" | ./socat/bin/socat tcp-listen:4424 stdio >> report &

View File

@ -137,7 +137,7 @@ rec {
nixpkgsRel = "nixpkgs" + (if networkNixpkgs != "" then "-" + networkNixpkgs else "");
configuration = pkgs: final_configuration: let preConfiguration ={
configuration = {pkgs, config, ...}: let preConfiguration ={
boot = {
isLiveCD = true;
# The label used to identify the installation CD.
@ -164,8 +164,8 @@ rec {
udev = {
addFirmware = []
++ (pkgs.lib.optional intel3945FWEnable pkgs.iwlwifi3945ucode)
++ (pkgs.lib.optional intel4965FWEnable pkgs.iwlwifi4965ucode)
#++ (pkgs.lib.optional intel3945FWEnable pkgs.iwlwifi3945ucode)
#++ (pkgs.lib.optional intel4965FWEnable pkgs.iwlwifi4965ucode)
;
};

View File

@ -14,11 +14,15 @@ let
releaseTools.makeSourceTarball {
name = "nixos-tarball";
version = builtins.readFile ./VERSION;
src = nixosSrc;
inherit officialRelease;
distPhase = ''
releaseName=nixos-$(cat $src/VERSION)$VERSION_SUFFIX
releaseName=nixos-$VERSION
ensureDir "$out/tarballs"
mkdir ../$releaseName
cp -prd . ../$releaseName
@ -50,16 +54,18 @@ let
let
version = builtins.readFile ./VERSION + (if officialRelease then "" else "pre${toString nixosSrc.rev}");
iso = (import "${nixosSrc.path}/installer/cd-dvd/rescue-cd.nix" {
platform = system;
compressImage = true;
nixpkgsPath = nixpkgs.path;
relName = "nixos-${builtins.readFile ./VERSION}${if !officialRelease then "pre${toString nixosSrc.rev}" else ""}";
relName = "nixos-${version}";
}).rescueCD;
in
# Declare the ISO as a build product so that it shows up in Hydra.
runCommand "nixos-iso"
runCommand "nixos-iso-${version}"
{ meta = {
description = "NixOS installation CD ISO image for ${system}";
};

View File

@ -8,9 +8,9 @@
stop on shutdown
respawn
script
export PATH=${if config.nix.distributedBuilds then "${pkgs.openssh}/bin:" else ""}${pkgs.openssl}/bin:${nix}/bin:$PATH
export PATH=${if config.nix.distributedBuilds then "${pkgs.openssh}/bin:${pkgs.gzip}/bin:" else ""}${pkgs.openssl}/bin:${nix}/bin:$PATH
${nixEnvVars}
exec ${nix}/bin/nix-worker --daemon > /dev/null 2>&1
exec nice -10 ${nix}/bin/nix-worker --daemon > /dev/null 2>&1
end script
";

View File

@ -190,17 +190,23 @@ in
# other paths in the store, we need the closure of /bin/sh
# in `build-chroot-dirs' - otherwise any builder that uses
# /bin/sh won't work.
refs = pkgs.writeReferencesToFile binsh;
binshDeps = pkgs.writeReferencesToFile binsh;
# Likewise, if chroots are turned on, we need Nix's own
# closure in the chroot. Otherwise nix-channel and nix-env
# won't work because the dependencies of its builders (like
# coreutils and Perl) aren't visible. Sigh.
nixDeps = pkgs.writeReferencesToFile config.environment.nix;
in
pkgs.runCommand "nix.conf" {} ''
binshDeps=$(for i in $(cat ${refs}); do if test -d $i; then echo $i; fi; done)
pkgs.runCommand "nix.conf" {extraOptions = config.nix.extraOptions; } ''
extraPaths=$(for i in $(cat ${binshDeps} ${nixDeps}); do if test -d $i; then echo $i; fi; done)
cat > $out <<END
# WARNING: this file is generated.
build-users-group = nixbld
build-max-jobs = ${toString (config.nix.maxJobs)}
build-use-chroot = ${if config.nix.useChroot then "true" else "false"}
build-chroot-dirs = /dev /dev/pts /proc /bin $(echo $binshDeps)
${config.nix.extraOptions}
build-chroot-dirs = /dev /dev/pts /proc /bin $(echo $extraPaths)
$extraOptions
END
'';
target = "nix.conf"; # will be symlinked from /nix/etc/nix/nix.conf in activate-configuration.sh.

View File

@ -15,6 +15,21 @@ let
using the rpcinfo(1) command.
'';
};
verbose = mkOption {
default = false;
description = ''
Whether to enable verbose output.
'';
};
chroot = mkOption {
default = "/var/empty";
description = ''
If non-empty, a path to change root to.
'';
};
};
};
};
@ -63,8 +78,12 @@ mkIf config.services.portmap.enable {
start on network-interfaces/started
stop on network-interfaces/stop
respawn ${portmap}/sbin/portmap
'';
respawn ${portmap}/sbin/portmap \
${if config.services.portmap.chroot == ""
then ""
else "-t \"${config.services.portmap.chroot}\""} \
${if config.services.portmap.verbose then "-v" else ""}
'';
}];
};
}

View File

@ -20,6 +20,13 @@ let
Whether to enable the anonymous FTP user.
";
};
localUsers = mkOption {
default = false;
description = "
Whether to enable FTP for the local users.
";
};
writeEnable = mkOption {
default = false;
@ -50,7 +57,7 @@ in
let
inherit (config.services.vsftpd) anonymousUser writeEnable anonymousUploadEnable anonymousMkdirEnable;
inherit (config.services.vsftpd) anonymousUser localUsers writeEnable anonymousUploadEnable anonymousMkdirEnable;
inherit (pkgs) vsftpd;
yesNoOption = p : name :
@ -99,6 +106,7 @@ mkIf config.services.vsftpd.enable {
start script
cat > /etc/vsftpd.conf <<EOF
${yesNoOption anonymousUser "anonymous_enable"}
${yesNoOption localUsers "local_enable"}
${yesNoOption writeEnable "write_enable"}
${yesNoOption anonymousUploadEnable "anon_upload_enable"}
${yesNoOption anonymousMkdirEnable "anon_mkdir_write_enable"}

View File

@ -298,6 +298,7 @@ let
nv = { modules = [xorg.xf86videonv]; };
ati = { modules = [xorg.xf86videoati]; };
via = { modules = [xorg.xf86videovia]; };
cirrus = { modules = [xorg.xf86videocirrus]; };
};
# Get a bunch of user settings.