Fix build when using nix & minor cleanup

This commit is contained in:
Gregor Kleen 2017-10-05 11:30:49 +02:00
parent 7209b69859
commit 1d8e10566e
4 changed files with 7 additions and 8 deletions

View File

@ -13,6 +13,8 @@ let
CREATE USER uniworx;
CREATE DATABASE uniworx_test;
GRANT ALL ON DATABASE uniworx_test TO uniworx;
CREATE DATABASE uniworx;
GRANT ALL ON DATABASE uniworx TO uniworx;
'';
postgresHba = pkgs.writeText "hba_file" ''
@ -33,16 +35,12 @@ let
export PGHOST=''${pgSockDir} PGLOG=''${pgLogFile}
psql -f ${postgresSchema} postgres
printf "Postgres logfile is %s\nPostgres socket directory is %s\n" ''${pgLogFile} ''${pgSockDir}
cat > .dbsettings.yml <<EOF
database:
host: ''${pgSockDir}
EOF
zsh
env --unset=shellHook zsh
ret=$?
pg_ctl stop -D ''${pgDir}
rm -rvf .dbsettings.yml ''${pgDir} ''${pgSockDir} ''${pgLogFile}
rm -rvf ''${pgDir} ''${pgSockDir} ''${pgLogFile}
exit ''${ret}
'';
};

View File

@ -133,7 +133,7 @@ getApplicationDev = do
return (wsettings, app)
getAppDevSettings :: IO AppSettings
getAppDevSettings = loadYamlSettings ["config/settings.yml", "config/test-settings.yml", configSettingsYml] [configSettingsYmlValue] useEnv
getAppDevSettings = loadYamlSettings [configSettingsYml] [configSettingsYmlValue] useEnv
-- | main function for use by yesod devel
develMain :: IO ()

View File

@ -68,3 +68,4 @@ extra-package-dbs: []
nix:
packages: []
shell-file: ./stack.nix
pure: false

View File

@ -40,7 +40,7 @@ runHandler handler = do
withApp :: SpecWith (TestApp UniWorX) -> Spec
withApp = before $ do
settings <- loadYamlSettings
[".dbsettings.yml", "config/test-settings.yml", "config/settings.yml"]
["config/test-settings.yml", "config/settings.yml"]
[]
useEnv
foundation <- makeFoundation settings