Author: NicolasPierron
Date: Tue Jun  7 15:03:12 2011
New Revision: 27366
URL: https://svn.nixos.org/websvn/nix/?rev=27366&sc=1

Log:
Add my server configuration.

Added:
   configurations/trunk/misc/nicolas.b.pierron/common/freepopsd.nix
   configurations/trunk/misc/nicolas.b.pierron/common/fuppes/
   configurations/trunk/misc/nicolas.b.pierron/common/fuppes.nix
   configurations/trunk/misc/nicolas.b.pierron/common/fuppes/vfolder.cfg
   configurations/trunk/misc/nicolas.b.pierron/common/irc.nix
   configurations/trunk/misc/nicolas.b.pierron/common/ups.nix
   configurations/trunk/misc/nicolas.b.pierron/keukenhof/
   configurations/trunk/misc/nicolas.b.pierron/keukenhof.nix
   configurations/trunk/misc/nicolas.b.pierron/keukenhof/etc/
   configurations/trunk/misc/nicolas.b.pierron/keukenhof/etc/fuppes/
   configurations/trunk/misc/nicolas.b.pierron/keukenhof/etc/fuppes/fuppes.cfg
Modified:
   configurations/trunk/misc/nicolas.b.pierron/common/preferencies.nix
   configurations/trunk/misc/nicolas.b.pierron/vinon.nix

Added: configurations/trunk/misc/nicolas.b.pierron/common/freepopsd.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/misc/nicolas.b.pierron/common/freepopsd.nix    Tue Jun 
 7 15:03:12 2011        (r27366)
@@ -0,0 +1,106 @@
+{config, pkgs, ...}:
+
+with pkgs.lib;
+
+let
+  freepops_nix = {stdenv, fetchurl, pkgconfig, openssl, lua5, curl, readline, 
bison, expat}:
+
+  stdenv.mkDerivation {
+    name = "freepops-0.2.9";
+    src = fetchurl {
+      url = mirror://sf/freepops/0.2.9/freepops-0.2.9.tar.gz;
+      sha256 = 
"3a065e30cafed03d9b6fdb28251ae5bf0d8aeb62181746154beecd25dc0c9cae";
+    };
+    buildInputs = [pkgconfig openssl lua5 curl readline bison expat];
+    configurePhase =
+    ''
+      export WHERE=$prefix/
+      export LOCALEDIR=$prefix/share/locale/
+      ./configure.sh linux
+    '';
+  };
+
+  freepops = pkgs.callPackage freepops_nix {};
+
+  cfg = config.services.mail.freepopsd;
+in
+
+{
+  options = {
+    services.mail.freepopsd = {
+      enable = mkOption {
+        default = false;
+        type = with types; bool;
+        description = ''
+          Enables Freepops, a POP3 webmail wrapper.
+        '';
+      };
+
+      port = mkOption {
+        default = 2000;
+        type = with types; uniq int;
+        description = ''
+          Port on which the pop server will listen.
+        '';
+      };
+
+      threads = mkOption {
+        default = 5;
+        type = with types; uniq int;
+        description = ''
+          Max simultaneous connections.
+        '';
+      };
+
+      bind = mkOption {
+        default = "0.0.0.0";
+        type = with types; uniq string;
+        description = ''
+          Bind over an IPv4 address instead of any.
+        '';
+      };
+
+      logFile = mkOption {
+        default = "/var/log/freepopsd";
+        example = "syslog";
+        type = with types; uniq string;
+        description = ''
+          Filename of the log file or syslog to rely on the logging daemon.
+        '';
+      };
+
+      suid = {
+        user = mkOption {
+          default = "nobody";
+          type = with types; uniq string;
+          description = ''
+            User name under which freepopsd will be after binding the port.
+          '';
+        };
+
+        group = mkOption {
+          default = "nogroup";
+          type = with types; uniq string;
+          description = ''
+            Group under which freepopsd will be after binding the port.
+          '';
+        };
+      };
+
+    };
+  };
+
+  config = mkIf cfg.enable {
+    jobs.freepopsd = {
+      description = "Freepopsd (webmail over POP3)";
+      startOn = "started network-interfaces";
+      exec = ''${freepops}/bin/freepopsd \
+        -p ${toString cfg.port} \
+        -t ${toString cfg.threads} \
+        -b ${cfg.bind} \
+        -vv -l ${cfg.logFile} \
+        -s ${cfg.suid.user}.${cfg.suid.group}
+      '';
+    };
+  };
+}
\ No newline at end of file

Added: configurations/trunk/misc/nicolas.b.pierron/common/fuppes.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/misc/nicolas.b.pierron/common/fuppes.nix       Tue Jun 
 7 15:03:12 2011        (r27366)
@@ -0,0 +1,114 @@
+{config, pkgs, ...}:
+
+let
+  cfg = config.services.fuppesd;
+in
+
+with pkgs.lib;
+
+{
+  options = {
+    services.fuppesd = {
+      enable = mkOption {
+        default = false;
+        type = with types; bool;
+        description = ''
+          Enables Fuppes (UPnP A/V Media Server).  Can be used to watch
+          photos, video and listen to music from a phone/tv connected to the
+          local network.
+        '';
+      };
+
+      name = mkOption {
+        example = "Media Center";
+        type = with types; uniq string;
+        description = ''
+          Enables Fuppes (UPnP A/V Media Server).  Can be used to watch
+          photos, video and listen to music from a phone/tv connected to the
+          local network.
+        '';
+      };
+
+      log = {
+        level = mkOption {
+          default = 0;
+          example = 3;
+          type = with types; uniq int;
+          description = ''
+            Logging level of fuppes, An integer between 0 and 3.
+          '';
+        };
+
+        file = mkOption {
+          default = "/var/log/fuppes.log";
+          type = with types; uniq string;
+          description = ''
+            File which will contains the log produced by the daemon.
+          '';
+        };
+      };
+
+      config = mkOption {
+        example = "/etc/fuppes/fuppes.cfg";
+        type = with types; uniq string;
+        description = ''
+          Mutable configuration file which can be edited with the web
+          interface.  Due to possible modification, double quote the full
+          path of the filename stored in your filesystem to avoid attempts
+          to modify the content of the nix store.
+        '';
+      };
+
+      vfolder = mkOption {
+        default = ./fuppes/vfolder.cfg;
+        example = /etc/fuppes/vfolder.cfg;
+        description = ''
+          XML file describing the layout of virtual folder visible by the
+          client.
+        '';
+      };
+
+      database = mkOption {
+        default = "/var/lib/fuppes/fuppes.db";
+        type = with types; uniq string;
+        description = ''
+          Database file which index all shared files.
+        '';
+      };
+
+      ## At the moment, no plugins are packaged.
+      /*
+      plugins = mkOption {
+        type = with types; listOf package;
+        description = ''
+          List of Fuppes plugins.
+        '';
+      };
+      */
+
+      user = mkOption {
+        default = "root"; # The default is not secure.
+        example = "fuppes";
+        type = with types; uniq string;
+        description = ''
+          Name of the user which own the configuration files and under which
+          the fuppes daemon will be executed.
+        '';
+      };
+
+    };
+  };
+
+  config = mkIf cfg.enable {
+    jobs.fuppesd = {
+      description = "UPnP A/V Media Server. (${cfg.name})";
+      startOn = "started network-interfaces";
+      daemonType = "fork";
+      exec = ''/var/setuid-wrappers/sudo -u ${cfg.user} -- 
${pkgs.fuppes}/bin/fuppesd --friendly-name ${cfg.name} --log-level ${toString 
cfg.log.level} --log-file ${cfg.log.file} --config-file ${cfg.config} 
--vfolder-config-file ${cfg.vfolder} --database-file ${cfg.database}'';
+    };
+
+    services.fuppesd.name = mkDefault config.networking.hostName;
+
+    security.sudo.enable = true;
+  };
+}

Added: configurations/trunk/misc/nicolas.b.pierron/common/fuppes/vfolder.cfg
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/misc/nicolas.b.pierron/common/fuppes/vfolder.cfg       
Tue Jun  7 15:03:12 2011        (r27366)
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fuppes_vfolder_config version="0.2">
+
+ <vfolder_layout device="default" enabled="false">
+
+    <vfolder name="Genre">
+      <vfolders property="genre">
+        <items type="audioItem" />
+      </vfolders>
+    </vfolder>
+
+    <vfolder name="Genre/Artists">
+      <vfolders property="genre">
+        <vfolders property="artist">
+          <items type="audioItem" />
+        </vfolders>
+      </vfolders>
+    </vfolder>
+
+    <vfolder name="Artists/Albums">
+      <vfolders property="artist">
+        <vfolders property="album">
+          <items type="audioItem" />
+        </vfolders>
+      </vfolders>
+    </vfolder> 
+    
+    <vfolder name="ABC/Artists/Albums">
+      <vfolders split="ABC">
+        <vfolders property="artist">
+          <vfolders property="album">
+            <items type="audioItem" />
+          </vfolders>
+        </vfolders>
+      </vfolders>
+    </vfolder>
+       
+    <vfolder name="Photos">
+      <vfolder name="All">
+        <items type="imageItem" />
+      </vfolder>
+      <vfolder name="Folders">
+        <folders filter="contains(imageItem)" />
+      </vfolder>      
+    </vfolder>
+
+    <vfolder name="Videos">
+      <vfolder name="All">
+        <items type="videoItem" />
+      </vfolder>
+      <vfolder name="Folders">
+        <folders filter="contains(videoItem)" />
+      </vfolder>
+    </vfolder>
+    
+    <vfolder name="shared dirs">
+      <shared_dirs full_extend="true" />
+    </vfolder>
+    
+  </vfolder_layout>
+
+  <vfolder_layout device="Xbox 360" enabled="false">
+
+    <vfolder name="Music" id="1">
+      <vfolder name="Album" id="7">
+        <vfolders property="album">
+          <items type="audioItem" />
+        </vfolders>
+      </vfolder>
+            
+      <vfolder name="All Music" id="4">
+        <items type="audioItem" />
+      </vfolder>
+      
+      <vfolder name="Artist" id="6">
+        <vfolders property="artist">
+          <items type="audioItem" />
+        </vfolders>
+      </vfolder>
+      
+      <vfolder name="Folders" id="20">
+        <folders filter="contains(audioItem)" />
+      </vfolder>
+      
+      <vfolder name="Genre" id="5">
+        <vfolders property="genre">
+          <items type="audioItem" />
+        </vfolders>
+      </vfolder>
+      
+      <vfolder name="Playlist" id="15" />
+    </vfolder>
+   
+    <vfolder name="Pictures" id="3">
+      <vfolder name="Album" id="13" />
+      
+      <vfolder name="All Pictures" id="11">
+        <items type="imageItem" />
+      </vfolder>
+      
+      <vfolder name="Date Taken" id="12" />
+      
+      <vfolder name="Folders" id="22">
+        <folders filter="contains(imageItem)" />
+      </vfolder>
+    </vfolder>
+
+    <vfolder name="Playlists" id="18">
+      <vfolder name="All Playlists" id="19" />
+      <vfolder name="Folders" id="23" />
+    </vfolder>
+
+    <vfolder name="Video" id="2">
+      <vfolder name="Actor" id="10" />
+      <vfolder name="Album" id="14" />
+      <vfolder name="All Video" id="8">
+                               <items type="videoItem" />
+                       </vfolder>
+      <vfolder name="Folders" id="21">
+                          <folders filter="contains(videoItem)" />
+                       </vfolder>
+      <vfolder name="Genre" id="9" />
+    </vfolder>
+
+  </vfolder_layout>
+
+  <vfolder_layout device="Yamaha" enabled="false" create_references="true" >
+
+    <vfolder name="Playlists" />
+
+    <vfolder name="Artists">
+      <vfolders property="artist">
+        <items type="audioItem" />
+      </vfolders>
+    </vfolder>
+
+    <vfolder name="Albums">
+      <vfolders property="album">
+        <items type="audioItem" />
+      </vfolders>
+    </vfolder>
+
+    <vfolder name="Songs">
+      <items type="audioItem" />
+    </vfolder>
+
+    <vfolder name="Genres">
+      <vfolders property="genre">
+        <items type="audioItem" />
+      </vfolders>
+    </vfolder>
+
+  </vfolder_layout>
+
+</fuppes_vfolder_config>

