nix-config/hosts/franz/arion/default.nix

50 lines
1 KiB
Nix
Raw Normal View History

{
inputs,
pkgs,
config,
...
}: {
imports = [
inputs.arion.nixosModules.arion
./dns
./infrastructure
./nas
./nextcloud
./push
./git
./passwords
./media
2024-03-07 16:57:10 +01:00
./dashboard
2024-03-07 17:03:33 +01:00
./smarthome
2024-03-17 15:18:23 +01:00
./signal
./feed
./matrix
2024-05-01 17:49:03 +02:00
./headscale
2024-05-03 12:19:03 +02:00
./auth
];
environment.systemPackages = with pkgs; [arion];
virtualisation.arion.backend = "docker";
systemd.services.init-dmz-bridge-network = {
description = "Create the network bridge dmz for the Docker stack.";
after = ["network.target"];
wantedBy = ["multi-user.target"];
serviceConfig.Type = "oneshot";
script = let
dockercli = "${config.virtualisation.docker.package}/bin/docker";
in ''
# Put a true at the end to prevent getting non-zero return code, which will
# crash the whole service.
check=$(${dockercli} network ls | grep "dmz" || true)
if [ -z "$check" ]; then
${dockercli} network create dmz
else
echo "dmz already exists in docker"
fi
'';
};
}