containers: add wordpress

This is the start of my fun attempt at using NixOS containers for web
services as a Docker replacement.

After spending some time on other servers I realized that I don't
actually *need* my dotfiles on those servers, so it becomes
significantly faster to build these containers without worrying about
home-manager and command-line programs I use on the host.

Main advantages include web service configuration with Nix instead of
Docker. Disadvantages include increased complexity for anything that
isn't already maintained by others in nixpkgs.
This commit is contained in:
Donovan Glover 2024-10-11 16:28:15 -04:00
parent 0238abd1e5
commit 043e901711
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 48 additions and 0 deletions

33
containers/wordpress.nix Normal file
View File

@ -0,0 +1,33 @@
{
nix-config,
pkgs,
...
}:
{
imports = with nix-config.nixosModules; [
system
];
users.defaultUserShell = pkgs.fish;
programs = {
fish.enable = true;
neovim.enable = true;
};
environment = {
systemPackages = with pkgs; [ kitty ];
shells = with pkgs; [ fish ];
variables = {
TERM = "xterm-kitty";
};
};
networking = {
firewall.allowedTCPPorts = [ 80 ];
};
services.wordpress.sites.localhost = { };
}

View File

@ -64,5 +64,20 @@ in
localAddress = "192.168.100.49";
config = ../containers/wine.nix;
};
wordpress = {
privateNetwork = true;
ephemeral = true;
autoStart = true;
hostAddress = "192.168.100.24";
localAddress = "192.168.100.39";
specialArgs = {
inherit nix-config;
};
config = ../containers/wordpress.nix;
};
};
}