-
Notifications
You must be signed in to change notification settings - Fork 1
/
amazon.nix
36 lines (32 loc) · 892 Bytes
/
amazon.nix
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
{ pkgs, lib, config, ...}:
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true;
nix = {
package = pkgs.nixUnstable;
buildCores = 36;
maxJobs = 18;
extraOptions = ''
experimental-features = nix-command flakes ca-derivations ca-references
'';
};
services.openssh = {
enable = true;
};
programs.mosh = {
enable = true;
withUtempter = true;
};
environment.systemPackages = with pkgs; [
git mosh
];
systemd.services.print-host-key.script = lib.mkForce
''
# Print the host public key on the console so that the user
# can obtain it securely by parsing the output of
# ec2-get-console-output.
echo "-----BEGIN SSH HOST KEY-----" > /dev/console
cat /etc/ssh/ssh_host_ed25519_key.pub >/dev/console
echo "-----END SSH HOST KEY-----" > /dev/console
'';
}