2020-03-26 07:11:54 +01:00
|
|
|
{ pkgs, modulesPath, ... }:
|
|
|
|
|
2020-03-27 20:59:18 +01:00
|
|
|
let username = "azurenixosuser";
|
|
|
|
in
|
2020-03-26 07:11:54 +01:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
"${modulesPath}/virtualisation/azure-common.nix"
|
|
|
|
"${modulesPath}/virtualisation/azure-image.nix"
|
|
|
|
];
|
|
|
|
|
2020-03-28 00:42:32 +01:00
|
|
|
## NOTE: This is just an example of how to hard-code a user.
|
|
|
|
## The normal Azure agent IS included and DOES provision a user based
|
|
|
|
## on the information passed at VM creation time.
|
2020-03-27 20:59:18 +01:00
|
|
|
users.users."${username}" = {
|
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/${username}";
|
|
|
|
description = "Azure NixOS Test User";
|
|
|
|
openssh.authorizedKeys.keys = [ (builtins.readFile ~/.ssh/id_ed25519.pub) ];
|
|
|
|
};
|
|
|
|
nix.trustedUsers = [ username ];
|
2020-03-26 07:11:54 +01:00
|
|
|
|
|
|
|
virtualisation.azureImage.diskSize = 2500;
|
|
|
|
|
|
|
|
system.stateVersion = "20.03";
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
2020-03-27 20:59:18 +01:00
|
|
|
# test user doesn't have a password
|
2020-03-26 07:11:54 +01:00
|
|
|
services.openssh.passwordAuthentication = false;
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
2020-03-27 20:59:18 +01:00
|
|
|
|
2020-03-26 07:11:54 +01:00
|
|
|
environment.systemPackages = with pkgs; [
|
2020-03-27 20:59:18 +01:00
|
|
|
git file htop wget curl
|
2020-03-26 07:11:54 +01:00
|
|
|
];
|
|
|
|
}
|