Browse Source

Set up machine-borg2-01.cryto.net

Sven Slootweg 1 year ago
parent
commit
2f7621e852

+ 40 - 0
configuration/default.nix

@ -30,6 +30,46 @@ in {
30 30
		description = "Cryto";
31 31
	};
32 32
33
	"machine-borg2-01.cryto.net" = { pkgs, lib, ... }: {
34
		system.stateVersion = "18.09";
35
36
		imports = [
37
			presets.base
38
			presets.kvm
39
			./hardware-configurations/machine-borg2-01.nix
40
		];
41
42
		boot.loader.grub.device = lib.mkForce "/dev/vda";
43
44
		users.extraUsers = {
45
			backup-f0x = {
46
				createHome = true;
47
				home = "/home/backup-f0x";
48
			};
49
		};
50
51
		users.extraGroups = {
52
			backup-f0x = { members = [ "backup-f0x" ]; };
53
		};
54
55
		services.borgbackup.repos = {
56
			"f0x" = {
57
				allowSubRepos = true;
58
				quota = "250G";
59
				path = "/home/backup-f0x";
60
				user = "backup-f0x";
61
				group = "backup-f0x";
62
				authorizedKeys = [
63
					"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINjJDP2TDyj1X/L6gNgHCXASIWoW/VnJ77FQy39VRTi8 f0x@elephantus"
64
				];
65
				authorizedKeysAppendOnly = [
66
					"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG7WSUY6Y2lsIawo8dPBu4/Omx6c7/1SMD9ve/vpcorN borg-backup@terra"
67
					"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDeMWPR38zXAbURVTJs+yGDnld5kO7bcgp/70l4wJG0k borg-backup@luna"
68
				];
69
			};
70
		};
71
	};
72
33 73
	"machine-haless-03.cryto.net" = { pkgs, lib, config, ... }@args: {
34 74
		system.stateVersion = "19.03";
35 75

+ 29 - 0
configuration/hardware-configurations/machine-borg2-01.nix

@ -0,0 +1,29 @@
1
# Do not modify this file!  It was generated by ‘nixos-generate-config’
2
# and may be overwritten by future invocations.  Please make changes
3
# to /etc/nixos/configuration.nix instead.
4
{ config, lib, pkgs, ... }:
5
6
{
7
  imports = [ ];
8
9
  boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk" ];
10
  boot.kernelModules = [ ];
11
  boot.extraModulePackages = [ ];
12
13
  fileSystems."/" =
14
    { device = "/dev/disk/by-uuid/c87215cc-952c-48c8-92d4-2d5bb2ab9fe2";
15
      fsType = "ext4";
16
    };
17
18
  fileSystems."/boot" =
19
    { device = "/dev/disk/by-uuid/7f301f2f-c3c1-4209-88e4-2488a829a98b";
20
      fsType = "ext4";
21
    };
22
23
  swapDevices =
24
    [ { device = "/dev/disk/by-uuid/a610584c-2d0e-4027-a869-90427a59f542"; }
25
    ];
26
27
  nix.maxJobs = lib.mkDefault 1;
28
  virtualisation.hypervGuest.enable = true;
29
}