diff --git a/boot/boot-stage-1.nix b/boot/boot-stage-1.nix index 46d4a52c6c9..161b1e4b7ea 100644 --- a/boot/boot-stage-1.nix +++ b/boot/boot-stage-1.nix @@ -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 ''; # */ diff --git a/default.nix b/default.nix index 86f437d3696..6dca88241a5 100644 --- a/default.nix +++ b/default.nix @@ -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 diff --git a/doc/manual/default.nix b/doc/manual/default.nix index 4f1e555583d..fe22e4f6c8b 100644 --- a/doc/manual/default.nix +++ b/doc/manual/default.nix @@ -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} diff --git a/etc/default.nix b/etc/default.nix index b396437c17c..3b81559af66 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -190,6 +190,7 @@ let "useradd" "chsh" "xlock" + "samba" "cups" "ftp" "common" diff --git a/etc/pam.d/samba b/etc/pam.d/samba new file mode 100644 index 00000000000..50f3cc5ce60 --- /dev/null +++ b/etc/pam.d/samba @@ -0,0 +1,4 @@ +auth include common +account include common +password include common +session include common diff --git a/helpers/make-iso9660-image.nix b/helpers/make-iso9660-image.nix index 0262bc653bb..ea0cd1b4d22 100644 --- a/helpers/make-iso9660-image.nix +++ b/helpers/make-iso9660-image.nix @@ -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"; } diff --git a/installer/cd-dvd/rescue-cd-configurable.nix b/installer/cd-dvd/rescue-cd-configurable.nix index f021c19b63b..53524ca36c8 100644 --- a/installer/cd-dvd/rescue-cd-configurable.nix +++ b/installer/cd-dvd/rescue-cd-configurable.nix @@ -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"; diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index 2b82df15fe3..ffa8fa875d1 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -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"; diff --git a/release.nix b/release.nix index 24b70478748..16ba809139b 100644 --- a/release.nix +++ b/release.nix @@ -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 \ No newline at end of file +in jobs diff --git a/system/kernel.nix b/system/kernel.nix index 23cdb2d9624..3b0e84a730f 100644 --- a/system/kernel.nix +++ b/system/kernel.nix @@ -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 - nvidiaDrivers. + nvidia_x11. "; }; @@ -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. ''; diff --git a/system/options.nix b/system/options.nix index 7e186b71551..8f3dcea23ae 100644 --- a/system/options.nix +++ b/system/options.nix @@ -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"; diff --git a/system/system.nix b/system/system.nix index 570ba91c96f..bed8516b57f 100644 --- a/system/system.nix +++ b/system/system.nix @@ -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 diff --git a/upstart-jobs/apache-httpd/subversion.nix b/upstart-jobs/apache-httpd/subversion.nix index 5baecc83723..8a48617ee44 100644 --- a/upstart-jobs/apache-httpd/subversion.nix +++ b/upstart-jobs/apache-httpd/subversion.nix @@ -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; diff --git a/upstart-jobs/ntpd.nix b/upstart-jobs/ntpd.nix index 9716ce3f308..93c88734e39 100644 --- a/upstart-jobs/ntpd.nix +++ b/upstart-jobs/ntpd.nix @@ -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)} ''; diff --git a/upstart-jobs/portmap.nix b/upstart-jobs/portmap.nix index d0978952820..410f3d4b6b0 100644 --- a/upstart-jobs/portmap.nix +++ b/upstart-jobs/portmap.nix @@ -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" diff --git a/upstart-jobs/samba.nix b/upstart-jobs/samba.nix index 90f09a3bdd6..00686a0407b 100644 --- a/upstart-jobs/samba.nix +++ b/upstart-jobs/samba.nix @@ -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 & ''; }]; diff --git a/upstart-jobs/smb.conf b/upstart-jobs/smb.conf index 69d5b41f706..889f3c628ee 100644 --- a/upstart-jobs/smb.conf +++ b/upstart-jobs/smb.conf @@ -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 diff --git a/upstart-jobs/vsftpd.nix b/upstart-jobs/vsftpd.nix index 1cbd2ac092b..c112967e45f 100644 --- a/upstart-jobs/vsftpd.nix +++ b/upstart-jobs/vsftpd.nix @@ -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 diff --git a/upstart-jobs/xserver/default.nix b/upstart-jobs/xserver/default.nix index 5e0e227887d..dfd0e4795aa 100644 --- a/upstart-jobs/xserver/default.nix +++ b/upstart-jobs/xserver/default.nix @@ -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 "" }