From 0e9a44f67cc4d908c0d323dfd0d665f6187f4b35 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Tue, 4 Jul 2023 22:26:47 +0100 Subject: [PATCH] backups: got the backup configed, but fecked up the networking --- applications/restic.nix | 2 +- machines/agentjones.nix | 4 ++-- machines/hardware/RM007.nix | 40 +++++++++++++++++++++++++++++++++++++ machines/neuromancer.nix | 16 ++++++++++++++- 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 machines/hardware/RM007.nix diff --git a/applications/restic.nix b/applications/restic.nix index 32cd827..ee858aa 100644 --- a/applications/restic.nix +++ b/applications/restic.nix @@ -39,7 +39,7 @@ { name = value.config.services.skynet_backup.host.name; value = base // { - repositoryFile = "${destination}/${value.config.services.skynet_backup.host.name}"; + repositoryFile = "/etc/skynet/restic/${value.config.services.skynet_backup.host.name}"; backupPrepareCommand = '' #!${pkgs.stdenv.shell} diff --git a/machines/agentjones.nix b/machines/agentjones.nix index 9ea8494..5e35d6d 100644 --- a/machines/agentjones.nix +++ b/machines/agentjones.nix @@ -50,7 +50,7 @@ in { eno1 = { ipv4.addresses = [ { - address = "193.1.99.72"; + address = ip_pub; prefixLength = 26; } ]; @@ -60,7 +60,7 @@ in { ipv4.addresses = [ { # internal address - address = "193.1.99.125"; + address = ip_priv; prefixLength = 26; } ]; diff --git a/machines/hardware/RM007.nix b/machines/hardware/RM007.nix new file mode 100644 index 0000000..02ecb10 --- /dev/null +++ b/machines/hardware/RM007.nix @@ -0,0 +1,40 @@ +# 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 + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c48817e1-036f-49a7-adae-f63fc6c03cd5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/76CE-C65E"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/eced30bd-b785-43e0-a202-cdaee7e0f4f7"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/machines/neuromancer.nix b/machines/neuromancer.nix index a397ae5..fa23d4d 100644 --- a/machines/neuromancer.nix +++ b/machines/neuromancer.nix @@ -20,9 +20,21 @@ let in { imports = [ + ./hardware/RM007.nix ../applications/restic.nix ]; + + networking.hostName = name; + # this has to be defined for any physical servers + # vms are defined by teh vm host + networking.interfaces.eno1.ipv4.addresses = [ + { + address = ip_pub; + prefixLength = 26; + } + ]; + deployment = { targetHost = hostname; targetPort = 22; @@ -42,7 +54,9 @@ in { }; services.skynet_backup = { - normal.backups = ["/etc/skynet"]; + normal.backups = [ + #"/etc/skynet" + ]; host = {