diff --git a/ChangeLog.md b/ChangeLog.md
new file mode 100644
--- /dev/null
+++ b/ChangeLog.md
@@ -0,0 +1,5 @@
+# Revision history for gargoyle-postgresql-nix
+
+## 0.3
+
+* Initial hackage release
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,12 @@
+Copyright (c) 2017, Obsidian Systems LLC
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
new file mode 100644
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# gargoyle-postgresql-nix
+
+This is a companion package for gargoyle-postgresql that uses nix to find the locations of PostgreSQL executables.
+
+Please see the [gargoyle-postgresql](https://hackage.haskell.org/package/gargoyle-postgresql) documentation for more information.
diff --git a/gargoyle-postgresql-nix.cabal b/gargoyle-postgresql-nix.cabal
new file mode 100644
--- /dev/null
+++ b/gargoyle-postgresql-nix.cabal
@@ -0,0 +1,69 @@
+name:               gargoyle-postgresql-nix
+version:            0.3.0.0
+author:             Obsidian Systems LLC
+maintainer:         maintainer@obsidian.systems
+copyright:          Copyright (C) 2017 Obsidian Systems LLC
+license:            BSD3
+license-file:       LICENSE
+build-type:         Simple
+cabal-version:      >=1.10
+synopsis:           Manage PostgreSQL servers with gargoyle and nix
+category:           System
+description:
+  Like <https://hackage.haskell.org/package/gargoyle-postgresql gargoyle-postgresql> but it uses nix to find the locations of PostgreSQL executables.
+
+extra-source-files:
+  README.md
+  ChangeLog.md
+
+tested-with:        GHC ==8.6.5 || ==8.8.4 || ==8.10.2
+
+library
+  exposed-modules:  Gargoyle.PostgreSQL.Nix
+  other-modules:    Paths_gargoyle_postgresql_nix
+  ghc-options:      -Wall
+  ghc-prof-options: -fprof-auto-exported
+  build-depends:
+      base                 >=4.12 && <4.15
+    , bytestring           >=0.10 && <0.12
+    , gargoyle             >=0.1  && <0.2
+    , gargoyle-postgresql  >=0.2  && <0.3
+    , which                >=0.2  && <0.3
+
+  hs-source-dirs:   src
+  default-language: Haskell2010
+
+executable gargoyle-nix-psql
+  main-is:          gargoyle-nix-psql.hs
+  hs-source-dirs:   src-bin
+  ghc-options:      -Wall -threaded
+  ghc-prof-options: -fprof-auto-exported
+  default-language: Haskell2010
+  build-depends:
+      base
+    , gargoyle-postgresql
+    , gargoyle-postgresql-nix
+    , which
+
+executable gargoyle-nix-pg-run
+  main-is:          gargoyle-nix-pg-run.hs
+  hs-source-dirs:   src-bin
+  ghc-options:      -Wall -threaded
+  ghc-prof-options: -fprof-auto-exported
+  default-language: Haskell2010
+  build-depends:
+      base
+    , gargoyle
+    , gargoyle-postgresql
+    , gargoyle-postgresql-nix
+
+executable gargoyle-nix-postgres-monitor
+  main-is:          gargoyle-nix-postgres-monitor.hs
+  hs-source-dirs:   src-bin
+  ghc-options:      -Wall -threaded
+  ghc-prof-options: -fprof-auto-exported
+  default-language: Haskell2010
+  build-depends:
+      base
+    , gargoyle
+    , gargoyle-postgresql-nix
diff --git a/src-bin/gargoyle-nix-pg-run.hs b/src-bin/gargoyle-nix-pg-run.hs
new file mode 100644
--- /dev/null
+++ b/src-bin/gargoyle-nix-pg-run.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Main where
+
+import System.Environment (getArgs, getProgName)
+import System.Exit (exitFailure, exitWith)
+
+import Gargoyle.PostgreSQL (runPgLocalWithSubstitution)
+import Gargoyle.PostgreSQL.Nix (postgresNix)
+
+main :: IO ()
+main = do
+  args <- getArgs
+  case args of
+    dbPath:cmd:cmdArgs -> do
+      pg <- postgresNix
+      exitWith =<< runPgLocalWithSubstitution pg dbPath cmd (\conn -> if null cmdArgs then [conn] else substArgs conn cmdArgs) Nothing
+    _ -> do
+      pname <- getProgName
+      putStrLn $ unwords [ "USAGE:", pname, "<path>", "<command>", "[...<arguments>]" ]
+      putStrLn "\t<path>: path to local db"
+      putStrLn "\t<command>: command to run"
+      putStrLn "\t<arguments>: list of arguments to <command> where the special argument '{}' is expanded into a connection string; if <arguments> is empty, '{}' will be supplied as the only argument by default"
+      exitFailure
+  where
+    substArgs conn = map (\x -> if x == "{}" then conn else x)
diff --git a/src-bin/gargoyle-nix-postgres-monitor.hs b/src-bin/gargoyle-nix-postgres-monitor.hs
new file mode 100644
--- /dev/null
+++ b/src-bin/gargoyle-nix-postgres-monitor.hs
@@ -0,0 +1,7 @@
+module Main where
+
+import Gargoyle
+import Gargoyle.PostgreSQL.Nix
+
+main :: IO ()
+main = postgresNix >>= gargoyleMain
diff --git a/src-bin/gargoyle-nix-psql.hs b/src-bin/gargoyle-nix-psql.hs
new file mode 100644
--- /dev/null
+++ b/src-bin/gargoyle-nix-psql.hs
@@ -0,0 +1,26 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TemplateHaskell #-}
+module Main where
+
+import Data.List
+import System.Environment
+import System.Exit
+
+import Gargoyle.PostgreSQL
+import Gargoyle.PostgreSQL.Nix
+import System.Which
+
+main :: IO ()
+main = do
+  args <- getArgs
+  case args of
+    [dbPath] -> do
+      g <- postgresNix
+      psqlLocal g $(staticWhich "psql") dbPath Nothing
+    _ -> do
+      pname <- getProgName
+      putStrLn $ intercalate " "
+        [ "USAGE:", pname, "<path>" ]
+      putStrLn "\t<path>: path to local db"
+      exitFailure
+  return ()
diff --git a/src/Gargoyle/PostgreSQL/Nix.hs b/src/Gargoyle/PostgreSQL/Nix.hs
new file mode 100644
--- /dev/null
+++ b/src/Gargoyle/PostgreSQL/Nix.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TemplateHaskell   #-}
+module Gargoyle.PostgreSQL.Nix where
+
+import Data.ByteString (ByteString)
+
+import Gargoyle
+import Gargoyle.PostgreSQL
+
+import Paths_gargoyle_postgresql_nix
+import System.Which
+
+postgresNix :: IO (Gargoyle FilePath ByteString)
+postgresNix = do
+  bindir <- getBinDir
+  return $ (mkPostgresGargoyle $(staticWhich "pg_ctl") shutdownPostgresFast)
+    { _gargoyle_exec = bindir <> "/gargoyle-nix-postgres-monitor"
+    }
