1{ pkgs, modulesPath, ... }:
2
3let
4 username = "azurenixosuser";
5in
6{
7 imports = [
8 "${modulesPath}/virtualisation/azure-common.nix"
9 "${modulesPath}/virtualisation/azure-image.nix"
10 ];
11
12 ## NOTE: This is just an example of how to hard-code a user.
13 ## The normal Azure agent IS included and DOES provision a user based
14 ## on the information passed at VM creation time.
15 users.users."${username}" = {
16 isNormalUser = true;
17 home = "/home/${username}";
18 description = "Azure NixOS Test User";
19 openssh.authorizedKeys.keys = [ (builtins.readFile ~/.ssh/id_ed25519.pub) ];
20 };
21 nix.settings.trusted-users = [ username ];
22
23 virtualisation.azureImage.diskSize = 2500;
24
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
33 file
34 htop
35 wget
36 curl
37 ];
38}