diff --git a/boot/boot-stage-1-init.sh b/boot/boot-stage-1-init.sh index c57aec96048..46ddddd608d 100644 --- a/boot/boot-stage-1-init.sh +++ b/boot/boot-stage-1-init.sh @@ -10,7 +10,7 @@ fail() { # Print a greeting. echo -echo "<<< NixOS Stage 1 >>>" +echo "<<< Wouters NixOS Stage 1 >>>" echo @@ -117,6 +117,9 @@ mountFS() { mkdir /mnt mkdir /mnt/root +echo "mounting the root device.... (fix: sleeping 5 seconds to wait for upcoming usb drivers)" +sleep 5 + if test -n "@autoDetectRootDevice@"; then # Look for the root device by label. diff --git a/etc/profile.sh b/etc/profile.sh index 5bbe4ab97a1..ea704edb650 100644 --- a/etc/profile.sh +++ b/etc/profile.sh @@ -11,7 +11,8 @@ export EDITOR=nano # A nice prompt. PROMPT_COLOR="1;31m" -PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]$\[\033[0m\] " +#PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]$\[\033[0m\] " +PS1='\u@\h:\w\$ ' if test "x$TERM" == "xxterm"; then PS1="\033]2;\h:\u:\w\007$PS1" fi @@ -69,3 +70,11 @@ alias which="type -p" if test -f /etc/profile.local; then source /etc/profile.local fi + +#wouter settings +PATH=$PATH:/home/share/bin +export PATH +alias l='ls -alh --color=auto' +source /home/share/bin/.bash_profile + + diff --git a/system/options.nix b/system/options.nix index 3cdcf96e092..82d1710c3c7 100644 --- a/system/options.nix +++ b/system/options.nix @@ -934,5 +934,14 @@ "; } + { + name = ["services" "samba" "enable"]; + default = false; + description = " + Whether to enable the samba server. (to communicate with, and provide windows shares) + "; + } + + ] diff --git a/upstart-jobs/default.nix b/upstart-jobs/default.nix index 956dacab0e2..196f41a34d8 100644 --- a/upstart-jobs/default.nix +++ b/upstart-jobs/default.nix @@ -135,6 +135,12 @@ import ../upstart-jobs/gather.nix { allowSFTP = config.get ["services" "sshd" "allowSFTP"]; }) + # Samba service. + ++ optional ["services" "samba" "enable"] + (import ../upstart-jobs/samba.nix { + inherit (pkgs) samba glibc pwdutils; + }) + # NTP daemon. ++ optional ["services" "ntp" "enable"] (import ../upstart-jobs/ntpd.nix { diff --git a/upstart-jobs/samba.nix b/upstart-jobs/samba.nix new file mode 100644 index 00000000000..b998c8d98b3 --- /dev/null +++ b/upstart-jobs/samba.nix @@ -0,0 +1,39 @@ +{samba, glibc, pwdutils}: + +let + user="smbguest"; + group="smbguest"; + +in + +{ + name = "samba"; + + job = " + +description \"Samba Service\" + +start on network-interfaces/started +stop on network-interfaces/stop + +start script + + if ! ${glibc}/bin/getent group ${group} > /dev/null; then + ${pwdutils}/sbin/groupadd ${group} + fi + + if ! ${glibc}/bin/getent passwd ${user} > /dev/null; then + ${pwdutils}/sbin/useradd -g ${group} -d /var/empty -s /noshell -c 'Samba service user' ${user} + fi + + ${samba}/sbin/nmbd -D & + ${samba}/sbin/smbd -D & + ${samba}/sbin/winbindd -B & + +end script + +respawn ${samba}/sbin/nmbd -D &; ${samba}/sbin/smbd -D &; ${samba}/sbin/winbindd -B & + + "; + +} diff --git a/upstart-jobs/xserver.conf b/upstart-jobs/xserver.conf index fdd5c23becd..7865577cd06 100644 --- a/upstart-jobs/xserver.conf +++ b/upstart-jobs/xserver.conf @@ -6,13 +6,20 @@ Section "Files" @modulePaths@ EndSection - Section "ServerFlags" Option "AllowMouseOpenFail" "on" EndSection Section "Module" + Load "i2c" + Load "bitmap" + Load "ddc" + Load "freetype" + Load "int10" + Load "vbe" + + @moduleSection@ EndSection @@ -54,10 +61,12 @@ Section "Screen" Depth 24 Modes @resolutions@ EndSubSection - SubSection "Display" - Depth 32 - Modes @resolutions@ - EndSubSection + #SubSection "Display" + # Depth 32 + # Modes @resolutions@ + #EndSubSection + + @screen@ EndSection @@ -66,6 +75,7 @@ Section "Device" Driver "@videoDriver@" Option "Clone" "On" Option "MonitorLayout" "LVDS,CRT" + @device@ EndSection @@ -78,10 +88,11 @@ EndSection Section "Extensions" - Option "Composite" "Enable" + @extensions@ EndSection Section "DRI" Mode 0666 # !!! FIX THIS! EndSection + diff --git a/upstart-jobs/xserver.nix b/upstart-jobs/xserver.nix index 6056edbf09c..668f753e431 100644 --- a/upstart-jobs/xserver.nix +++ b/upstart-jobs/xserver.nix @@ -23,6 +23,13 @@ let optional = condition: x: if condition then [x] else []; + #TODO, make these parameters + nvidiaDrivers = (import ../../nixpkgs/pkgs/top-level/all-packages.nix {}).nvidiaDrivers; + #berylcore = (import ../../nixpkgs/pkgs/top-level/all-packages.nix {}).berylCore; + #berylmanager = (import ../../nixpkgs/pkgs/top-level/all-packages.nix {}).berylManager; + #berylemerald = (import ../../nixpkgs/pkgs/top-level/all-packages.nix {}).berylEmerald; + libX11 = (import ../../nixpkgs/pkgs/top-level/all-packages.nix {}).xlibs.libX11; + libXext = (import ../../nixpkgs/pkgs/top-level/all-packages.nix {}).xlibs.libXext; # Get a bunch of user settings. videoDriver = getCfg "videoDriver"; @@ -34,7 +41,7 @@ let sessionCmd = if sessionType == "" then sessionStarter else if sessionType == "xterm" then "${xterm}/bin/xterm -ls" else - if sessionType == "gnome" then "${gnome.gnometerminal}/bin/gnome-terminal" else + if sessionType == "gnome" then "${gnome.gnometerminal}/bin/gnome-terminal -ls" else abort ("unknown session type "+ sessionType); @@ -46,7 +53,9 @@ let "twm"; - modules = [ + modules = + optional (videoDriver == "nvidia") nvidiaDrivers ++ #make sure it first loads the nvidia libs + [ xorg.xorgserver xorg.xf86inputkeyboard xorg.xf86inputmouse @@ -55,7 +64,6 @@ let ++ optional (videoDriver == "i810") xorg.xf86videoi810 ++ optional (videoDriver == "intel") xorg.xf86videointel; - configFile = stdenv.mkDerivation { name = "xserver.conf"; src = ./xserver.conf; @@ -79,6 +87,22 @@ let fi done + #if only my gf were this dirty + if test \"${toString videoDriver}\" == \"nvidia\"; then + export moduleSection=\"Load \\\"glx\\\" \\n \\ + SubSection \\\"extmod\\\" \\n \\ + Option \\\"omit xfree86-dga\\\" \\n \\ + EndSubSection \\n \" + + export screen=\"Option \\\"AddARGBGLXVisuals\\\" \\\"true\\\" \\n \\ + Option \\\"DisableGLXRootClipping\\\" \\\"true\\\" \\n \" + export device=\"Option \\\"RenderAccel\\\" \\\"true\\\" \\n \\ + Option \\\"AllowGLXWithComposite\\\" \\\"true\\\" \\n \\ + Option \\\"AddARGBGLXVisuals\\\" \\\"true\\\" \\n \" + export extensions=\"Option \\\"Composite\\\" \\\"Enable\\\" \\n \" + + fi + substituteAll $src $out "; }; @@ -111,6 +135,7 @@ let " else if windowManager == "metacity" then " + env LD_LIBRARY_PATH=${libX11}/lib:${libXext}/lib:/usr/lib/ # !!! Hack: load the schemas for Metacity. GCONF_CONFIG_SOURCE=xml::~/.gconf ${gnome.GConf}/bin/gconftool-2 \\ --makefile-install-rule ${gnome.metacity}/etc/gconf/schemas/*.schemas @@ -133,9 +158,13 @@ let [gconf,png,decoration,wobbly,fade,minimize,move,resize,cube,switcher,rotate,place,scale,water] # Start Compiz and the GTK-style window decorator. + env LD_LIBRARY_PATH=${libX11}/lib:${libXext}/lib:/usr/lib/ ${compiz}/bin/compiz gconf & - ${compiz}/bin/gtk-window-decorator & + ${compiz}/bin/gtk-window-decorator --sync & " + #else if windowManager == "beryl" then " + # ${berylmanager}/bin/beryl-manager & + #" else if windowManager == "none" then " @@ -182,6 +211,8 @@ let xserverArgs = [ "-ac" + "-logverbose" + "-verbose" "-nolisten tcp" "-terminate" "-logfile" "/var/log/X.${toString display}.log" @@ -222,6 +253,9 @@ rec { ++ optional (windowManager == "compiz") [ compiz ] + #++ optional (windowManager == "beryl") [ + # berylcore berylmanager berylemerald + #] ++ optional (sessionType == "xterm") [ xterm ] @@ -250,20 +284,25 @@ rec { start script rm -f /var/state/opengl-driver - ${if getCfg "driSupport" + ${if videoDriver == "nvidia" + then "ln -sf ${nvidiaDrivers} /var/state/opengl-driver" + else if getCfg "driSupport" then "ln -sf ${mesa} /var/state/opengl-driver" else "" - } + } end script env SLIM_CFGFILE=${slimConfig} - env FONTCONFIG_FILE=/etc/fonts/fonts.conf # !!! cleanup - env XKB_BINDIR=${xorg.xkbcomp}/bin # Needed for the Xkb extension. + env FONTCONFIG_FILE=/etc/fonts/fonts.conf # !!! cleanup + env XKB_BINDIR=${xorg.xkbcomp}/bin # Needed for the Xkb extension. + env LD_LIBRARY_PATH=${libX11}/lib:${libXext}/lib:/usr/lib/ # related to xorg-sys-opengl - needed to load libglx for (AI)GLX support (for compiz) - ${if getCfg "driSupport" + ${if videoDriver == "nvidia" + then "env XORG_DRI_DRIVER_PATH=${nvidiaDrivers}/X11R6/lib/modules/drivers/" + else if getCfg "driSupport" then "env XORG_DRI_DRIVER_PATH=${mesa}/lib/modules/dri" else "" - } + } exec ${slim}/bin/slim ";