From 1e947b7acd158357d33e5e5a6a951b837465ba37 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 9 Mar 2009 21:10:53 +0000 Subject: [PATCH 01/18] svn path=/nixos/trunk/; revision=14478 --- release.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/release.nix b/release.nix index 24b70478748..4d6ee916b1c 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"; @@ -34,23 +35,21 @@ let manual = { nixosSrc ? {path = ./.; rev = 1234;} - , nixpkgs ? {path = ../nixpkgs-wc;} , officialRelease ? false }: import "${nixosSrc.path}/doc/manual" { - nixpkgsPath = nixpkgs.path; + nixpkgsPath = nixpkgs.outPath; }; iso = { nixosSrc ? {path = ./.; rev = 1234;} - , nixpkgs ? {path = ../nixpkgs-wc;} , officialRelease ? false , system ? "i686-linux" }: - with import nixpkgs.path {inherit system;}; + with import nixpkgs {inherit system;}; let @@ -59,7 +58,7 @@ let iso = (import "${nixosSrc.path}/installer/cd-dvd/rescue-cd.nix" { platform = system; compressImage = true; - nixpkgsPath = nixpkgs.path; + nixpkgsPath = nixpkgs.outPath; relName = "nixos-${version}"; }).rescueCD; From 39611b983a3c5645f26dfcbaa5f456cf0409b9ba Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 9 Mar 2009 21:11:17 +0000 Subject: [PATCH 02/18] svn path=/nixos/trunk/; revision=14479 --- release.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release.nix b/release.nix index 4d6ee916b1c..85aa69e78ea 100644 --- a/release.nix +++ b/release.nix @@ -38,7 +38,7 @@ let , officialRelease ? false }: - import "${nixosSrc.path}/doc/manual" { + import "${nixosSrc}/doc/manual" { nixpkgsPath = nixpkgs.outPath; }; @@ -55,7 +55,7 @@ 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.outPath; From 65edbcdb9010536ea13f85f2a39fa3c6322ba2e5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 9 Mar 2009 21:12:46 +0000 Subject: [PATCH 03/18] svn path=/nixos/trunk/; revision=14480 --- release.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release.nix b/release.nix index 85aa69e78ea..bf8d5cc1f5e 100644 --- a/release.nix +++ b/release.nix @@ -34,7 +34,7 @@ let manual = - { nixosSrc ? {path = ./.; rev = 1234;} + { nixosSrc ? {outPath = ./.; rev = 1234;} , officialRelease ? false }: @@ -44,7 +44,7 @@ let iso = - { nixosSrc ? {path = ./.; rev = 1234;} + { nixosSrc ? {outPath = ./.; rev = 1234;} , officialRelease ? false , system ? "i686-linux" }: From 28567c4565d256556640a47ece2ae83878b36360 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 11 Mar 2009 15:01:13 +0000 Subject: [PATCH 04/18] * ntpd: make the drift detection actually work when running in a chroot. svn path=/nixos/trunk/; revision=14506 --- upstart-jobs/ntpd.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/upstart-jobs/ntpd.nix b/upstart-jobs/ntpd.nix index 4bfcfe115cb..35a7c2e0035 100644 --- a/upstart-jobs/ntpd.nix +++ b/upstart-jobs/ntpd.nix @@ -7,7 +7,9 @@ let ntpUser = "ntp"; config = 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)} ''; From 5523326664d9836eae3f861e520e2d1b051cde29 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 17 Mar 2009 11:01:12 +0000 Subject: [PATCH 05/18] svn path=/nixos/trunk/; revision=14569 --- upstart-jobs/apache-httpd/subversion.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 3d8df9802dbc44c5833f2dc073a4b1cc02d0364c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 18 Mar 2009 18:10:38 +0000 Subject: [PATCH 06/18] * exportBuildReferencesGraph -> exportReferencesGraph. svn path=/nixos/trunk/; revision=14593 --- helpers/make-iso9660-image.nix | 10 +++----- installer/cd-dvd/rescue-cd-configurable.nix | 27 +++++++++------------ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/helpers/make-iso9660-image.nix b/helpers/make-iso9660-image.nix index 0262bc653bb..aef5408107f 100644 --- a/helpers/make-iso9660-image.nix +++ b/helpers/make-iso9660-image.nix @@ -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"; } 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"; From 7b7a29b201d3f3e51f31d1e5e45f855a06f681de Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 20 Mar 2009 16:17:23 +0000 Subject: [PATCH 07/18] * makePortmap -> portmap.override. svn path=/nixos/trunk/; revision=14632 --- upstart-jobs/portmap.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/upstart-jobs/portmap.nix b/upstart-jobs/portmap.nix index 1a8bce11904..f13c7b415da 100644 --- a/upstart-jobs/portmap.nix +++ b/upstart-jobs/portmap.nix @@ -3,7 +3,6 @@ ###### interface let inherit (pkgs.lib) mkOption mkIf; - inherit (pkgs) makePortmap; uid = (import ../system/ids.nix).uids.portmap; gid = (import ../system/ids.nix).gids.portmap; @@ -68,7 +67,7 @@ mkIf config.services.portmap.enable { name = "portmap"; job = - let portmap = makePortmap { daemonUID = uid; daemonGID = gid; }; + let portmap = pkgs.portmap.override { daemonUID = uid; daemonGID = gid; }; in '' description "ONC RPC portmap" From 1220a6da39f43f656de54655870903c6d7b21425 Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Sun, 22 Mar 2009 15:32:09 +0000 Subject: [PATCH 08/18] vsftpd userlist options added svn path=/nixos/trunk/; revision=14648 --- upstart-jobs/default.nix | 3 ++- upstart-jobs/smb.conf | 13 ++++++++++--- upstart-jobs/vsftpd.nix | 22 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 4569a9ff1ab..0f479e40638 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -309,7 +309,8 @@ let (import ../upstart-jobs/vsftpd.nix { inherit (pkgs) vsftpd; inherit (config.services.vsftpd) anonymousUser localUsers - writeEnable anonymousUploadEnable anonymousMkdirEnable; + writeEnable anonymousUploadEnable anonymousMkdirEnable + chrootlocaluser userlistenable userlistdeny; }) # X Font Server diff --git a/upstart-jobs/smb.conf b/upstart-jobs/smb.conf index 69d5b41f706..d8e9e5797f8 100644 --- a/upstart-jobs/smb.conf +++ b/upstart-jobs/smb.conf @@ -4,7 +4,14 @@ server string = %h comment = Samba local master = no -[default] - path = /home/smbd + +#[default] +# path = /home/smbd +# read only = no +# guest ok = yes + +[raidbackup] + path = /home/raidbackup read only = no - guest ok = yes + guest ok = no + diff --git a/upstart-jobs/vsftpd.nix b/upstart-jobs/vsftpd.nix index f24ae049026..43dddd8d544 100644 --- a/upstart-jobs/vsftpd.nix +++ b/upstart-jobs/vsftpd.nix @@ -1,5 +1,6 @@ { vsftpd, anonymousUser, localUsers , anonymousUploadEnable, anonymousMkdirEnable, writeEnable +, chrootlocaluser, userlistenable, userlistdeny }: { @@ -70,6 +71,27 @@ else " anon_mkdir_write_enable=NO" ) + +(if chrootlocaluser then +" +chroot_local_user=YES" +else +" +chroot_local_user=NO" +) + +(if userlistenable then +" +userlist_enable=YES" +else +" +userlist_enable=NO" +) + +(if userlistdeny then +" +userlist_deny=YES" +else +" +userlist_deny=NO" +) + " background=NO listen=YES From 7eab893010ad7ab2dc67cfb2e4fddeede552d8d2 Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Sun, 22 Mar 2009 15:34:28 +0000 Subject: [PATCH 09/18] vsftpd userlist options added svn path=/nixos/trunk/; revision=14650 --- system/options.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/system/options.nix b/system/options.nix index a8ddd399603..4fcbe1513ff 100644 --- a/system/options.nix +++ b/system/options.nix @@ -1874,6 +1874,28 @@ in 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. + "; + }; + }; printing = { From 70f9a365d8f2795a41ac51144fc306cdd71ffcd1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Mar 2009 11:00:31 +0000 Subject: [PATCH 10/18] * Add ntfsprogs to the installation CD (mostly for ntfsresize). svn path=/nixos/trunk/; revision=14697 --- installer/cd-dvd/rescue-cd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/cd-dvd/rescue-cd.nix b/installer/cd-dvd/rescue-cd.nix index 2b82df15fe3..6c2c0486025 100644 --- a/installer/cd-dvd/rescue-cd.nix +++ b/installer/cd-dvd/rescue-cd.nix @@ -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 ]; From b470feb9161d493284fa8cc17ff7345224fe99a3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Mar 2009 15:47:29 +0000 Subject: [PATCH 11/18] * nixpkgsPath -> nixpkgs. svn path=/nixos/trunk/; revision=14702 --- boot/boot-stage-1.nix | 2 +- doc/manual/default.nix | 8 +++----- helpers/make-iso9660-image.nix | 4 ++-- installer/cd-dvd/rescue-cd.nix | 10 +++++----- installer/default.nix | 4 ++-- release.nix | 4 ++-- system/system.nix | 13 +++++-------- 7 files changed, 20 insertions(+), 25 deletions(-) diff --git a/boot/boot-stage-1.nix b/boot/boot-stage-1.nix index ed53a3abdb9..3d3f5885afa 100644 --- a/boot/boot-stage-1.nix +++ b/boot/boot-stage-1.nix @@ -4,7 +4,7 @@ # calls the init in the root file system to start the second boot # stage. -{ pkgs, config, nixpkgsPath, kernelPackages, modulesTree }: +{ pkgs, config, kernelPackages, modulesTree }: rec { 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/helpers/make-iso9660-image.nix b/helpers/make-iso9660-image.nix index aef5408107f..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" @@ -50,5 +50,5 @@ stdenv.mkDerivation { # For obtaining the closure of `storeContents'. exportReferencesGraph = map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents; - 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.nix b/installer/cd-dvd/rescue-cd.nix index 6c2c0486025..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 { @@ -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/installer/default.nix b/installer/default.nix index bf6f6ee81b9..dfa2ab38eeb 100644 --- a/installer/default.nix +++ b/installer/default.nix @@ -1,4 +1,4 @@ -{pkgs, config, nix, nixpkgsPath}: +{pkgs, config, nix}: let @@ -25,7 +25,7 @@ in inherit nix; nixpkgsURL = config.installer.nixpkgsURL; - pathsFromGraph = "${nixpkgsPath}/pkgs/build-support/kernel/paths-from-graph.pl"; + pathsFromGraph = "${pkgs.path}/build-support/kernel/paths-from-graph.pl"; nixClosure = pkgs.runCommand "closure" {exportReferencesGraph = ["refs" nix];} diff --git a/release.nix b/release.nix index bf8d5cc1f5e..a7f92b55dc3 100644 --- a/release.nix +++ b/release.nix @@ -39,7 +39,7 @@ let }: import "${nixosSrc}/doc/manual" { - nixpkgsPath = nixpkgs.outPath; + inherit nixpkgs; }; @@ -58,8 +58,8 @@ let iso = (import "${nixosSrc}/installer/cd-dvd/rescue-cd.nix" { platform = system; compressImage = true; - nixpkgsPath = nixpkgs.outPath; relName = "nixos-${version}"; + inherit nixpkgs; }).rescueCD; in diff --git a/system/system.nix b/system/system.nix index 913913db9af..fb09d40ae1e 100644 --- a/system/system.nix +++ b/system/system.nix @@ -1,7 +1,6 @@ { platform ? __currentSystem , configuration -, nixpkgsPath ? ../../nixpkgs -, nixpkgs ? null +, nixpkgs ? ../../nixpkgs }: rec { @@ -27,9 +26,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 @@ -57,7 +54,7 @@ rec { # The initial ramdisk. initialRamdiskStuff = import ../boot/boot-stage-1.nix { - inherit pkgs config nixpkgsPath kernelPackages modulesTree; + inherit pkgs config kernelPackages modulesTree; }; initialRamdisk = initialRamdiskStuff.initialRamdisk; @@ -65,7 +62,7 @@ rec { # NixOS installation/updating tools. nixosTools = import ../installer { - inherit pkgs config nix nixpkgsPath; + inherit pkgs config nix; }; @@ -155,7 +152,7 @@ rec { # 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). - mount = import "${nixpkgsPath}/pkgs/os-specific/linux/util-linux" { + mount = import "${nixpkgs}/pkgs/os-specific/linux/util-linux" { inherit (pkgs) fetchurl stdenv; buildMountOnly = true; mountHelpers = pkgs.buildEnv { From 61d24401ee5d5eeb19a54f324f6513b832bd20bc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Mar 2009 20:12:44 +0000 Subject: [PATCH 12/18] svn path=/nixos/trunk/; revision=14714 --- release.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.nix b/release.nix index a7f92b55dc3..e55d4103121 100644 --- a/release.nix +++ b/release.nix @@ -23,7 +23,7 @@ let inherit officialRelease; distPhase = '' - releaseName=nixos-$VERSION + releaseName=nixos-$VERSION$VERSION_SUFFIX ensureDir "$out/tarballs" mkdir ../$releaseName cp -prd . ../$releaseName From bcbfd8d3868b8433bab4bae2821b73fbdc89825b Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 27 Mar 2009 09:29:11 +0000 Subject: [PATCH 13/18] Complete nixpkgsPath->nixpkgs rename svn path=/nixos/trunk/; revision=14732 --- default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 46f2d265216..d55adf2115b 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 From fd3d09b37c6d8b99b94c4db55d3b4bd3e345034f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 29 Mar 2009 10:59:13 +0000 Subject: [PATCH 14/18] Adding reiserfsck to initrd to allow booting reiserfsck root filesystems Adding mdadm to initrd to allow managing RAIDs at least on stage1 interactive shell svn path=/nixos/trunk/; revision=14754 --- boot/boot-stage-1.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boot/boot-stage-1.nix b/boot/boot-stage-1.nix index 3d3f5885afa..49b71bd7c70 100644 --- a/boot/boot-stage-1.nix +++ b/boot/boot-stage-1.nix @@ -48,9 +48,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 @@ -61,6 +63,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 From 40f38560d454ffa66b24343f76313c53e933d82d Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Sun, 29 Mar 2009 21:43:40 +0000 Subject: [PATCH 15/18] Allow samba to use PAM (needs cleartext passwords for now) svn path=/nixos/trunk/; revision=14768 --- etc/default.nix | 1 + etc/pam.d/samba | 4 ++++ upstart-jobs/samba.nix | 11 ++++++++--- upstart-jobs/smb.conf | 26 ++++++++++++++++++++++---- 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 etc/pam.d/samba diff --git a/etc/default.nix b/etc/default.nix index 7c4d4af8c2c..b9411117971 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -249,6 +249,7 @@ import ../helpers/make-etc.nix { "useradd" "chsh" "xlock" + "samba" "kde" "cups" "ftp" 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/upstart-jobs/samba.nix b/upstart-jobs/samba.nix index b1371c6f0f5..e5d4edd45a2 100644 --- a/upstart-jobs/samba.nix +++ b/upstart-jobs/samba.nix @@ -5,7 +5,12 @@ let user = "smbguest"; group = "smbguest"; - smbConfig = ./smb.conf ; + #smbConfig = ./smb.conf ; + + smbConfig = pkgs.substituteAll { + src = ./smb.conf; + inherit samba; + }; in @@ -45,13 +50,13 @@ start script ${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 d8e9e5797f8..889f3c628ee 100644 --- a/upstart-jobs/smb.conf +++ b/upstart-jobs/smb.conf @@ -1,9 +1,23 @@ [global] workgroup = Users - security = share server string = %h comment = Samba - local master = no + 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 @@ -11,7 +25,11 @@ # guest ok = yes [raidbackup] - path = /home/raidbackup + path = /home/raidbackup/files read only = no guest ok = no - + available = yes + browseable = yes + public = yes + valid users = raidbackup + comment = Raid backup Files From ccbcf580624c4bdf49eea46573a95a0061703771 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Mar 2009 14:54:22 +0000 Subject: [PATCH 16/18] * nvidiaDrivers -> nvidia_x11. svn path=/nixos/trunk/; revision=14788 --- system/options.nix | 4 ++-- system/system.nix | 2 +- upstart-jobs/xserver.nix | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/system/options.nix b/system/options.nix index 4fcbe1513ff..2828863e987 100644 --- a/system/options.nix +++ b/system/options.nix @@ -99,7 +99,7 @@ in 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. "; }; @@ -152,7 +152,7 @@ in 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/system.nix b/system/system.nix index fb09d40ae1e..cb6c8167004 100644 --- a/system/system.nix +++ b/system/system.nix @@ -46,7 +46,7 @@ rec { # Merged into mainline kernel # ++ pkgs.lib.optional ((config.networking.enableIntel3945ABGFirmware || config.networking.enableIntel4965AGNFirmware) && !kernel.features ? iwlwifi) kernelPackages.iwlwifi # !!! this should be declared by the xserver Upstart job. - ++ pkgs.lib.optional (config.services.xserver.enable && config.services.xserver.videoDriver == "nvidia") kernelPackages.nvidiaDrivers + ++ pkgs.lib.optional (config.services.xserver.enable && config.services.xserver.videoDriver == "nvidia") kernelPackages.nvidia_x11 ++ pkgs.lib.optional config.hardware.enableGo7007 kernelPackages.wis_go7007 ++ config.boot.extraModulePackages ); diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 1a84add6f05..ff6f34e5de7 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -14,7 +14,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]; }; @@ -351,7 +351,6 @@ let }; in if cfg.slim.theme == null then "${pkgs.slim}/share/slim/themes" else unpackedTheme; - nvidiaDrivers = (config.boot.kernelPackages pkgs).nvidiaDrivers; in @@ -401,7 +400,7 @@ rec { xorg.xset # used by startkde, non-essential ] ++ optional (videoDriver == "nvidia") [ - kernelPackages.nvidiaDrivers + kernelPackages.nvidia_x11 ]; @@ -425,7 +424,7 @@ rec { 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" @@ -444,7 +443,7 @@ rec { 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 "" } From 02b243e11b806418a0f42e727ea5668c8d15943d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 31 Mar 2009 09:27:11 +0000 Subject: [PATCH 17/18] * Additional checks. svn path=/nixos/trunk/; revision=14800 --- boot/boot-stage-1.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boot/boot-stage-1.nix b/boot/boot-stage-1.nix index 49b71bd7c70..c37ca27d6b1 100644 --- a/boot/boot-stage-1.nix +++ b/boot/boot-stage-1.nix @@ -63,7 +63,7 @@ rec { cp $lvm2/sbin/lvm $out/bin/lvm fi - # Add RAID mdadm tool + # Add RAID mdadm tool. cp ${pkgs.mdadm}/sbin/mdadm $out/bin/mdadm # Copy udev. @@ -100,6 +100,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 ''; # */ From 723b0dc74b33ff76619406f4289a743f64967f34 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 31 Mar 2009 09:33:35 +0000 Subject: [PATCH 18/18] * Use utillinuxng.override. svn path=/nixos/trunk/; revision=14801 --- system/system.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/system.nix b/system/system.nix index cb6c8167004..75c64ab7e1a 100644 --- a/system/system.nix +++ b/system/system.nix @@ -152,8 +152,7 @@ rec { # 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). - mount = import "${nixpkgs}/pkgs/os-specific/linux/util-linux" { - inherit (pkgs) fetchurl stdenv; + mount = pkgs.utillinuxng.override { buildMountOnly = true; mountHelpers = pkgs.buildEnv { name = "mount-helpers";