Skip to content

Commit

Permalink
Merge pull request #25 from omc/nz/flake
Browse files Browse the repository at this point in the history
nix devshell and direnv
  • Loading branch information
nz authored May 13, 2024
2 parents 59b7bb9 + ed70ae6 commit 8aaffe3
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@ fabric.properties
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
.idea/caches/build_file_checksums.ser

# Direnv
.direnv
26 changes: 26 additions & 0 deletions flake.lock

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

39 changes: 39 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
description = "Development environment for Bonsai API Go client.";

inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
};

outputs = {
self,
nixpkgs,
...
}: let
allSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];

forAllSystems = f:
nixpkgs.lib.genAttrs allSystems (system:
f {
pkgs = import nixpkgs {inherit system;};
inherit system;
});
in {
devShells = forAllSystems ({pkgs, ...}: {
default = pkgs.mkShell {
packages = with pkgs; [
go_1_22
gotools
pre-commit
go-licenses
golangci-lint
];
};
});
};
}

0 comments on commit 8aaffe3

Please sign in to comment.