feat: introduce treefmt and fmt all
This commit is contained in:
parent
80250b0179
commit
27c6c4f9fa
237 changed files with 5440 additions and 5214 deletions
|
@ -6,29 +6,29 @@
|
|||
nodeFlake,
|
||||
nodeName,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
hostBridgeAddress = "192.168.101.1";
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../snippets/systemd-resolved.nix
|
||||
{
|
||||
# make sure it uses the DNS that comes in via DHCP
|
||||
networking.nameservers = lib.mkForce [];
|
||||
networking.nameservers = lib.mkForce [ ];
|
||||
services.resolved.enable = true;
|
||||
|
||||
# provide DNS to the containers
|
||||
services.resolved.extraConfig = ''
|
||||
DNSStubListenerExtra=${hostBridgeAddress}
|
||||
'';
|
||||
networking.firewall.interfaces.br0.allowedTCPPorts = [53];
|
||||
networking.firewall.interfaces.br0.allowedUDPPorts = [53];
|
||||
networking.firewall.interfaces.br0.allowedTCPPorts = [ 53 ];
|
||||
networking.firewall.interfaces.br0.allowedUDPPorts = [ 53 ];
|
||||
}
|
||||
];
|
||||
|
||||
programs.wireshark.enable = true;
|
||||
environment.systemPackages = [
|
||||
pkgs.dnsutils
|
||||
];
|
||||
environment.systemPackages = [ pkgs.dnsutils ];
|
||||
|
||||
networking.firewall.enable = true;
|
||||
networking.nftables.enable = true;
|
||||
|
@ -48,13 +48,13 @@ in {
|
|||
|
||||
networking.nat = {
|
||||
enable = true;
|
||||
internalInterfaces = ["br0"];
|
||||
internalInterfaces = [ "br0" ];
|
||||
externalInterface = "dmz0";
|
||||
};
|
||||
|
||||
networking.bridges = {
|
||||
br0 = {
|
||||
interfaces = [];
|
||||
interfaces = [ ];
|
||||
};
|
||||
};
|
||||
networking.interfaces = {
|
||||
|
@ -89,9 +89,7 @@ in {
|
|||
networkConfig.LinkLocalAddressing = "no";
|
||||
|
||||
# TODO: i'm not sure if and if so why this is required
|
||||
macvlan = [
|
||||
"dmz0"
|
||||
];
|
||||
macvlan = [ "dmz0" ];
|
||||
|
||||
DHCP = "no";
|
||||
};
|
||||
|
@ -111,45 +109,49 @@ in {
|
|||
};
|
||||
|
||||
# virtualization
|
||||
virtualisation = {docker.enable = false;};
|
||||
virtualisation = {
|
||||
docker.enable = false;
|
||||
};
|
||||
|
||||
nix.gc = {automatic = true;};
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
};
|
||||
|
||||
sops.secrets.restic-password.sopsFile = ../../../../secrets/${nodeName}/secrets.yaml;
|
||||
|
||||
# adapted from https://github.com/lilyinstarlight/foosteros/blob/5c75ded111878970fd4f600c7adc013f971d5e71/config/restic.nix
|
||||
services.restic.backups.${nodeName} = let
|
||||
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
|
||||
in {
|
||||
initialize = true;
|
||||
repository = "sftp://u217879-sub3@u217879-sub3.your-storagebox.de:23/restic/${nodeName}";
|
||||
services.restic.backups.${nodeName} =
|
||||
let
|
||||
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
|
||||
in
|
||||
{
|
||||
initialize = true;
|
||||
repository = "sftp://u217879-sub3@u217879-sub3.your-storagebox.de:23/restic/${nodeName}";
|
||||
|
||||
paths = [
|
||||
"/backup"
|
||||
];
|
||||
paths = [ "/backup" ];
|
||||
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 2"
|
||||
];
|
||||
pruneOpts = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 2"
|
||||
];
|
||||
|
||||
timerConfig = {
|
||||
OnCalendar = lib.mkDefault "daily";
|
||||
Persistent = true;
|
||||
timerConfig = {
|
||||
OnCalendar = lib.mkDefault "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
passwordFile = config.sops.secrets.restic-password.path;
|
||||
|
||||
backupPrepareCommand = ''
|
||||
${btrfs} su snapshot -r /var/lib/container-volumes /backup/container-volumes
|
||||
'';
|
||||
backupCleanupCommand = ''
|
||||
${btrfs} su delete /backup/container-volumes
|
||||
'';
|
||||
};
|
||||
|
||||
passwordFile = config.sops.secrets.restic-password.path;
|
||||
|
||||
backupPrepareCommand = ''
|
||||
${btrfs} su snapshot -r /var/lib/container-volumes /backup/container-volumes
|
||||
'';
|
||||
backupCleanupCommand = ''
|
||||
${btrfs} su delete /backup/container-volumes
|
||||
'';
|
||||
};
|
||||
|
||||
containers = {
|
||||
mailserver = import ../../containers/mailserver.nix {
|
||||
specialArgs = {
|
||||
|
@ -167,25 +169,23 @@ in {
|
|||
sievePort = 4190;
|
||||
};
|
||||
|
||||
webserver =
|
||||
import ../../containers/webserver.nix
|
||||
{
|
||||
specialArgs = {
|
||||
inherit repoFlake nodeFlake;
|
||||
hostAddress = hostBridgeAddress;
|
||||
};
|
||||
|
||||
autoStart = true;
|
||||
|
||||
hostBridge = "br0";
|
||||
webserver = import ../../containers/webserver.nix {
|
||||
specialArgs = {
|
||||
inherit repoFlake nodeFlake;
|
||||
hostAddress = hostBridgeAddress;
|
||||
localAddress = "192.168.101.11/24";
|
||||
|
||||
httpPort = 80;
|
||||
httpsPort = 443;
|
||||
forgejoSshPort = 2222;
|
||||
};
|
||||
|
||||
autoStart = true;
|
||||
|
||||
hostBridge = "br0";
|
||||
hostAddress = hostBridgeAddress;
|
||||
localAddress = "192.168.101.11/24";
|
||||
|
||||
httpPort = 80;
|
||||
httpsPort = 443;
|
||||
forgejoSshPort = 2222;
|
||||
};
|
||||
|
||||
syncthing = import ../../containers/syncthing.nix {
|
||||
specialArgs = {
|
||||
inherit repoFlake nodeFlake;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue