diff --git a/Procfile b/Procfile
index 42267366..2ccd32b2 100644
--- a/Procfile
+++ b/Procfile
@@ -1,4 +1,4 @@
-hydra-server: ./scripts/start-hydra.sh
-hydra-queue-runner: ./scripts/start-queue-runner.sh
-hydra-evaluator: ./scripts/start-evaluator.sh
-postgres: ./scripts/start-postgres.sh
+hydra-server: ./foreman/start-hydra.sh
+hydra-queue-runner: ./foreman/start-queue-runner.sh
+hydra-evaluator: ./foreman/start-evaluator.sh
+postgres: ./foreman/start-postgres.sh
diff --git a/flake.nix b/flake.nix
index 87e402dd..2611bd01 100644
--- a/flake.nix
+++ b/flake.nix
@@ -105,13 +105,14 @@
               gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
               perlDeps perl final.nix
               boost
+              postgresql95
               (if lib.versionAtLeast lib.version "20.03pre"
                then nlohmann_json
                else nlohmann_json.override { multipleHeaders = true; })
             ];
 
           checkInputs = [
-            postgresql95
+            foreman
           ];
 
           hydraPath = lib.makeBinPath (
@@ -124,6 +125,10 @@
           shellHook = ''
             PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
             PERL5LIB=$(pwd)/src/lib:$PERL5LIB
+            export HYDRA_HOME="src/"
+            mkdir -p .hydra-data
+            export HYDRA_DATA="$(pwd)/.hydra-data"
+            export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444'
           '';
 
           preConfigure = "autoreconf -vfi";
@@ -293,17 +298,6 @@
         nixpkgs.overlays = [ self.overlay nix.overlay ];
       };
 
-      runHydra = pkgs.callPackage ./run-hydra.nix {};
-      devShell = pkgs.hydra.overrideAttrs (old: {
-        buildInputs = old.buildInputs ++ [ pkgs.foreman ];
-        shellHook = old.shellHook + ''
-          export HYDRA_HOME="src/"
-          mkdir -p .hydra-data
-          export HYDRA_DATA="$(pwd)/.hydra-data"
-          export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444'
-        '';
-      });
-
       nixosModules.hydraTest = {
         imports = [ self.nixosModules.hydra ];
 
diff --git a/scripts/start-evaluator.sh b/foreman/start-evaluator.sh
similarity index 100%
rename from scripts/start-evaluator.sh
rename to foreman/start-evaluator.sh
diff --git a/scripts/start-hydra.sh b/foreman/start-hydra.sh
similarity index 100%
rename from scripts/start-hydra.sh
rename to foreman/start-hydra.sh
diff --git a/scripts/start-postgres.sh b/foreman/start-postgres.sh
similarity index 100%
rename from scripts/start-postgres.sh
rename to foreman/start-postgres.sh
diff --git a/scripts/start-queue-runner.sh b/foreman/start-queue-runner.sh
similarity index 100%
rename from scripts/start-queue-runner.sh
rename to foreman/start-queue-runner.sh
diff --git a/run-hydra.nix b/run-hydra.nix
deleted file mode 100644
index 59eb2740..00000000
--- a/run-hydra.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ foreman, mkShell, hydra, postgresql95 }:
-{ doCheck ? true }:
-mkShell {
-  buildInputs = [
-    foreman (hydra.overrideAttrs (_: { inherit doCheck; })) postgresql95
-  ];
-
-  shellHook = ''
-    export HYDRA_HOME="src/"
-    mkdir -p .hydra-data
-    export HYDRA_DATA="$(pwd)/.hydra-data"
-    export HYDRA_DBI='dbi:Pg:dbname=hydra;host=localhost;port=64444'
-
-    exec foreman start
-  '';
-}
diff --git a/shell.nix b/shell.nix
index cd9ccd4c..8b8aa5aa 100644
--- a/shell.nix
+++ b/shell.nix
@@ -3,4 +3,4 @@
 
 (import (fetchTarball https://github.com/edolstra/flake-compat/archive/master.tar.gz) {
   src = builtins.fetchGit ./.;
-}).defaultNix.devShell
+}).shellNix