Last active
February 21, 2025 23:10
-
-
Save codyjroberts/4f578cafd67e1932eca6a3d95423eba9 to your computer and use it in GitHub Desktop.
simple ruby devenv w/ postgres and redis
This file contains hidden or 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
| export DIRENV_WARN_TIMEOUT=20s | |
| eval "$(devenv direnvrc)" | |
| use devenv | |
| # source local env vars | |
| source_env_if_exists .envrc.default | |
| source_env_if_exists .envrc.local |
This file contains hidden or 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
| # devenv | |
| .devenv* | |
| devenv.local.nix | |
| # direnv | |
| .direnv | |
| .envrc.local |
This file contains hidden or 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
| { pkgs, lib, config, inputs, ... }: | |
| let | |
| pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; }; | |
| in | |
| { | |
| packages = [ | |
| pkgs-unstable.pgcli | |
| ] ++ lib.optionals pkgs.stdenv.isDarwin [ | |
| pkgs.darwin.apple_sdk.frameworks.CoreFoundation | |
| pkgs.darwin.apple_sdk.frameworks.Security | |
| pkgs.darwin.apple_sdk.frameworks.SystemConfiguration | |
| ]; | |
| languages.ruby.enable = true; | |
| languages.ruby.package = pkgs.ruby_3_1; | |
| languages.ruby.bundler.enable = true; | |
| services.postgres = { | |
| enable = true; | |
| package = pkgs.postgresql_16; | |
| initialScript = "create user postgres superuser login;"; | |
| listen_addresses = "localhost"; | |
| extensions = extensions: [ | |
| extensions.pgtap | |
| ]; | |
| port = 5432; | |
| }; | |
| services.redis = { | |
| enable = true; | |
| port = 6379; | |
| }; | |
| } |
This file contains hidden or 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:cachix/devenv-nixpkgs/rolling | |
| nixpkgs-unstable: | |
| url: github:nixos/nixpkgs/nixpkgs-unstable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment