added just file for convenience

This commit is contained in:
Jermeiah S 2025-06-27 15:11:38 -04:00
parent 1957733d3c
commit 48c9ea8a03
No known key found for this signature in database
2 changed files with 61 additions and 14 deletions

View file

@ -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
];
};
}
);
};
}

31
justfile Normal file
View file

@ -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}}