1{ pkgs, modulesPath, ... }: 2 3let username = "azurenixosuser"; 4in 5{ 6 imports = [ 7 "${modulesPath}/virtualisation/azure-common.nix" 8 "${modulesPath}/virtualisation/azure-image.nix" 9 ]; 10 11 ## NOTE: This is just an example of how to hard-code a user. 12 ## The normal Azure agent IS included and DOES provision a user based 13 ## on the information passed at VM creation time. 14 users.users."${username}" = { 15 isNormalUser = true; 16 home = "/home/${username}"; 17 description = "Azure NixOS Test User"; 18 openssh.authorizedKeys.keys = [ (builtins.readFile ~/.ssh/id_ed25519.pub) ]; 19 }; 20 nix.settings.trusted-users = [ username ]; 21 22 virtualisation.azureImage.diskSize = 2500; 23 24 boot.kernelPackages = pkgs.linuxPackages_latest; 25 26 # test user doesn't have a password 27 services.openssh.passwordAuthentication = false; 28 security.sudo.wheelNeedsPassword = false; 29 30 environment.systemPackages = with pkgs; [ 31 git file htop wget curl 32 ]; 33}