diff --git a/examples/rubyonrails/.test.sh b/examples/rubyonrails/.test.sh index a055c6b04..1c701bfa9 100755 --- a/examples/rubyonrails/.test.sh +++ b/examples/rubyonrails/.test.sh @@ -2,9 +2,9 @@ set -ex pushd blog - wait_for_port 5100 + wait_for_port 3000 rails db:create - curl -s http://localhost:5100/ | grep "version" + curl -s http://localhost:3000/ | grep "version" popd # make sure puma was compiled with ssl diff --git a/examples/rubyonrails/devenv.nix b/examples/rubyonrails/devenv.nix index 1273110ca..4586b3f9d 100644 --- a/examples/rubyonrails/devenv.nix +++ b/examples/rubyonrails/devenv.nix @@ -16,7 +16,7 @@ enterShell = '' if [ ! -d "blog" ]; then gem install rails - rails new blog -d=postgresql + rails new blog --database=postgresql --force fi export PATH="$DEVENV_ROOT/blog/bin:$PATH" pushd blog diff --git a/package.nix b/package.nix index 6a6cf019d..54651a6c5 100644 --- a/package.nix +++ b/package.nix @@ -4,11 +4,12 @@ pkgs.rustPlatform.buildRustPackage { pname = "devenv"; version = "1.0.0"; - src = builtins.path { - path = ./.; - filter = path: type: - path != "Cargo.lock" || path != "Cargo.toml" || path != "src/devenv"; - }; + src = pkgs.lib.sourceByRegex ./. [ + "Cargo.toml" + "Cargo.lock" + "devenv(/\.*)?" + "devenv-run-tests(/\.*)?" + ]; cargoLock = { lockFile = ./Cargo.lock; diff --git a/src/modules/services/postgres.nix b/src/modules/services/postgres.nix index 4dfef8c68..847380764 100644 --- a/src/modules/services/postgres.nix +++ b/src/modules/services/postgres.nix @@ -56,7 +56,10 @@ let cfg.initialDatabases) else lib.optionalString cfg.createDatabase '' - echo "CREATE DATABASE ''${USER:-$(id -nu)};" | psql --dbname postgres''; + psql --dbname postgres << EOF + CREATE DATABASE "''${USER:-$(id -nu)}"; + EOF + ''; runInitialScript = if cfg.initialScript != null then