mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-26 04:22:05 +02:00
build: update flake.nix, taskfile
This commit is contained in:
parent
b33f14c0fa
commit
87e7cc3647
17
Taskfile.yml
17
Taskfile.yml
@ -64,6 +64,23 @@ tasks:
|
||||
cmds:
|
||||
- task: ci
|
||||
|
||||
nix:flake:build:
|
||||
desc: build goreleaser using the nix flake
|
||||
cmds:
|
||||
- task: nix:flake:update-vendor
|
||||
- nix build .
|
||||
|
||||
nix:flake:update-vendor:
|
||||
desc: update default flake package vendor hash
|
||||
cmds:
|
||||
- bash ./scripts/nix-udpate-flake.sh
|
||||
generates:
|
||||
- flake.nix
|
||||
sources:
|
||||
- flake.lock
|
||||
- go.mod
|
||||
- go.sum
|
||||
|
||||
nix:licenses:generate:
|
||||
desc: Generate nix/licenses.go
|
||||
cmds:
|
||||
|
6
flake.lock
generated
6
flake.lock
generated
@ -20,11 +20,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1703438236,
|
||||
"narHash": "sha256-aqVBq1u09yFhL7bj1/xyUeJjzr92fXVvQSSEx6AdB1M=",
|
||||
"lastModified": 1707689078,
|
||||
"narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5f64a12a728902226210bf01d25ec6cbb9d9265b",
|
||||
"rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
11
flake.nix
11
flake.nix
@ -17,31 +17,32 @@
|
||||
src = ./.;
|
||||
ldflags = [ "-s" "-w" "-X main.version=dev" "-X main.builtBy=flake" ];
|
||||
doCheck = false;
|
||||
vendorHash = "sha256-wY3kIhNIqTaK9MT1VeePERNhqvbtf6bsyRTjG8nrqxU=";
|
||||
vendorHash = "sha256-2CoQuiv8lVjdNJwwuX/rezoHRaMph0AsptLAudztqF8=";
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
go
|
||||
go_1_22
|
||||
go-task
|
||||
gofumpt
|
||||
syft
|
||||
upx
|
||||
cosign
|
||||
gnupg
|
||||
nix-prefetch
|
||||
];
|
||||
shellHook = "go mod tidy";
|
||||
};
|
||||
|
||||
devShells.docs = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; with staging-pkgs.python311Packages; [
|
||||
packages = with pkgs; with pkgs.python311Packages; [
|
||||
go-task
|
||||
htmltest
|
||||
mkdocs-material
|
||||
mkdocs-redirects
|
||||
mkdocs-minify
|
||||
mkdocs-rss-plugin
|
||||
mkdocs-include-markdown-plugin
|
||||
staging-pkgs.pkgs.python311Packages.mkdocs-rss-plugin # https://github.com/NixOS/nixpkgs/pull/277350
|
||||
staging-pkgs.pkgs.python311Packages.mkdocs-include-markdown-plugin # https://github.com/NixOS/nixpkgs/pull/277351
|
||||
] ++ mkdocs-material.passthru.optional-dependencies.git;
|
||||
};
|
||||
}
|
||||
|
6
scripts/nix-udpate-flake.sh
Executable file
6
scripts/nix-udpate-flake.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
NEW_HASH="$(nix-prefetch \
|
||||
--option extra-experimental-features flakes \
|
||||
'{ sha256 }: (builtins.getFlake (toString ./.)).packages.x86_64-linux.default.goModules.overrideAttrs (_: { vendorSha256 = sha256; })')"
|
||||
|
||||
sed -i "s|vendorHash = \".*\"|vendorHash = \"${NEW_HASH}\"|" ./flake.nix
|
Loading…
x
Reference in New Issue
Block a user