Browse Source

feat(templates): added devenv template

This adds templates for bootstrapping new development environments.

The primary template will generate the necessary files to quickly set
up a new environment using devenv.sh.

Fixes #5
Zander Hawke 10 months ago
parent
commit
ba0a3c4e2f

+ 7 - 0
flake.nix

@@ -68,5 +68,12 @@
       devenv-up = self.devShells.${system}.default.config.procfileScript;
       devenv-test = self.devShells.${system}.default.config.test;
     } // import ./packages { });
+
+    templates = {
+      devenv = {
+        path = ./templates/devenv;
+        description = "A template for a devenv environment";
+      };
+    };
   };
 }

+ 16 - 0
templates/devenv/.editorconfig

@@ -0,0 +1,16 @@
+root = true
+
+[*]
+indent_size = 2
+indent_style = space
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+max_line_length = 80
+
+[*.md]
+trim_trailing_whitespace = false
+
+[*.rs]
+indent_size = 4

+ 3 - 0
templates/devenv/.envrc

@@ -0,0 +1,3 @@
+export DIRENV_WARN_TIMEOUT=20s
+eval "$(devenv direnvrc)"
+use devenv

+ 9 - 0
templates/devenv/.gitignore

@@ -0,0 +1,9 @@
+# devenv
+.devenv*
+devenv.local.nix
+
+# direnv
+.direnv
+
+# pre-commit
+.pre-commit-config.yaml

+ 1 - 0
templates/devenv/devenv.nix

@@ -0,0 +1 @@
+{ }

+ 15 - 0
templates/devenv/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