From ae485806dd34c6fbf905636a38be1e084324ea90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 20 Oct 2019 00:04:55 +0200 Subject: [PATCH] Add disk to backup-2 --- modules/private/system/backup-2.nix | 19 ++++++++++++++++++- nixops/default.nix | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/private/system/backup-2.nix b/modules/private/system/backup-2.nix index c67eab6..80fa36d 100644 --- a/modules/private/system/backup-2.nix +++ b/modules/private/system/backup-2.nix @@ -1,5 +1,5 @@ { privateFiles }: -{ config, pkgs, myconfig, ... }: +{ config, pkgs, myconfig, resources, ... }: { boot.kernelPackages = pkgs.linuxPackages_latest; _module.args.privateFiles = privateFiles; @@ -15,6 +15,23 @@ }; }; + fileSystems = { + "/backup2" = { + fsType = "ext4"; + device = "UUID=b9425333-f567-435d-94d8-b26c22d93426"; + }; + }; + + networking = { + firewall.enable = true; + interfaces."ens3".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList + (n: ips: { address = ips.ip4; prefixLength = 32; }) + (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") myconfig.env.servers.backup-2.ips); + interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList + (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or [])) + myconfig.env.servers.backup-2.ips); + }; + # This value determines the NixOS release with which your system is # to be compatible, in order to avoid breaking some software such as # database servers. You should change this only after NixOS release diff --git a/nixops/default.nix b/nixops/default.nix index f65f3da..45a235e 100644 --- a/nixops/default.nix +++ b/nixops/default.nix @@ -5,6 +5,7 @@ enableRollback = true; }; + # Used by hetzner cloud to provision machines resources.sshKeyPairs.ssh-key = {}; eldiron = import ../modules/private/system/eldiron.nix { inherit privateFiles; }; backup-2 = import ../modules/private/system/backup-2.nix { inherit privateFiles; }; -- 2.41.0