Skip to content

Commit

Permalink
Merge pull request #874 from cachix/fix/templates
Browse files Browse the repository at this point in the history
template: update templates
  • Loading branch information
domenkozar authored Nov 16, 2023
2 parents 14fdefc + 59f3c1e commit 8f4d96b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
result
.env*
.env
.env.*
.devenv*
/.cache
/.pre-commit-config.yaml
Expand Down
11 changes: 11 additions & 0 deletions templates/flake-parts/.envrc
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions templates/flake-parts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.devenv
1 change: 1 addition & 0 deletions templates/simple/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.devenv
4 changes: 4 additions & 0 deletions templates/simple/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions templates/terraform/.envrc
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions templates/terraform/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.devenv

0 comments on commit 8f4d96b

Please sign in to comment.