"value":"\n <p>I sometimes work on projects that already has an existing environment configuration, usually using a tool like DDEV.<\/p>\n\n<p>Similar to using Nix, DDEV makes environments more consistent by standardising versions of PHP, nodejs, etc for each project.<\/p>\n\n<p>This is great, but how do you know everyone has the same version of DDEV?<\/p>\n\n<p>Different people having different versions of DDEV could introduce its own issues and bugs, such as pulling different images with different default package versions.<\/p>\n\n<h2 id=\"enter-nix\">Enter Nix<\/h2>\n\n<p>The Nix package manager has over 100,000 packages, including DDEV.<\/p>\n\n<p>This means I can install DDEV via Nix and because of the flake.nix file, anyone using the same configuration will get the same version of DDEV.<\/p>\n\n<p>Here's a simple <code>flake.nix<\/code> file to install DDEV:<\/p>\n\n<pre><code class=\"nix\">{\n inputs.nixpkgs.url = \"github:NixOS\/nixpkgs\/nixos-unstable\";\n\n outputs =\n { nixpkgs, ... }:\n let\n system = \"x86_64-linux\";\n pkgs = nixpkgs.legacyPackages.${system};\n in\n {\n devShells.${system}.default = pkgs.mkShell {\n buildInputs = with pkgs; [ ddev ];\n };\n };\n}\n<\/code><\/pre>\n\n<p>This approach also means I can have different versions of DDEV installed at once so I can use different versions for different projects as needed.<\/p>\n\n<p>I also don't need it installed globally, so this only makes it available to the projects that need it.<\/p>\n\n<p>It's a bit meta, but it works.<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>I sometimes work on projects that already has an existing environment configuration, usually using a tool like DDEV.<\/p>\n\n<p>Similar to using Nix, DDEV makes environments more consistent by standardising versions of PHP, nodejs, etc for each project.<\/p>\n\n<p>This is great, but how do you know everyone has the same version of DDEV?<\/p>\n\n<p>Different people having different versions of DDEV could introduce its own issues and bugs, such as pulling different images with different default package versions.<\/p>\n\n<h2 id=\"enter-nix\">Enter Nix<\/h2>\n\n<p>The Nix package manager has over 100,000 packages, including DDEV.<\/p>\n\n<p>This means I can install DDEV via Nix and because of the flake.nix file, anyone using the same configuration will get the same version of DDEV.<\/p>\n\n<p>Here's a simple <code>flake.nix<\/code> file to install DDEV:<\/p>\n\n<pre><code class=\"nix\">{\n inputs.nixpkgs.url = \"github:NixOS\/nixpkgs\/nixos-unstable\";\n\n outputs =\n { nixpkgs, ... }:\n let\n system = \"x86_64-linux\";\n pkgs = nixpkgs.legacyPackages.${system};\n in\n {\n devShells.${system}.default = pkgs.mkShell {\n buildInputs = with pkgs; [ ddev ];\n };\n };\n}\n<\/code><\/pre>\n\n<p>This approach also means I can have different versions of DDEV installed at once so I can use different versions for different projects as needed.<\/p>\n\n<p>I also don't need it installed globally, so this only makes it available to the projects that need it.<\/p>\n\n<p>It's a bit meta, but it works.<\/p>\n\n ",