chezmoi: refactor and adopt

- get rid of rec
This commit is contained in:
Anderson Torres 2024-04-26 22:14:33 -03:00
parent 18e5fe0e79
commit d2f0ed6113
1 changed files with 49 additions and 40 deletions

View File

@ -1,44 +1,53 @@
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "chezmoi";
version = "2.47.4";
let
argset = {
pname = "chezmoi";
version = "2.47.4";
src = fetchFromGitHub {
owner = "twpayne";
repo = "chezmoi";
rev = "v${version}";
hash = "sha256-clhW/Y+OJ7iQVK8I2xwoVT9rXF2CXRBaUxDZrREAjYc=";
src = fetchFromGitHub {
owner = "twpayne";
repo = "chezmoi";
rev = "v${argset.version}";
hash = "sha256-clhW/Y+OJ7iQVK8I2xwoVT9rXF2CXRBaUxDZrREAjYc=";
};
vendorHash = "sha256-8Puy1IKLMENduWyOAJtvpd7FV1a0IdmkMYztIJdeaBs=";
nativeBuildInputs = [
installShellFiles
];
ldflags = [
"-s"
"-w"
"-X main.version=${argset.version}"
"-X main.builtBy=nixpkgs"
];
doCheck = false;
postInstall = ''
installShellCompletion --bash --name chezmoi.bash completions/chezmoi-completion.bash
installShellCompletion --fish completions/chezmoi.fish
installShellCompletion --zsh completions/chezmoi.zsh
'';
subPackages = [ "." ];
meta = {
homepage = "https://www.chezmoi.io/";
description = "Manage your dotfiles across multiple machines, securely";
changelog = "https://github.com/twpayne/chezmoi/releases/tag/${argset.src.rev}";
license = lib.licenses.mit;
mainProgram = "chezmoi";
maintainers = with lib.maintainers; [ AndersonTorres ];
};
};
vendorHash = "sha256-8Puy1IKLMENduWyOAJtvpd7FV1a0IdmkMYztIJdeaBs=";
doCheck = false;
ldflags = [
"-s" "-w" "-X main.version=${version}" "-X main.builtBy=nixpkgs"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --bash --name chezmoi.bash completions/chezmoi-completion.bash
installShellCompletion --fish completions/chezmoi.fish
installShellCompletion --zsh completions/chezmoi.zsh
'';
subPackages = [ "." ];
meta = with lib; {
homepage = "https://www.chezmoi.io/";
description = "Manage your dotfiles across multiple machines, securely";
changelog = "https://github.com/twpayne/chezmoi/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ ];
mainProgram = "chezmoi";
};
}
in
buildGoModule argset