Last active
November 4, 2023 08:54
-
-
Save drupol/ae3d6048ad73ef78c5b03bae029fde7c to your computer and use it in GitHub Desktop.
flake.nix using devenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
phps.url = "github:fossar/nix-phps"; | |
devenv.url = "github:cachix/devenv"; | |
systems.url = "github:nix-systems/default"; | |
}; | |
outputs = inputs @ { self, flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { | |
systems = import inputs.systems; | |
imports = [ | |
inputs.devenv.flakeModule | |
]; | |
perSystem = { config, self', inputs', pkgs, system, lib, ... }: { | |
_module.args.pkgs = import self.inputs.nixpkgs { | |
inherit system; | |
overlays = [ | |
inputs.phps.overlays.default | |
]; | |
}; | |
devenv.shells.default = { | |
name = "php-dev-env"; | |
packages = [ | |
pkgs.php82 | |
pkgs.php82.packages.composer | |
]; | |
services = { | |
postgres = { | |
enable = true; | |
package = pkgs.postgresql_15; | |
initialDatabases = [{ name = "mydb"; }]; | |
extensions = extensions: [ | |
extensions.postgis | |
extensions.timescaledb | |
]; | |
settings.shared_preload_libraries = "timescaledb"; | |
initialScript = "CREATE EXTENSION IF NOT EXISTS timescaledb;"; | |
}; | |
}; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment