Home

gomodinit @c72f0a08b102ede3857775c4e761f452a2772b26 - 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
40
41
{
  description = "go mod init";
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

  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
        ];
      };
    };
}