From 548004b1a15d92a15e56a1845a9addf14ac555f8 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 11 Apr 2021 12:13:41 +0200 Subject: [PATCH] Add host backup-4 --- hosts/backup-4/configuration.nix | 42 +++++++++++++++++++++++ hosts/backup-4/hardware-configuration.nix | 28 +++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 hosts/backup-4/configuration.nix create mode 100644 hosts/backup-4/hardware-configuration.nix diff --git a/hosts/backup-4/configuration.nix b/hosts/backup-4/configuration.nix new file mode 100644 index 0000000..7b693ee --- /dev/null +++ b/hosts/backup-4/configuration.nix @@ -0,0 +1,42 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./hardware-configuration.nix + ../../configuration/common + ../../configuration/proxmox-vm + ]; + + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/vda"; + + networking.hostName = "backup-4"; + + networking.useDHCP = false; + networking.interfaces.ens18.ipv6.addresses = [ { address = "2001:638:904:ffcb::c"; prefixLength = 64; } ]; + networking.defaultGateway6 = { address = "2001:638:904:ffcb::1"; interface = "ens18"; }; + networking.nameservers = [ "2001:638:904:ffcc::3" "2001:638:904:ffcc::4" "141.24.40.3" "141.24.40.4" ]; + + services.rsnapshot = { + enable = true; + extraConfig = '' + snapshot_root /mnt/backup-4/ + retain daily 14 + ssh_args -o BatchMode=yes -o IdentityFile=/var/src/secrets/rsnapshot/id_rsa + backup backup-replication@clerie-backup.net.clerie.de:/clerie-backup-replication/ clerie-backup/ + ''; + cronIntervals = { + daily = "15 6 * * * "; + }; + }; + + clerie.monitoring = { + enable = true; + id = "205"; + pubkey = "CLEF5hLdjwPqfU1oaM16fusJ705iNzUBxYsb4/YuGw4="; + }; + + system.stateVersion = "21.03"; +} diff --git a/hosts/backup-4/hardware-configuration.nix b/hosts/backup-4/hardware-configuration.nix new file mode 100644 index 0000000..c2490b8 --- /dev/null +++ b/hosts/backup-4/hardware-configuration.nix @@ -0,0 +1,28 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" "virtio_blk" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/eb9bcb35-4f34-4cd6-b1b3-3a86de40571b"; + fsType = "ext4"; + }; + + fileSystems."/mnt/backup-4" = + { device = "/dev/disk/by-uuid/f4d2a27d-664b-45f7-abc2-adf6691ad363"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + +}