diff --git a/cabal2nix.cabal b/cabal2nix.cabal
--- a/cabal2nix.cabal
+++ b/cabal2nix.cabal
@@ -1,5 +1,5 @@
 Name:                   cabal2nix
-Version:                1.0
+Version:                1.1
 Copyright:              (c) 2011 Peter Simons
 License:                BSD3
 License-File:           LICENSE
diff --git a/cabal2nix.hs b/cabal2nix.hs
--- a/cabal2nix.hs
+++ b/cabal2nix.hs
@@ -32,7 +32,8 @@
   deriving (Show)
 
 toNixName :: String -> String
-toNixName name = f name
+toNixName [] = error "toNixName: empty string is not a valid argument"
+toNixName name = f ((toLower (head name)) : tail name)
   where
     f []                            = []
     f ('-':c:cs) | c `notElem` "-"  = toUpper c : f cs
