nixpkgs/pkgs/tools/misc/chezmoi/default.nix
2024-01-14 10:10:10 +08:00

45 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
buildGoModule rec {
pname = "chezmoi";
version = "2.45.0";
src = fetchFromGitHub {
owner = "twpayne";
repo = "chezmoi";
rev = "v${version}";
hash = "sha256-h17qbuicwYo2/ygJbhJbLqdcFWgZO/Sz8WQC/Addasc=";
};
vendorHash = "sha256-NqCNP+oG8+x6vYaV9bDfn8+Q1nbxV3L3vs8L4iYgypU=";
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; [ jhillyerd ];
mainProgram = "chezmoi";
};
}