nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 python3,
6 installShellFiles,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 version = "2.2";
11 pname = "ddgr";
12
13 src = fetchFromGitHub {
14 owner = "jarun";
15 repo = "ddgr";
16 rev = "v${finalAttrs.version}";
17 sha256 = "sha256-88cCQm3eViy0OwSyCTlnW7uuiFwz2/6Wz45QzxCgXxg=";
18 };
19
20 nativeBuildInputs = [ installShellFiles ];
21
22 buildInputs = [ python3 ];
23
24 makeFlags = [ "PREFIX=$(out)" ];
25
26 postInstall = ''
27 installShellCompletion --bash --name ddgr.bash auto-completion/bash/ddgr-completion.bash
28 installShellCompletion --fish auto-completion/fish/ddgr.fish
29 installShellCompletion --zsh auto-completion/zsh/_ddgr
30 '';
31
32 meta = {
33 homepage = "https://github.com/jarun/ddgr";
34 description = "Search DuckDuckGo from the terminal";
35 license = lib.licenses.gpl3;
36 maintainers = with lib.maintainers; [
37 ceedubs
38 markus1189
39 ];
40 platforms = python3.meta.platforms;
41 mainProgram = "ddgr";
42 };
43})