demo nixos-containers
This commit is contained in:
parent
592537fb63
commit
ee41777c7e
5 changed files with 62 additions and 16 deletions
30
nixos/hosts/olympus/bastion/containers/default.nix
Normal file
30
nixos/hosts/olympus/bastion/containers/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ lib, ... }: {
|
||||
# TODO: Loop over subdirs, create nixos container for each
|
||||
networking.nat = {
|
||||
enable = true;
|
||||
internalInterfaces = [ "ve-+" ];
|
||||
externalInterface = "ens18";
|
||||
# Lazy IPv6 connectivity for the container
|
||||
enableIPv6 = true;
|
||||
};
|
||||
|
||||
# Containers network is
|
||||
# * 10.42.99.0/24
|
||||
# * fc00:x
|
||||
|
||||
containers.monitoring = {
|
||||
autoStart = true;
|
||||
privateNetwork = true;
|
||||
hostAddress = "10.42.99.1";
|
||||
localAddress = "10.42.99.2";
|
||||
hostAddress6 = "fc00::1";
|
||||
localAddress6 = "fc00::2";
|
||||
|
||||
config = {
|
||||
imports = [ ./monitoring ];
|
||||
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
|
||||
networking.useHostResolvConf = lib.mkForce false;
|
||||
services.resolved.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./grafana.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{ config, pkgs, ... }: {
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
domain = "grafana.olympus";
|
||||
port = 80;
|
||||
addr = "0.0.0.0";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ config.services.grafana.port ];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue