Create template for direnv
nix-direnv's template is good, but it isn't quite perfect, particularly
- starting with pkgs.bashInteractive which we do not care about
- not being in this repository so none of our custom registry entries
allow us to do templates#direnv
- there's no gitignore
- there's no formatter
Change-Id: Ia2d170624cc0eda2208cb39bd7c14046ca146492
Reviewed-on: https://git.clicks.codes/c/Templates/+/416
diff --git a/direnv/.envrc b/direnv/.envrc
new file mode 100644
index 0000000..7fd05db
--- /dev/null
+++ b/direnv/.envrc
@@ -0,0 +1,4 @@
+if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
+ source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
+fi
+use flake
diff --git a/direnv/.gitignore b/direnv/.gitignore
new file mode 100644
index 0000000..9b42106
--- /dev/null
+++ b/direnv/.gitignore
@@ -0,0 +1 @@
+.direnv/
diff --git a/direnv/flake.nix b/direnv/flake.nix
new file mode 100644
index 0000000..5989b0f
--- /dev/null
+++ b/direnv/flake.nix
@@ -0,0 +1,17 @@
+{
+ description = "A Clicks project";
+ inputs.flake-utils.url = "github:numtide/flake-utils";
+
+ outputs =
+ { nixpkgs, flake-utils, ... }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in
+ {
+ devShells.default = pkgs.mkShell { packages = [ ]; };
+ formatter = pkgs.nixfmt;
+ }
+ );
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..bdad079
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,15 @@
+{
+ description = "All the clicks flake templates";
+
+ outputs =
+ { self }:
+ {
+ templates = {
+ default = self.templates.direnv;
+ direnv = {
+ path = ./direnv;
+ description = "A basic nix-direnv flake with nothing. Welcome to Clicks <3";
+ };
+ };
+ };
+}