I am having trouble installing packages on my aws instance.

I am brand new to Nixos. I set up a t4g.nano EC2 instance on aws with the official Nixos ami.

I change the /etc/nixos/configuration.nix file to the following

{ modulesPath, pkgs, config, ...}: {
  imports = [ "${modulesPath}/virtualisation/amazon-image.nix" ];
  ec2.efi = true;
  system.stateVersion = "23.11";

 environment.systemPackages = with pkgs;[
     vim dotnet-runtime vsftpd wget screen

I ran the nixos-rebuild switch command and got no errors.

now when I try to run a command like wget or screen I still get the “command not found” message.
what did I do wrong?

t4g.nano only has 500MB memory, are you definitely sure nixos-rebuild is completing successfully and not crashing with OOM? I’ve seen this happen in low-memory environments e.g. raspberry pi where I’ve had to set up some swap (could be just zram) to get some nix builds to complete.

1 Like

This seems to have been the problem.
I got it to work by switching to a t4g.micro instance. Thanks for the help.