Home

gomodinit @14884cafd8d4267777b40a3c13e3973ec9a81cf2 - refs - log -
-
https://git.jolheiser.com/gomodinit.git
go mod init
gomodinit / flake.nix
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  description = "go mod init";

  inputs.nixpkgs.url = "github:nixos/nixpkgs";

  outputs = {
    self,
    nixpkgs,
  }: let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};
  in {
    packages.${system}.default = pkgs.buildGoModule rec {
      pname = "gomodinit";
      version = self.rev or "dev";
      src = ./.;
      vendorHash = nixpkgs.lib.fileContents ./go.mod.sri;
      ldflags = [
        "-s"
        "-w"
        "-X=main.Version=${version}"
      ];

      meta = with pkgs.lib; {
        description = "go mod init";
        homepage = "https://git.jolheiser.com/gomodinit";
        maintainers = with maintainers; [jolheiser];
        mainProgram = "gomodinit";
      };
    };

    devShells.${system}.default = pkgs.mkShell {
      nativeBuildInputs = with pkgs; [
        go
        gopls
      ];
    };
  };
}