blob: 0c4ebc5d153c1024e75408ae8c9f2692def10214 [file] [log] [blame]
Samuel Shuertf68685d2023-10-28 20:07:56 -04001{ config, nixpkgs-mongodb, system, ... }: let
2 pkgs = import nixpkgs-mongodb {
3 config.allowUnfree = true;
4 inherit system;
5 };
6in {
Skyler Grey4f3e6062023-03-04 01:29:29 +00007 environment.systemPackages = [ pkgs.mongosh pkgs.mongodb-tools ];
Skyler Grey1e2187f2023-03-03 22:45:10 +00008 services.mongodb.enable = true;
9 services.mongodb.enableAuth = true;
Skyler Grey4f3e6062023-03-04 01:29:29 +000010 services.mongodb.bind_ip = "0.0.0.0";
11 services.mongodb.initialRootPassword = "changeme";
Skyler Grey1e2187f2023-03-03 22:45:10 +000012 services.mongodb.package = pkgs.mongodb-6_0;
Skyler Grey629d2bb2023-05-12 00:28:27 +000013
Skyler Greyfe1740c2023-10-21 01:24:18 +000014 networking.firewall.extraCommands =
15 "iptables -A INPUT -s 192.168.0.4 -p tcp --dport 27017 -j ACCEPT";
Skyler Grey1e2187f2023-03-03 22:45:10 +000016}