Fix build when using nix & minor cleanup
This commit is contained in:
parent
7209b69859
commit
1d8e10566e
10
shell.nix
10
shell.nix
@ -13,6 +13,8 @@ let
|
|||||||
CREATE USER uniworx;
|
CREATE USER uniworx;
|
||||||
CREATE DATABASE uniworx_test;
|
CREATE DATABASE uniworx_test;
|
||||||
GRANT ALL ON DATABASE uniworx_test TO uniworx;
|
GRANT ALL ON DATABASE uniworx_test TO uniworx;
|
||||||
|
CREATE DATABASE uniworx;
|
||||||
|
GRANT ALL ON DATABASE uniworx TO uniworx;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postgresHba = pkgs.writeText "hba_file" ''
|
postgresHba = pkgs.writeText "hba_file" ''
|
||||||
@ -33,16 +35,12 @@ let
|
|||||||
export PGHOST=''${pgSockDir} PGLOG=''${pgLogFile}
|
export PGHOST=''${pgSockDir} PGLOG=''${pgLogFile}
|
||||||
psql -f ${postgresSchema} postgres
|
psql -f ${postgresSchema} postgres
|
||||||
printf "Postgres logfile is %s\nPostgres socket directory is %s\n" ''${pgLogFile} ''${pgSockDir}
|
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=$?
|
ret=$?
|
||||||
|
|
||||||
pg_ctl stop -D ''${pgDir}
|
pg_ctl stop -D ''${pgDir}
|
||||||
rm -rvf .dbsettings.yml ''${pgDir} ''${pgSockDir} ''${pgLogFile}
|
rm -rvf ''${pgDir} ''${pgSockDir} ''${pgLogFile}
|
||||||
exit ''${ret}
|
exit ''${ret}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|||||||
@ -133,7 +133,7 @@ getApplicationDev = do
|
|||||||
return (wsettings, app)
|
return (wsettings, app)
|
||||||
|
|
||||||
getAppDevSettings :: IO AppSettings
|
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
|
-- | main function for use by yesod devel
|
||||||
develMain :: IO ()
|
develMain :: IO ()
|
||||||
|
|||||||
@ -68,3 +68,4 @@ extra-package-dbs: []
|
|||||||
nix:
|
nix:
|
||||||
packages: []
|
packages: []
|
||||||
shell-file: ./stack.nix
|
shell-file: ./stack.nix
|
||||||
|
pure: false
|
||||||
|
|||||||
@ -40,7 +40,7 @@ runHandler handler = do
|
|||||||
withApp :: SpecWith (TestApp UniWorX) -> Spec
|
withApp :: SpecWith (TestApp UniWorX) -> Spec
|
||||||
withApp = before $ do
|
withApp = before $ do
|
||||||
settings <- loadYamlSettings
|
settings <- loadYamlSettings
|
||||||
[".dbsettings.yml", "config/test-settings.yml", "config/settings.yml"]
|
["config/test-settings.yml", "config/settings.yml"]
|
||||||
[]
|
[]
|
||||||
useEnv
|
useEnv
|
||||||
foundation <- makeFoundation settings
|
foundation <- makeFoundation settings
|
||||||
|
|||||||
Reference in New Issue
Block a user