Skip to content

Commit

Permalink
Add Nix Dev Shell
Browse files Browse the repository at this point in the history
  • Loading branch information
janschill committed Oct 1, 2024
1 parent 594acf9 commit b00550f
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ coverage.*
cover.out
bin/
*.db
.direnv
.envrc
.vscode/
12 changes: 6 additions & 6 deletions cmd/db/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ func main() {
}

switch operation {
case "create":
case "create-db":
db.CreateTables(dbPath)
case "reset":
case "reset-db":
// db.ResetDB(dbPath)
case "destroy":
case "destroy-db":
db.DestroyDB(dbPath)
case "seed":
case "seed-db":
db.Seed(dbPath)
case "clear":
case "clear-db":
db.Clear(dbPath)
case "aggregate":
case "aggregate-db":
fmt.Println("TODO: not supported")
return
// if day == "" {
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
description = "Flake for the track-me project";

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
{
devShell = pkgs.mkShell {
name = "track-me-dev-shell";

buildInputs = [
pkgs.go
pkgs.sqlite
];

shellHook = ''
export GOBIN="$PWD/bin"
export PATH="$GOBIN:$PATH"
echo "Development environment for track-me is ready!"
'';
};
}
);
}

0 comments on commit b00550f

Please sign in to comment.