Samuel Shuert | f68685d | 2023-10-28 20:07:56 -0400 | [diff] [blame] | 1 | { config, nixpkgs-mongodb, system, ... }: let |
| 2 | pkgs = import nixpkgs-mongodb { |
| 3 | config.allowUnfree = true; |
| 4 | inherit system; |
| 5 | }; |
| 6 | in { |
Skyler Grey | 4f3e606 | 2023-03-04 01:29:29 +0000 | [diff] [blame] | 7 | environment.systemPackages = [ pkgs.mongosh pkgs.mongodb-tools ]; |
Skyler Grey | 1e2187f | 2023-03-03 22:45:10 +0000 | [diff] [blame] | 8 | services.mongodb.enable = true; |
| 9 | services.mongodb.enableAuth = true; |
Skyler Grey | 4f3e606 | 2023-03-04 01:29:29 +0000 | [diff] [blame] | 10 | services.mongodb.bind_ip = "0.0.0.0"; |
| 11 | services.mongodb.initialRootPassword = "changeme"; |
Skyler Grey | 1e2187f | 2023-03-03 22:45:10 +0000 | [diff] [blame] | 12 | services.mongodb.package = pkgs.mongodb-6_0; |
Skyler Grey | 629d2bb | 2023-05-12 00:28:27 +0000 | [diff] [blame] | 13 | |
Skyler Grey | fe1740c | 2023-10-21 01:24:18 +0000 | [diff] [blame] | 14 | networking.firewall.extraCommands = |
| 15 | "iptables -A INPUT -s 192.168.0.4 -p tcp --dport 27017 -j ACCEPT"; |
Skyler Grey | 1e2187f | 2023-03-03 22:45:10 +0000 | [diff] [blame] | 16 | } |