/go-flake

Various tools used for Go development

Primary LanguageNixMIT LicenseMIT

Nix flake for various Go tools

built with nix

Usage

{
  description = "Your go package";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
    gopkgs.url = "github:sagikazarmark/go-flake";
    gopkgs.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { self, nixpkgs, flake-utils, gopkgs, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in {
        devShell = pkgs.mkShell {
          buildInputs = [ pkgs.go gopkgs.mga ];
        };
      });
}

Or using overlay:

{
  description = "Your go package";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
    gopkgs.url = "github:sagikazarmark/go-flake";
    gopkgs.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { self, nixpkgs, flake-utils, gopkgs, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;

          overlays = [ gopkgs.overlay ];
        };
      in {
        devShell = pkgs.mkShell {
          buildInputs = [ pkgs.go pkgs.mga ];
        };
      });
}

License

The project is licensed under the MIT License.