summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2023-05-05 17:17:23 +0200
committerMike Vink <mike1994vink@gmail.com>2023-05-05 17:17:34 +0200
commit07b55a27482338dca43b7fd8711ac5e5104b819d (patch)
treebf35174170cef92da2f0cc5d076f2a4320d645f7
parentce2fcdfcc53cb354377f678219801f4b1ad3023b (diff)
add go template
-rw-r--r--flake.nix4
-rw-r--r--home.nix1
-rw-r--r--templates/go/.envrc4
-rw-r--r--templates/go/flake.nix34
4 files changed, 43 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index d701b63..2bee698 100644
--- a/flake.nix
+++ b/flake.nix
@@ -66,6 +66,10 @@
path = ./templates/ansible;
description = "Flake with ansible and shellhook to login to awx";
};
+ go = {
+ path = ./templates/go;
+ description = "Flake with go, gotools, and gofumpt";
+ };
};
};
}
diff --git a/home.nix b/home.nix
index c8530cb..29a38fb 100644
--- a/home.nix
+++ b/home.nix
@@ -51,6 +51,7 @@
mM = "xrandr --output eDP1 --auto --output HDMI1 --off";
newflake = "nix flake new -t ~/flake ";
ansible-flake = "nix flake new -t ~/flake#ansible ";
+ go-flake = "nix flake new -t ~/flake#go ";
lock-pass = "gpgconf --kill gpg-agent";
};
};
diff --git a/templates/go/.envrc b/templates/go/.envrc
new file mode 100644
index 0000000..1305de8
--- /dev/null
+++ b/templates/go/.envrc
@@ -0,0 +1,4 @@
+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="
+fi
+use flake
diff --git a/templates/go/flake.nix b/templates/go/flake.nix
new file mode 100644
index 0000000..b41da36
--- /dev/null
+++ b/templates/go/flake.nix
@@ -0,0 +1,34 @@
+{
+ inputs = {
+ nixpkgs.url = "nixpkgs";
+ nix-filter.url = "github:numtide/nix-filter";
+ flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs-terraform-providers-bin.url = "github:nix-community/nixpkgs-terraform-providers-bin";
+ nixpkgs-terraform-providers-bin.inputs.nixpkgs.follows = "nixpkgs";
+ poetry2nix = {
+ url = "github:nix-community/poetry2nix";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+ outputs = {
+ self,
+ flake-utils,
+ ...
+ } @ inputs:
+ flake-utils.lib.eachDefaultSystem (system: let
+ pkgs =
+ import inputs.nixpkgs
+ {
+ inherit system;
+ };
+ in {
+ devShells.default = pkgs.mkShell {
+ name = "dev";
+ buildInputs = with pkgs; [
+ go
+ gotools
+ gofumpt
+ ];
+ };
+ });
+}