Skip to content

Instantly share code, notes, and snippets.

@tstromberg
Created March 22, 2023 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstromberg/a1bce93b52da6630e2dd84e8f7049e83 to your computer and use it in GitHub Desktop.
Save tstromberg/a1bce93b52da6630e2dd84e8f7049e83 to your computer and use it in GitHub Desktop.
example aws NixOS config
{ modulesPath, pkgs, lib, ... }: {
imports = [ "${modulesPath}/virtualisation/amazon-image.nix" ];
ec2.hvm = true;
ec2.efi = true;
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
system.copySystemConfiguration = true;
system.stateVersion = "22.11";
networking.hostName = "bestla";
time.timeZone = "America/New_York";
services.cron = {
enable = true;
systemCronJobs = [
"*/15 * * * * root /home/root/src/commit-etc/commit-etc.sh"
];
};
environment.systemPackages = with pkgs; [
neovim
doas
git
osqueryd
opensmtpd
tmux
];
environment.variables.EDITOR = "nvim";
security.doas.enable = true;
security.sudo.enable = false;
security.doas.extraRules = [{
groups = [ "wheel" ];
keepEnv = true;
persist = true;
}];
users.users.t = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDce/caLihdEi7gbMumkwnaA8N/GjLEUvEXib6CldmMvxQJIVr8lU+2608DrW91GTixrNimhdZTIh0MEqdnmPs7rmMzUH1ErSU/ghggOSbyEMaAo7Rvg+eEMYpmjtM06JKNJB0bOKR8PwqkQZXrYnGaIDUu46PhKkqvSx09zP3zFohptDCX7rJhdLTnrzmyKxDUDmXuzgyDa7dE7FFAa0sx5pyc9sxY0PcJ+dTK+4cWKyN2CKmdJoqdbsuRSNwyqGkiOVTDYIEQAN0dAa1yBOE9IHh+J4E183ClAAAOJ2oQdFUhw7Zzlj2tey7nJ256YHsUW3Vi+lZpebQpmcX4IVLHKVtoRP1wXMsVOnO1141S1NsGJci4HrAhNmJ/7/WkdmnbbklPhCQC5JxTns/vgpdR35JU3jq/aILGckqxOsJuMLUvbMjcDSsC0b/wSsiT9XQ0biR4f0XdDPww2Xf1wUtx5fLggfh0I8LCACAJ3A5vSJT1n0W/2sXanSb11FIWRlM= t@bambu.local"
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment