diff --git a/.gitignore b/.gitignore index 52d186c15..420e5d62f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ result -.env* +.env +.env.* .devenv* /.cache /.pre-commit-config.yaml diff --git a/templates/flake-parts/.envrc b/templates/flake-parts/.envrc new file mode 100644 index 000000000..b351dff3d --- /dev/null +++ b/templates/flake-parts/.envrc @@ -0,0 +1,11 @@ +if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" +fi + +nix_direnv_watch_file devenv.nix +nix_direnv_watch_file devenv.lock +nix_direnv_watch_file devenv.yaml +if ! use flake . --impure +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/templates/flake-parts/.gitignore b/templates/flake-parts/.gitignore new file mode 100644 index 000000000..26d999ee5 --- /dev/null +++ b/templates/flake-parts/.gitignore @@ -0,0 +1 @@ +.devenv diff --git a/templates/simple/.gitignore b/templates/simple/.gitignore new file mode 100644 index 000000000..26d999ee5 --- /dev/null +++ b/templates/simple/.gitignore @@ -0,0 +1 @@ +.devenv diff --git a/templates/simple/flake.nix b/templates/simple/flake.nix index bb9fbde69..f80bed509 100644 --- a/templates/simple/flake.nix +++ b/templates/simple/flake.nix @@ -15,6 +15,10 @@ forEachSystem = nixpkgs.lib.genAttrs (import systems); in { + packages = forEachSystem (system: { + devenv-up = self.devShells.${system}.default.config.procfileScript; + }); + devShells = forEachSystem (system: let diff --git a/templates/terraform/.envrc b/templates/terraform/.envrc index 40851621d..b351dff3d 100644 --- a/templates/terraform/.envrc +++ b/templates/terraform/.envrc @@ -1,8 +1,11 @@ -if ! has nix_direnv_version || ! nix_direnv_version 2.2.0; then - source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.0/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc=" +if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" fi nix_direnv_watch_file devenv.nix nix_direnv_watch_file devenv.lock nix_direnv_watch_file devenv.yaml -use flake . --impure +if ! use flake . --impure +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/templates/terraform/.gitignore b/templates/terraform/.gitignore new file mode 100644 index 000000000..26d999ee5 --- /dev/null +++ b/templates/terraform/.gitignore @@ -0,0 +1 @@ +.devenv