From ac1442b11894b3e8f7766eb618d002a9f365014c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sadjow=20Le=C3=A3o?= Date: Sat, 21 Sep 2024 10:54:08 -0300 Subject: [PATCH 1/3] feat(devenv): setup devenv and add instructions in the README --- .envrc | 3 ++ .gitignore | 9 ++++ README.md | 2 + devenv.lock | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++ devenv.nix | 18 ++++++++ devenv.yaml | 15 +++++++ 6 files changed, 163 insertions(+) create mode 100644 .envrc create mode 100644 devenv.lock create mode 100644 devenv.nix create mode 100644 devenv.yaml diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..5bf8fc1 --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0=" + +use devenv \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7a3eb22..850317a 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,12 @@ coverage Network Trash Folder Temporary Items .apdisk +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/README.md b/README.md index 86f5351..a41fb76 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,8 @@ In the `$utm` array, each entry provides a `timestamp` indicating when the UTM p ## Development +### Devenv, you can take advantage of (devenv.sh)[https://devenv.sh] to quickly create the development environment for this this project. Use it in combination with [direnv](https://direnv.net/) to quickly load all the environment while navigating into the project directory in your shell. + ```bash # Install dependencies yarn install diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..7f3d595 --- /dev/null +++ b/devenv.lock @@ -0,0 +1,116 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1726826452, + "owner": "cachix", + "repo": "devenv", + "rev": "2bdf6461e88c7e93b94d72d8b11d5a61f167cbf5", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716977621, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1726838390, + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "944b2aea7f0a2d7c79f72468106bc5510cbf5101", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1726745158, + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 0000000..84e93cb --- /dev/null +++ b/devenv.nix @@ -0,0 +1,18 @@ +{ pkgs, lib, config, inputs, ... }: + +{ + packages = [ pkgs.git ]; + + languages.javascript = { + enable = true; + yarn.enable = true; + }; + + enterShell = '' + git --version + node --version + yarn install + ''; + + pre-commit.hooks.eslint.enable = true; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..116a2ad --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,15 @@ +# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling + +# If you're using non-OSS software, you can set allowUnfree to true. +# allowUnfree: true + +# If you're willing to use a package that's vulnerable +# permittedInsecurePackages: +# - "openssl-1.1.1w" + +# If you have more than one devenv you can merge them +#imports: +# - ./backend From 0ceb07958d575e4bd70704b6593a77885af27592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sadjow=20Le=C3=A3o?= Date: Sat, 21 Sep 2024 10:55:32 -0300 Subject: [PATCH 2/3] fix(readme): split development section into a multi line --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a41fb76..1c167bf 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,9 @@ In the `$utm` array, each entry provides a `timestamp` indicating when the UTM p ## Development -### Devenv, you can take advantage of (devenv.sh)[https://devenv.sh] to quickly create the development environment for this this project. Use it in combination with [direnv](https://direnv.net/) to quickly load all the environment while navigating into the project directory in your shell. +### Devenv + +You can take advantage of (devenv.sh)[https://devenv.sh] to quickly create the development environment for this this project. Use it in combination with [direnv](https://direnv.net/) to quickly load all the environment while navigating into the project directory in your shell. ```bash # Install dependencies From b5f1080cae1685c14a0c253a934cf30b3fabf1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sadjow=20Le=C3=A3o?= Date: Sat, 21 Sep 2024 10:57:08 -0300 Subject: [PATCH 3/3] fix(readme): wrong link format for devenv.sh --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c167bf..2a6a788 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ In the `$utm` array, each entry provides a `timestamp` indicating when the UTM p ### Devenv -You can take advantage of (devenv.sh)[https://devenv.sh] to quickly create the development environment for this this project. Use it in combination with [direnv](https://direnv.net/) to quickly load all the environment while navigating into the project directory in your shell. +You can take advantage of [devenv.sh](https://devenv.sh) to quickly create the development environment for this this project. Use it in combination with [direnv](https://direnv.net/) to quickly load all the environment while navigating into the project directory in your shell. ```bash # Install dependencies