-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdigitalocean.nix
More file actions
68 lines (63 loc) · 1.66 KB
/
Copy pathdigitalocean.nix
File metadata and controls
68 lines (63 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# DigitalOcean platform support.
#
# DO droplets provision networking via cloud-init (not DHCP).
# Without this module, the machine boots but has no IP addresses.
{ lib, modulesPath, ... }:
{
imports = [
"${modulesPath}/virtualisation/digital-ocean-config.nix"
];
# DO provisions IPs via cloud-init, not DHCP
networking.useDHCP = lib.mkForce false;
services.cloud-init = {
enable = true;
network.enable = true;
settings = {
datasource_list = [
"ConfigDrive"
"Digitalocean"
];
datasource.ConfigDrive = { };
datasource.Digitalocean = { };
cloud_init_modules = [
"seed_random"
"bootcmd"
"write_files"
"growpart"
"resizefs"
"set_hostname"
"update_hostname"
# "update_etc_hosts" # not supported on NixOS
# "users-groups" # throws error on NixOS
# "ssh" # tries to edit /etc/ssh/sshd_config
"set_password"
];
cloud_config_modules = [
"ssh-import-id"
"keyboard"
# "locale" # not supported on NixOS
"runcmd"
"disable_ec2_metadata"
];
cloud_final_modules = [
"write_files_deferred"
"puppet"
"chef"
"ansible"
"mcollective"
"salt_minion"
"reset_rmc"
# "scripts_vendor" # install dotty agent fails
"scripts_per_once"
"scripts_per_boot"
# "scripts_per_instance" # broken shebang in DO script
"scripts_user"
"ssh_authkey_fingerprints"
"keys_to_console"
"install_hotplug"
"phone_home"
"final_message"
];
};
};
}