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.trustedUsers = [ username ]; 21 22 virtualisation.azureImage.diskSize = 2500; 23 24 system.stateVersion = "20.03"; 25 boot.kernelPackages = pkgs.linuxPackages_latest; 26 27 # test user doesn't have a password 28 services.openssh.passwordAuthentication = false; 29 security.sudo.wheelNeedsPassword = false; 30 31 environment.systemPackages = with pkgs; [ 32 git file htop wget curl 33 ]; 34}