added just file for convenience
This commit is contained in:
parent
1957733d3c
commit
48c9ea8a03
2 changed files with 61 additions and 14 deletions
28
flake.nix
28
flake.nix
|
|
@ -11,26 +11,42 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# Flake outputs that other flakes can use
|
# Flake outputs that other flakes can use
|
||||||
outputs = { self, flake-schemas, nixpkgs }:
|
outputs =
|
||||||
|
{
|
||||||
|
self,
|
||||||
|
flake-schemas,
|
||||||
|
nixpkgs,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
# Helpers for producing system-specific outputs
|
# Helpers for producing system-specific outputs
|
||||||
supportedSystems = [ "x86_64-linux" ];
|
supportedSystems = [ "x86_64-linux" ];
|
||||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
forEachSupportedSystem =
|
||||||
|
f:
|
||||||
|
nixpkgs.lib.genAttrs supportedSystems (
|
||||||
|
system:
|
||||||
|
f {
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
});
|
}
|
||||||
in {
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
# Schemas tell Nix about the structure of your flake's outputs
|
# Schemas tell Nix about the structure of your flake's outputs
|
||||||
schemas = flake-schemas.schemas;
|
schemas = flake-schemas.schemas;
|
||||||
|
|
||||||
# Development environments
|
# Development environments
|
||||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
devShells = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
# Pinned packages available in the environment
|
# Pinned packages available in the environment
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
just
|
||||||
|
gcc
|
||||||
go_1_23
|
go_1_23
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
31
justfile
Normal file
31
justfile
Normal 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}}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue