From 5c5e2096b8680ac73dffe675313de9b5ac943c31 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 11 Sep 2024 13:51:46 +0200 Subject: [PATCH] added support for devenv --- .envrc | 3 ++ .gitignore | 9 ++++ README.md | 8 ++++ devenv.lock | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++ devenv.nix | 24 +++++++++++ devenv.yaml | 14 ++++++ 6 files changed, 180 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 8aa79ca..0a1e3b2 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,12 @@ extract_otp_secrets.build/ extract_otp_secrets.dist/ extract_otp_secrets.onefile-build/ extract_otp_secrets.bin +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/README.md b/README.md index 5cc7321..aea74f6 100644 --- a/README.md +++ b/README.md @@ -525,6 +525,14 @@ Install [devbox](https://github.com/jetpack-io/devbox), which is a wrapper for n devbox shell ``` +### devbox + +Install [devbox](https://devenv.sh), which is a wrapper for nix. Then enter the environment with Python and the packages installed with: + +``` +devenv shell +``` + ### docker Install [Docker](https://docs.docker.com/get-docker/). diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..8fbbf03 --- /dev/null +++ b/devenv.lock @@ -0,0 +1,122 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1726050924, + "owner": "cachix", + "repo": "devenv", + "rev": "cf471f691c3765ed431199f61b8bd70530bc4305", + "treeHash": "04a5d566820f8fb1955c7c49ccbd3ff95d9129d7", + "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", + "treeHash": "2addb7b71a20a25ea74feeaf5c2f6a6b30898ecb", + "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", + "treeHash": "ca14199cabdfe1a06a7b1654c76ed49100a689f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716977621, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "4267e705586473d3e5c8d50299e71503f16a6fb6", + "treeHash": "6d9f1f7ca0faf1bc2eeb397c78a49623260d3412", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1725826545, + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9", + "treeHash": "8fc49deaed3f2728a7147c38163cc468a117570a", + "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": 1725513492, + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "7570de7b9b504cfe92025dd1be797bf546f66528", + "treeHash": "4b46d77870afecd8f642541cb4f4927326343b59", + "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..8710703 --- /dev/null +++ b/devenv.nix @@ -0,0 +1,24 @@ +{ + pkgs, + lib, + config, + inputs, + ... +}: + +{ + cachix.enable = false; + + languages.python = { + enable = true; + venv = { + enable = true; + requirements = ./requirements.txt; + }; + }; + + packages = [ + pkgs.git + pkgs.zbar + ]; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..2457af5 --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,14 @@ +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