diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d15e243 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/flake.lock +/go.sum diff --git a/README.md b/README.md index 5b5c97c..346b7f8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ # Potion: Recipe Sharing Platform - diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5da46ef --- /dev/null +++ b/flake.nix @@ -0,0 +1,46 @@ +{ + description = "Go development flake. Adjust as needed."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + # Define the development shell. + # When you run `nix develop` (or direnv activates), you'll enter this shell. + devShells.default = pkgs.mkShell { + # List all the development tools you need available in this shell's PATH. + packages = with pkgs; [ + go + gopls + go-tools + htmx-lsp2 + templ + ]; + + # Define the shell that will be executed. + # Here, we explicitly use zsh. + # Note: pkgs.zsh needs to be included in `packages` or `nativeBuildInputs` + # for it to be found in the shell's environment. `inherit pkgs.zsh;` is concise. + inherit (pkgs) zsh; + + # Environment variables and commands to run when the shell starts. + shellHook = '' + # Use the .local directory instead of home + export GOPATH="$HOME/.local/go" + echo "Settings GOPATH to: $HOME/.local/go " + + # Exec zsh to replace the current shell process with zsh. + # This ensures your prompt and zsh configurations load correctly. + exec zsh + ''; + }; + } + ); +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ede9520 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/haydenhargreaves/Potion + +go 1.24.3 + +require github.com/a-h/templ v0.3.898 // indirect