Skip to content

Commit

Permalink
chore(devtools): update gomod2nix
Browse files Browse the repository at this point in the history
  • Loading branch information
SKalt committed Jun 22, 2024
1 parent 2351d14 commit 73ddab7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 55 deletions.
7 changes: 2 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
# before:
# hooks:
# - go mod download
# GoReleaser config documentation at http://goreleaser.com

builds:
- env:
- CGO_ENABLED=0 # don't link against any C headers
Expand Down
9 changes: 5 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
(import "${fetchTree gomod2nix.locked}/overlay.nix")
];
}
),
version,
rev,
)
, version
, rev
,
}:

pkgs.buildGoApplication {
Expand All @@ -19,5 +20,5 @@ pkgs.buildGoApplication {
pwd = ./.;
src = ./.;
modules = ./gomod2nix.toml;
ldflags = ["-X" "main.version=${version}"];
ldflags = [ "-X" "main.version=${version}" ];
}
55 changes: 12 additions & 43 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
gomod2nix = {
url = "github:tweag/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "flake-utils";
inputs.flake-utils.follows = "flake-utils";
};
};

Expand All @@ -19,15 +19,16 @@
version = (builtins.fromJSON (builtins.readFile ./package.json)).version;
rev = if (self ? rev) then self.rev else "dirty";

in {
in
{
packages.default = pkgs.callPackage ./. { inherit version; inherit rev; };
devShell = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
go # 1.20.x
];
buildInputs = with pkgs; [
nixpkgs-fmt
rnix-lsp
nil
gopls
gotools
libfaketime
Expand Down

0 comments on commit 73ddab7

Please sign in to comment.