nixpkgs/pkgs/by-name/ch/chezmoi/package.nix
2024-11-01 19:54:58 +00:00

54 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
let
argset = {
pname = "chezmoi";
version = "2.53.1";
src = fetchFromGitHub {
owner = "twpayne";
repo = "chezmoi";
rev = "v${argset.version}";
hash = "sha256-E7kr2fKBabbFVmtVRjgYy5TWhvQYb/RjhiNEcXYXL0E=";
};
vendorHash = "sha256-wOdDG/J/JYGNUGSUCPVCNtO+5TFkt5O5kFYniQgcN7A=";
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 ];
};
};
in
buildGoModule argset