chore(flake): dev shell setup via nix flake
This commit is contained in:
37
flake.nix
Normal file
37
flake.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
};
|
||||
outputs = {nixpkgs, ...}: let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
forAllSystems = f:
|
||||
nixpkgs.lib.genAttrs systems (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
in
|
||||
f {
|
||||
inherit (pkgs) lib stdenv;
|
||||
inherit pkgs;
|
||||
});
|
||||
in {
|
||||
devShells = forAllSystems ({pkgs, ...}: {
|
||||
default = pkgs.mkShell {
|
||||
CGO_ENABLED = "0";
|
||||
hardeningDisable = ["all"];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
# Go tools
|
||||
go
|
||||
golangci-lint
|
||||
gofumpt
|
||||
gotools
|
||||
delve
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user