Added: configurations/trunk/misc/nicolas.b.pierron/common/irc.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/misc/nicolas.b.pierron/common/irc.nix  Tue Jun  7 
15:03:12 2011        (r27366)
@@ -0,0 +1,43 @@
+{config, pkgs, ...}:
+
+let
+  cfg = config.services.ircClient;
+in
+
+with pkgs.lib;
+
+{
+  options = {
+    services.ircClient = {
+      enable = mkOption {
+        default = false;
+        type = with types; bool;
+        description = ''
+          Start an irc client for a user.
+        '';
+      };
+
+      user = mkOption {
+        default = "username";
+        type = with types; uniq string;
+        description = ''
+          Name of the user.
+        '';
+      };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    jobs.ircSession = {
+      description = "Start the irc client of ${cfg.user}.";
+      startOn = "started network-interfaces";
+      daemonType = "fork";
+      # connect on it with: ssh username@my-server -t screen -d -R irc
+      exec = ''/var/setuid-wrappers/sudo -u ${cfg.user} -- 
${pkgs.screen}/bin/screen -m -d -S irc ${pkgs.irssi}/bin/irssi'';
+    };
+
+    environment.systemPackages = [ pkgs.screen ];
+
+    security.sudo.enable = true;
+  };
+}
\ No newline at end of file

Modified: configurations/trunk/misc/nicolas.b.pierron/common/preferencies.nix
==============================================================================
--- configurations/trunk/misc/nicolas.b.pierron/common/preferencies.nix Tue Jun 
 7 15:03:03 2011        (r27365)
+++ configurations/trunk/misc/nicolas.b.pierron/common/preferencies.nix Tue Jun 
 7 15:03:12 2011        (r27366)
@@ -50,9 +50,9 @@
     # needed by wmii.
     systemPackages = [ pkgs.which ];
     kdePackages = with pkgs.kde4; [
-      kdeaccessibility kdegames kdetoys kdegraphics kdeutils koffice
+      /* kdeaccessibility */ kdegames /* kdetoys */ kdegraphics /* kdeutils */
       kdeplasma_addons kdepim kdepim_runtime kdenetwork kdemultimedia
-      kdeadmin kdeartwork kdeedu
+      kdeadmin /* kdeartwork */ kdeedu
     ] ++ pkgs.lib.optional config.hardware.bluetooth.enable pkgs.kbluetooth;
 
     checkConfigurationOptions = true;

Added: configurations/trunk/misc/nicolas.b.pierron/common/ups.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/misc/nicolas.b.pierron/common/ups.nix  Tue Jun  7 
15:03:12 2011        (r27366)
@@ -0,0 +1,283 @@
+{config, pkgs, ...}:
+
+# TODO: This is not secure, have a look at the file docs/security.txt inside
+# the project sources.
+with pkgs.lib;
+
+let
+  cfg = config.power.ups;
+
+  nut_nix = {stdenv, fetchurl, pkgconfig, neon, libusb, hal, openssl, udev}:
+
+  stdenv.mkDerivation {
+    name = "nut-2.6.1";
+    src = fetchurl {
+      url = http://www.networkupstools.org/source/2.6/nut-2.6.1.tar.gz;
+      sha256 = 
"f5c46b856c0cf5b7f0e4b22d82b670af64cc98717a90eaac8723dd402a181c00";
+    };
+    buildInputs = [pkgconfig neon libusb hal openssl udev];
+    configureFlags = [
+#              "--with-user=nut"
+#              "--with-group=nut"
+               "--with-all"
+               "--without-snmp" # Until we have it ...
+               "--without-powerman" # Until we have it ...
+                "--without-cgi"
+    ];
+  };
+
+  nut = pkgs.callPackage nut_nix {};
+in
+
+let
+  upsOptions = {name, config, ...}:
+  {
+    options = {
+      driver = mkOption {
+        type = types.uniq types.string;
+        description = ''
+          Specify the program to run to talk to this UPS.  apcsmart,
+          bestups, and sec are some examples.
+        '';
+      };
+
+      port = mkOption {
+        type = types.uniq types.string;
+        description = ''
+          The serial port where your UPS is connected.  /dev/ttyS0 is
+          usually the first port on Linux boxes, for example.
+        '';
+      };
+
+      shutdownOrder = mkOption {
+        default = 0;
+        type = types.uniq types.int;
+        description = ''
+          When you have multiple UPSes on your system, you usually need to
+          turn them off in a certain order.  upsdrvctl shuts down all the
+          0s, then the 1s, 2s, and so on.  To exclude a UPS from the
+          shutdown sequence, set this to -1.
+        '';
+      };
+
+      maxStartDelay = mkOption {
+        default = null;
+        type = types.uniq (types.nullOr types.int);
+        description = ''
+          This can be set as a global variable above your first UPS
+          definition and it can also be set in a UPS section.  This value
+          controls how long upsdrvctl will wait for the driver to finish
+          starting.  This keeps your system from getting stuck due to a
+          broken driver or UPS.
+        '';
+      };
+
+      description = mkOption {
+        default = "";
+        type = types.string;
+        description = ''
+          Description of the UPS.
+        '';
+      };
+
+      directives = mkOption {
+        default = [];
+        type = types.listOf types.string;
+        description = ''
+          List of configuration directives for this UPS.
+        '';
+      };
+
+      summary = mkOption {
+        default = "";
+        type = types.string;
+        description = ''
+          Lines which would be added inside ups.conf for handling this UPS.
+        '';
+      };
+
+    };
+
+    config = {
+      directives = mkHeader ([
+        "driver = ${config.driver}"
+        "port = ${config.port}"
+        ''desc = "${config.description}"''
+        "sdorder = ${toString config.shutdownOrder}"
+      ] ++ (optional (config.maxStartDelay != null)
+            "maxstartdelay = ${toString config.maxStartDelay}")
+      );
+
+      summary =
+        concatStringsSep "\n      "
+          (["[${name}]"] ++ config.directives);
+    };
+  };
+
+in
+
+
+{
+  options = {
+    # powerManagement.powerDownCommands
+
+    power.ups = {
+      enable = mkOption {
+        default = false;
+        type = with types; bool;
+        description = ''
+          Enables support for Power Devices, such as Uninterruptible Power
+          Supplies, Power Distribution Units and Solar Controllers.
+        '';
+      };
+
+      # This option is not used yet.
+      mode = mkOption {
+        default = "standalone";
+        type = types.uniq types.string;
+        description = ''
+          The MODE determines which part of the NUT is to be started, and
+          which configuration files must be modified.
+          
+          The values of MODE can be:
+
+          - none: NUT is not configured, or use the Integrated Power
+            Management, or use some external system to startup NUT
+            components. So nothing is to be started.
+
+          - standalone: This mode address a local only configuration, with 1
+            UPS protecting the local system. This implies to start the 3 NUT
+            layers (driver, upsd and upsmon) and the matching configuration
+            files. This mode can also address UPS redundancy.
+
+          - netserver: same as for the standalone configuration, but also
+            need some more ACLs and possibly a specific LISTEN directive in
+            upsd.conf.  Since this MODE is opened to the network, a special
+            care should be applied to security concerns.
+
+          - netclient: this mode only requires upsmon.
+        '';
+      };
+
+      schedulerRules = mkOption {
+        example = "/etc/nixos/upssched.conf";
+        type = types.uniq types.string;
+        description = ''
+          File which contains the rules to handle UPS events.
+        '';
+      };
+
+
+      maxStartDelay = mkOption {
+        default = 45;
+        type = types.uniq types.int;
+        description = ''
+          This can be set as a global variable above your first UPS
+          definition and it can also be set in a UPS section.  This value
+          controls how long upsdrvctl will wait for the driver to finish
+          starting.  This keeps your system from getting stuck due to a
+          broken driver or UPS.
+        '';
+      };
+
+      ups = mkOption {
+        default = {};
+        # see nut/etc/ups.conf.sample
+        description = ''
+          This is where you configure all the UPSes that this system will be
+          monitoring directly.  These are usually attached to serial ports,
+          but USB devices are also supported.
+        '';
+        type = types.attrsOf types.optionSet;
+        options = [ upsOptions ];
+      };
+
+    };
+  };
+
+  config = mkIf cfg.enable {
+
+    environment.systemPackages = [ nut ];
+
+    jobs.upsmon = {
+      description = "Uninterruptible Power Supplies (Monitor)";
+      startOn = "started network-interfaces";
+      exec = ''${nut}/sbin/upsmon'';
+      environment.NUT_CONFPATH = "/etc/nut/";
+      environment.NUT_STATEPATH = "/var/lib/nut/";
+    };
+
+    jobs.upsd = {
+      description = "Uninterruptible Power Supplies (Daemon)";
+      startOn = "started network-interfaces and upsmon";
+      exec = ''${nut}/sbin/upsd'';
+      environment.NUT_CONFPATH = "/etc/nut/";
+      environment.NUT_STATEPATH = "/var/lib/nut/";
+    };
+
+    jobs.upsdrv = {
+      description = "Uninterruptible Power Supplies (Register all UPS)";
+      startOn = "started upsd";
+      exec = ''${nut}/sbin/upsdrvctl start'';
+      task = true;
+      environment.NUT_CONFPATH = "/etc/nut/";
+      environment.NUT_STATEPATH = "/var/lib/nut/";
+    };
+
+    environment.etc = [
+      { source = pkgs.writeText "ups.conf"
+        ''
+          MODE = ${cfg.mode}
+        '';
+        target = "nut/nut.conf";
+      }
+      { source = pkgs.writeText "ups.conf"
+        ''
+          maxstartdelay = ${toString cfg.maxStartDelay}
+
+          ${flip concatStringsSep (flip map (attrValues cfg.ups) (ups: 
ups.summary)) "
+
+          "}
+        '';
+        target = "nut/ups.conf";
+      }
+      { source = cfg.schedulerRules;
+        target = "nut/upssched.conf";
+      }
+      # These file are containing private informations and thus should not
+      # be stored inside the Nix store.
+      /*
+      { source = ;
+        target = "nut/upsd.conf";
+      }
+      { source = ;
+        target = "nut/upsd.users";
+      }
+      { source = ;
+        target = "nut/upsmon.conf;
+      }
+      */
+    ];
+
+    power.ups.schedulerRules = mkDefault "${nut}/etc/upssched.conf.sample";
+
+/*
+    users.extraUsers = [
+      { name = "nut";
+        uid = 84;
+        home = "/var/lib/nut";
+        createHome = true;
+        group = "nut";
+        description = "UPnP A/V Media Server user";
+      }
+    ];
+  
+    users.extraGroups = [
+      { name = "nut";
+        gid = 84;
+      }
+    ];
+*/
+
+  };
+}

Added: configurations/trunk/misc/nicolas.b.pierron/keukenhof.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/misc/nicolas.b.pierron/keukenhof.nix   Tue Jun  7 
15:03:12 2011        (r27366)
@@ -0,0 +1,140 @@
+{config, pkgs, ...}:
+
+# This file declare the configuration of my home server which is used as a 
file storage, backup system and for holding connections such as irc.
+
+with pkgs.lib;
+
+{
+  require = [
+    # Common configuration shared between all my computers.
+    ./common/kb_fr.nix
+    ./common/user.nix
+    ./common/preferencies.nix
+
+    # Extra services
+    ./common/irc.nix
+    ./common/fuppes.nix
+    ./common/freepopsd.nix
+    ./common/ups.nix
+  ];
+
+  ## Basics
+  boot.initrd.availableKernelModules = [ "ext4" ];
+
+  boot.loader.grub = {
+    enable = true;
+    version = 2;
+    device = "/dev/sda";
+  };
+
+  networking = {
+    hostName = "keukenhof";
+    useDHCP = true;
+    interfaceMonitor.enable = true;
+  };
+
+  fileSystems = [
+    { label = "boot";  fsType = "ext3"; mountPoint = "/boot"; }
+    { label = "nixos"; fsType = "ext4"; mountPoint = "/"; }
+    # RAID-0 array
+    { label = "data";  fsType = "ext3"; mountPoint = "/mnt/data"; }
+  ];
+
+  swapDevices = [
+  ];
+
+
+  ## Share
+
+  services.nfsKernel.server = {
+    enable = true;
+    exports =
+    ''
+      /home/share             
192.168.1.0/255.255.255.0(rw,sync,all_squash,anonuid=1001,anongid=1001)
+    '';
+  };
+
+  services.samba = {
+    enable = true;
+    # This is only shared inside a secure network.
+    extraConfig =
+    ''
+         max log size = 50000
+         workgroup = MSHOME
+         server string = Sharing Server
+         security = share
+         guest account = share
+      
+      [public]
+         comment = Shared file space
+         path = /home/share/
+         guest ok = yes
+         browseable = yes
+         public = yes
+         writable = yes
+         create mask = 0644
+      
+      [tmp]
+         comment = Temporary file space
+         path = /tmp
+         read only = no
+         public = yes
+         create mask = 0644
+    '';
+  };
+
+  ## Fetch /deprecated/ webmail with a pop access.
+  services.mail.freepopsd = {
+    enable = true;
+    port =  1110;
+  };
+
+  ## UPS
+  power.ups = {
+    enable = true;
+    maxStartDelay = 120;
+    ups.iPEL1000 = {
+      driver = "megatec_usb";
+      port = "auto";
+      description = "USB UPS device";
+    };
+  };
+
+
+  ## Fuppes Daemon
+  services.fuppesd = {
+    enable = true;
+    user = "fuppes";
+    config = "/etc/fuppes/fuppes.cfg";
+    log.level = 3;
+  };
+
+  system.activationScripts.initFuppes = stringAfter [ "etc" "users" "groups" ]
+  ''
+    test -e /etc/fuppes || cp -r ${./keukenhof/etc/fuppes} /etc/fuppes
+    chown -R fuppes:fuppes /etc/fuppes
+  '';
+
+  users.extraUsers = [
+    { name = "fuppes";
+      uid = 440;
+      group = "fuppes";
+      description = "UPnP A/V Media Server user";
+      home = "/var/lib/fuppes";
+      createHome = true;
+      shell = "/bin/sh";
+    }
+  ];
+
+  users.extraGroups = [
+    { name = "fuppes";
+      gid = 440;
+    }
+  ];
+
+  ## Irc client host
+  services.ircClient = {
+    enable = true;
+    user = "nicolas";
+  };
+}
\ No newline at end of file

Added: 
configurations/trunk/misc/nicolas.b.pierron/keukenhof/etc/fuppes/fuppes.cfg
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ configurations/trunk/misc/nicolas.b.pierron/keukenhof/etc/fuppes/fuppes.cfg 
Tue Jun  7 15:03:12 2011        (r27366)
@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fuppes_config version="0.7.2.3">
+  <shared_objects>
+    <!--<dir>/mnt/music</dir>-->
+    <!--<itunes>/Users/.../iTunes.xml</itunes>-->
+    <dir>/home/share/Photos</dir>
+    <dir>/home/share/Bureau/Video</dir>
+    <dir>/home/share/Bureau/Zic</dir>
+  </shared_objects>
+  <network>
+    <!--empty = automatic detection-->
+    <interface>eth0</interface>
+    <!--empty or 0 = random port-->
+    <http_port>12080</http_port>
+    <!--list of ip addresses allowed to access fuppes. if empty all ips are 
allowed-->
+    <allowed_ips>
+      <!--These are examples of what data you can put between the ip tags 
where (* => anything, [x-y] => range)-->
+      <!--<ip>192.168.0.1</ip>-->
+      <!--<ip>192.168.0.[20-100]</ip>-->
+      <!--<ip>192.168.0.*</ip>-->
+      <!--<ip>192.*.[0-2].[40-*]</ip>-->
+    </allowed_ips>
+  </network>
+  <content_directory>
+    <!--a list of possible charsets can be found under:
+      http://www.gnu.org/software/libiconv/-->
+    <local_charset>UTF-8</local_charset>
+    <!--libs used for metadata extraction when building the database. 
[true|false]-->
+    <use_imagemagick>true</use_imagemagick>
+    <use_taglib>true</use_taglib>
+    <use_libavformat>true</use_libavformat>
+  </content_directory>
+  <global_settings>
+    <temp_dir/>
+    <!--uuid is written to and read from <config-dir>/uuid.txt if set to 
true-->
+    <use_fixed_uuid>false</use_fixed_uuid>
+  </global_settings>
+  <device_settings>
+    <!--"default" settings are inhertied by specific devices and can be 
overwritten-->
+    <!--do NOT remove the "default" device settings-->
+    <!--all new file types have to be added to the default settings-->
+    <!--adding new file types just to a specific device will have no affect-->
+    <device name="default">
+      <!--specify the maximum length for file names (0 or empty = unlimited)-->
+      <max_file_name_length>0</max_file_name_length>
+      <!--[file|container]-->
+      <playlist_style>file</playlist_style>
+      <show_childcount_in_title>false</show_childcount_in_title>
+      <enable_dlna>false</enable_dlna>
+      <transcoding_release_delay>4</transcoding_release_delay>
+      <file_settings>
+        <!--audio files-->
+        <file ext="mp3">
+          <type>AUDIO_ITEM</type>
+          <mime_type>audio/mpeg</mime_type>
+          <dlna>MP3</dlna>
+        </file>
+        <file ext="ogg">
+          <type>AUDIO_ITEM</type>
+          <mime_type>application/octet-stream</mime_type>
+          <transcode enabled="true">
+            <ext>mp3</ext>
+            <mime_type>audio/mpeg</mime_type>
+            <dlna>MP3</dlna>
+            <http_encoding>chunked</http_encoding>
+            <decoder>vorbis</decoder>
+            <encoder>lame</encoder>
+            <bitrate>192</bitrate>
+            <samplerate>44100</samplerate>
+          </transcode>
+        </file>
+        <file ext="mpc">
+          <type>AUDIO_ITEM</type>
+          <mime_type>application/octet-stream</mime_type>
+          <transcode enabled="true">
+            <ext>mp3</ext>
+            <mime_type>audio/mpeg</mime_type>
+            <dlna>MP3</dlna>
+            <http_encoding>chunked</http_encoding>
+            <decoder>musepack</decoder>
+            <encoder>lame</encoder>
+            <bitrate>192</bitrate>
+            <samplerate>44100</samplerate>
+          </transcode>
+        </file>
+        <file ext="wav">
+          <type>AUDIO_ITEM</type>
+          <mime_type>audio/x-wav</mime_type>
+        </file>
+        <file ext="flac">
+          <type>AUDIO_ITEM</type>
+          <mime_type>audio/x-flac</mime_type>
+          <transcode enabled="true">
+            <ext>mp3</ext>
+            <mime_type>audio/mpeg</mime_type>
+            <dlna>MP3</dlna>
+            <http_encoding>chunked</http_encoding>
+            <decoder>flac</decoder>
+            <encoder>lame</encoder>
+            <bitrate>192</bitrate>
+            <samplerate>44100</samplerate>
+          </transcode>
+        </file>
+        <file ext="wma">
+          <type>AUDIO_ITEM</type>
+          <mime_type>audio/x-ms-wma</mime_type>
+          <dlna>WMAFULL</dlna>
+        </file>
+        <file ext="m4a">
+          <type>AUDIO_ITEM</type>
+          <mime_type>audio/mp4a-latm</mime_type>
+          <dlna>M4A</dlna>
+          <!-- faad is not supported :(
+          <transcode enabled="true">
+            <ext>mp3</ext>
+            <mime_type>audio/mpeg</mime_type>
+            <dlna>MP3</dlna>
+            <http_encoding>stream</http_encoding>
+            <decoder>faad</decoder>
+            <encoder>lame</encoder>
+            <bitrate>192</bitrate>
+            <samplerate>44100</samplerate>
+          </transcode>
+          -->
+        </file>
+        <file ext="aac">
+          <type>AUDIO_ITEM</type>
+          <mime_type>audio/x-aac</mime_type>
+          <dlna>AAC</dlna>
+        </file>
+        <!--image files-->
+        <file ext="jpg">
+          <ext>jpeg</ext>
+          <type>IMAGE_ITEM</type>
+          <mime_type>image/jpeg</mime_type>
+          <convert enabled="false">
+            <!--<dcraw enabled="true">-q 0</dcraw>-->
+            <ext>png</ext>
+            <mime_type>image/png</mime_type>
+            <height>0</height>
+            <width>0</width>
+            <!--set "greater" to "true" if you only want to resize images 
greater than "height" or "width"-->
+            <greater>false</greater>
+            <!--set "less" to "true" if you only want to resize images less 
than "height" or "width"-->
+            <less>false</less>
+            <!--set "less" and "greater" to "false" if you always want to 
resize-->
+          </convert>
+        </file>
+        <file ext="bmp">
+          <type>IMAGE_ITEM</type>
+          <mime_type>image/bmp</mime_type>
+        </file>
+        <file ext="png">
+          <type>IMAGE_ITEM</type>
+          <mime_type>image/png</mime_type>
+        </file>
+        <file ext="gif">
+          <type>IMAGE_ITEM</type>
+          <mime_type>image/gif</mime_type>
+        </file>
+        <!--video files-->
+        <file ext="mpg">
+          <ext>mpeg</ext>
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/mpeg</mime_type>
+        </file>
+        <file ext="mp4">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/mp4</mime_type>
+        </file>
+        <file ext="avi">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/x-msvideo</mime_type>
+        </file>
+        <file ext="wmv">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/x-ms-wmv</mime_type>
+        </file>
+        <file ext="vob">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/x-ms-vob</mime_type>
+        </file>
+        <file ext="mkv">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/x-matroska</mime_type>
+        </file>
+        <file ext="vdr">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/x-extension-vdr</mime_type>
+          <transcode enabled="true">
+            <ext>vob</ext>
+            <mime_type>video/x-ms-vob</mime_type>
+          </transcode>
+        </file>
+        <file ext="flv">
+          <type>VIDEO_ITEM</type>
+          <mime_type>application/x-flash-video</mime_type>
+        </file>
+        <file ext="asf">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/x-ms-asf</mime_type>
+        </file>
+        <!--playlists-->
+        <file ext="pls">
+          <type>PLAYLIST</type>
+          <mime_type>audio/x-scpls</mime_type>
+        </file>
+        <file ext="m3u">
+          <type>PLAYLIST</type>
+          <mime_type>audio/x-mpegurl</mime_type>
+        </file>
+        <file ext="wpl">
+          <type>PLAYLIST</type>
+          <mime_type>application/vnd.ms-wpl</mime_type>
+        </file>
+      </file_settings>
+    </device>
+    <!--For other device settings take a look at 
http://fuppes.ulrich-voelkel.de/wiki/index.php/Category:Device-->
+    <!--If you have more than one device it is a good idea to set the ip 
address as some devices may have conflicting "user agents".-->
+    <!--It is safe to remove unneeded devices-->
+    <device name="PS3" enabled="false">
+      <user_agent>UPnP/1.0 DLNADOC/1.00</user_agent>
+      <user_agent>PLAYSTATION3</user_agent>
+      <!--<ip></ip>-->
+      <enable_dlna>true</enable_dlna>
+      <transcoding_release_delay>50</transcoding_release_delay>
+      <file_settings>
+        <file ext="ogg">
+          <type>AUDIO_ITEM_MUSIC_TRACK</type>
+          <transcode enabled="true">
+            <http_encoding>stream</http_encoding>
+          </transcode>
+        </file>
+      </file_settings>
+    </device>
+    <device name="Xbox 360" virtual="Xbox 360" enabled="false">
+      <user_agent>Xbox/2.0.\d+.\d+ UPnP/1.0 Xbox/2.0.\d+.\d+</user_agent>
+      <user_agent>Xenon</user_agent>
+      <xbox360>true</xbox360>
+      <show_empty_resolution>true</show_empty_resolution>
+      <!--This section is for the mime types that the makers of the XBox 
changed from standards.-->
+      <file_settings>
+        <file ext="avi">
+          <type>VIDEO_ITEM</type>
+          <mime_type>video/avi</mime_type>
+        </file>
+      </file_settings>
+      <description_values>
+        <friendly_name>%s %v : 1 : Windows Media Connect</friendly_name>
+        <model_name>Windows Media Connect compatible (%s)</model_name>
+        <model_number>2.0</model_number>
+      </description_values>
+    </device>
+  </device_settings>
+</fuppes_config>

Modified: configurations/trunk/misc/nicolas.b.pierron/vinon.nix
==============================================================================
--- configurations/trunk/misc/nicolas.b.pierron/vinon.nix       Tue Jun  7 
15:03:03 2011        (r27365)
+++ configurations/trunk/misc/nicolas.b.pierron/vinon.nix       Tue Jun  7 
15:03:12 2011        (r27366)
@@ -111,6 +111,7 @@
   security.pam.usb.enable = true;
   environment.systemPackages = [
     pkgs.cryptsetup
+    pkgs.linuxPackages.virtualbox
   ];
 
 /*
@@ -125,9 +126,13 @@
 */
 
   installer = {
-    manifests = [
+    # install nixos-gui.
+    enableGraphicalTools = true;
+
+#    manifests = [
 #      http://hydra.nixos.org/channel/latest/MANIFEST
-      http://hydra.nixos.org/project/nixpkgs/channel/all/MANIFEST
-    ];
+#      http://hydra.nixos.org/project/nixpkgs/channel/all/MANIFEST
+#    ];
+
   };
 }
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to