run most containers and back them up at home
* switch backup from wasabi-s3 to btrfs via ssh * add srv0 at home * run webserver and syncthing at home
This commit is contained in:
parent
2a2715d447
commit
406ab7be7e
12 changed files with 330 additions and 123 deletions
93
nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix
Normal file
93
nix/os/devices/srv0.home-ch.stefanjunker.de/system.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ... }:
|
||||
|
||||
let
|
||||
keys = import ../../../variables/keys.nix;
|
||||
|
||||
in {
|
||||
# TASK: new device
|
||||
networking.hostName = "srv0"; # Define your hostname.
|
||||
# networking.domain = "home-ch.stefanjunker.de";
|
||||
|
||||
networking.firewall.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
# iperf3
|
||||
5201
|
||||
];
|
||||
networking.firewall.logRefusedConnections = false;
|
||||
|
||||
networking.usePredictableInterfaceNames = false;
|
||||
networking.dhcpcd = {
|
||||
enable = true;
|
||||
persistent = true;
|
||||
};
|
||||
|
||||
networking.interfaces.eth0 = {
|
||||
useDHCP = true;
|
||||
# ipv6.addresses = [
|
||||
# { address = "2a02:c207:3003:2387::1"; prefixLength = 64; }
|
||||
# ];
|
||||
};
|
||||
|
||||
# networking.defaultGateway6 = {
|
||||
# address = "fe80::1";
|
||||
# interface = "eth0";
|
||||
# };
|
||||
|
||||
networking.nat = {
|
||||
enable = true;
|
||||
internalInterfaces = [ "ve-+" ];
|
||||
externalInterface = "eth0";
|
||||
};
|
||||
|
||||
# Kubernetes
|
||||
# services.kubernetes.roles = ["master" "node"];
|
||||
|
||||
# virtualization
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
};
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
};
|
||||
|
||||
networking.useHostResolvConf = true;
|
||||
|
||||
containers = {
|
||||
webserver = import ../../containers/webserver.nix {
|
||||
hostAddress = "192.168.100.12";
|
||||
localAddress = "192.168.100.13";
|
||||
|
||||
httpsPort = 443;
|
||||
};
|
||||
|
||||
syncthing = import ../../containers/syncthing.nix {
|
||||
hostAddress = "192.168.100.14";
|
||||
localAddress = "192.168.100.15";
|
||||
|
||||
syncthingPort = 22000;
|
||||
};
|
||||
|
||||
backup = import ../../containers/backup.nix {
|
||||
inherit config;
|
||||
hostAddress = "192.168.100.16";
|
||||
localAddress = "192.168.100.17";
|
||||
subvolumes = [
|
||||
"webserver"
|
||||
"backup"
|
||||
"syncthing"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "20.03"; # Did you read the comment?
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue