diff --git a/flake.nix b/flake.nix index 3cd24c2..aa243d6 100644 --- a/flake.nix +++ b/flake.nix @@ -11,26 +11,42 @@ }; # Flake outputs that other flakes can use - outputs = { self, flake-schemas, nixpkgs }: + outputs = + { + self, + flake-schemas, + nixpkgs, + }: let # Helpers for producing system-specific outputs supportedSystems = [ "x86_64-linux" ]; - forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { - pkgs = import nixpkgs { inherit system; }; - }); - in { + forEachSupportedSystem = + f: + nixpkgs.lib.genAttrs supportedSystems ( + system: + f { + pkgs = import nixpkgs { inherit system; }; + } + ); + in + { # Schemas tell Nix about the structure of your flake's outputs schemas = flake-schemas.schemas; # Development environments - devShells = forEachSupportedSystem ({ pkgs }: { - default = pkgs.mkShell { - # Pinned packages available in the environment - packages = with pkgs; [ - go_1_23 - nixpkgs-fmt - ]; - }; - }); + devShells = forEachSupportedSystem ( + { pkgs }: + { + default = pkgs.mkShell { + # Pinned packages available in the environment + packages = with pkgs; [ + just + gcc + go_1_23 + nixpkgs-fmt + ]; + }; + } + ); }; } diff --git a/justfile b/justfile new file mode 100644 index 0000000..5429c57 --- /dev/null +++ b/justfile @@ -0,0 +1,31 @@ + +# Set the shell +set shell := ["bash", "-cu"] + +# Build the Go project +build: + go build -o bin/app . + +# Run the Go project +run: + go run . + +# Run tests +test: + go test ./... + +# Clean build artifacts +clean: + rm -rf bin + +# Format the code +fmt: + go fmt ./... + +# Tidy up go.mod/go.sum +tidy: + go mod tidy + +# Init Go module (optional first step) +init name: + go mod init {{name}}