nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 versionCheckHook,
8 writableTmpDirAsHomeHook,
9}:
10
11buildGoModule rec {
12 pname = "ddev";
13 version = "1.24.10";
14
15 src = fetchFromGitHub {
16 owner = "ddev";
17 repo = "ddev";
18 rev = "v${version}";
19 hash = "sha256-ijYkTVVuNLsG8+L4g1sWAJCSh/3MaoeirItLjcIg150=";
20 };
21
22 nativeBuildInputs = [
23 installShellFiles
24 ];
25
26 vendorHash = null;
27
28 ldflags = [
29 "-extldflags -static"
30 "-X github.com/ddev/ddev/pkg/versionconstants.DdevVersion=v${version}"
31 "-X github.com/ddev/ddev/pkg/versionconstants.SegmentKey=v${version}"
32 ];
33
34 # Tests need docker.
35 doCheck = false;
36
37 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
38 # DDEV will try to create $HOME/.ddev, so we set $HOME to a temporary
39 # directory.
40 export HOME=$(mktemp -d)
41 $out/bin/ddev_gen_autocomplete
42 installShellCompletion --cmd ddev \
43 --bash .gotmp/bin/completions/ddev_bash_completion.sh \
44 --fish .gotmp/bin/completions/ddev_fish_completion.sh \
45 --zsh .gotmp/bin/completions/ddev_zsh_completion.sh
46 '';
47
48 doInstallCheck = true;
49 nativeInstallCheckInputs = [
50 versionCheckHook
51 writableTmpDirAsHomeHook
52 ];
53 versionCheckKeepEnvironment = [ "HOME" ];
54
55 meta = {
56 description = "Docker-based local PHP+Node.js web development environments";
57 homepage = "https://ddev.com/";
58 license = lib.licenses.asl20;
59 platforms = lib.platforms.unix;
60 mainProgram = "ddev";
61 maintainers = with lib.maintainers; [ remyvv ];
62 };
63}