mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 01:24:47 +00:00
chezmoi: refactor and adopt
- get rid of rec
This commit is contained in:
parent
18e5fe0e79
commit
d2f0ed6113
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user