1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nix-update-script,
6 rustPlatform,
7 which,
8 installShellFiles,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "dotter";
13 version = "0.13.3";
14
15 src = fetchFromGitHub {
16 owner = "SuperCuber";
17 repo = "dotter";
18 rev = "v${version}";
19 hash = "sha256-7YExvmuliTL9oagXNUtZ7ZOPyELcS+igK1tXdhG0kQk=";
20 };
21
22 cargoHash = "sha256-UBZZu8D1fbNOn2obviP+/Qw+E/OoNKRA4NXzqCqghGs=";
23
24 nativeCheckInputs = [
25 which
26 installShellFiles
27 ];
28
29 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
30 installShellCompletion --cmd dotter \
31 --bash <($out/bin/dotter gen-completions --shell bash) \
32 --fish <($out/bin/dotter gen-completions --shell fish) \
33 --zsh <($out/bin/dotter gen-completions --shell zsh)
34 '';
35
36 passthru = {
37 updateScript = nix-update-script { };
38 };
39
40 meta = with lib; {
41 description = "Dotfile manager and templater written in rust 🦀";
42 homepage = "https://github.com/SuperCuber/dotter";
43 license = licenses.unlicense;
44 maintainers = with maintainers; [ linsui ];
45 mainProgram = "dotter";
46 };
47}