flake.nix 518 B

123456789101112131415161718192021222324252627
  1. {
  2. description = "Go Development Environment";
  3. inputs = {
  4. nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
  5. };
  6. outputs = { self, nixpkgs }:
  7. let
  8. system = "x86_64-linux";
  9. pkgs = import nixpkgs { inherit system; };
  10. in
  11. {
  12. devShells.${system}.default = pkgs.mkShell {
  13. buildInputs = with pkgs; [
  14. go
  15. gotools
  16. golangci-lint
  17. gopls
  18. ];
  19. shellHook = ''
  20. export GOPATH="$PWD/.nix-go"
  21. '';
  22. };
  23. };
  24. }