diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-10-20 00:04:55 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-10-20 00:05:19 +0200 |
commit | ae485806dd34c6fbf905636a38be1e084324ea90 (patch) | |
tree | b9fcfe43ca0a5601f463593817b10993e881e3dc | |
parent | 1b9150a54b5cb0b512265cdcf88ad10c9a4a55b1 (diff) | |
download | Nix-ae485806dd34c6fbf905636a38be1e084324ea90.tar.gz Nix-ae485806dd34c6fbf905636a38be1e084324ea90.tar.zst Nix-ae485806dd34c6fbf905636a38be1e084324ea90.zip |
Add disk to backup-2
-rw-r--r-- | modules/private/system/backup-2.nix | 19 | ||||
-rw-r--r-- | nixops/default.nix | 1 |
2 files changed, 19 insertions, 1 deletions
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 @@ | |||
1 | { privateFiles }: | 1 | { privateFiles }: |
2 | { config, pkgs, myconfig, ... }: | 2 | { config, pkgs, myconfig, resources, ... }: |
3 | { | 3 | { |
4 | boot.kernelPackages = pkgs.linuxPackages_latest; | 4 | boot.kernelPackages = pkgs.linuxPackages_latest; |
5 | _module.args.privateFiles = privateFiles; | 5 | _module.args.privateFiles = privateFiles; |
@@ -15,6 +15,23 @@ | |||
15 | }; | 15 | }; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | fileSystems = { | ||
19 | "/backup2" = { | ||
20 | fsType = "ext4"; | ||
21 | device = "UUID=b9425333-f567-435d-94d8-b26c22d93426"; | ||
22 | }; | ||
23 | }; | ||
24 | |||
25 | networking = { | ||
26 | firewall.enable = true; | ||
27 | interfaces."ens3".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList | ||
28 | (n: ips: { address = ips.ip4; prefixLength = 32; }) | ||
29 | (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") myconfig.env.servers.backup-2.ips); | ||
30 | interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList | ||
31 | (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or [])) | ||
32 | myconfig.env.servers.backup-2.ips); | ||
33 | }; | ||
34 | |||
18 | # This value determines the NixOS release with which your system is | 35 | # This value determines the NixOS release with which your system is |
19 | # to be compatible, in order to avoid breaking some software such as | 36 | # to be compatible, in order to avoid breaking some software such as |
20 | # database servers. You should change this only after NixOS release | 37 | # 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 @@ | |||
5 | enableRollback = true; | 5 | enableRollback = true; |
6 | }; | 6 | }; |
7 | 7 | ||
8 | # Used by hetzner cloud to provision machines | ||
8 | resources.sshKeyPairs.ssh-key = {}; | 9 | resources.sshKeyPairs.ssh-key = {}; |
9 | eldiron = import ../modules/private/system/eldiron.nix { inherit privateFiles; }; | 10 | eldiron = import ../modules/private/system/eldiron.nix { inherit privateFiles; }; |
10 | backup-2 = import ../modules/private/system/backup-2.nix { inherit privateFiles; }; | 11 | backup-2 = import ../modules/private/system/backup-2.nix { inherit privateFiles; }; |