-
Notifications
You must be signed in to change notification settings - Fork 10
/
common.nix
55 lines (47 loc) · 1.25 KB
/
common.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ username }: { pkgs, modulesPath, ... }: {
imports = [
"${modulesPath}/virtualisation/azure-common.nix"
];
system.stateVersion = "24.05";
i18n.defaultLocale = "en_US.UTF-8";
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.growPartition = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
virtualisation.azure.agent.enable = true;
services.cloud-init.enable = true;
systemd.services.cloud-config.serviceConfig = {
Restart = "on-failure";
};
services.cloud-init.network.enable = true;
networking.useDHCP = false;
networking.useNetworkd = true;
programs.zsh.enable = true;
users.users."${username}" = {
isNormalUser = true;
home = "/home/${username}";
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
(builtins.readFile ~/.ssh/id_rsa.pub)
];
shell = pkgs.zsh;
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
environment.systemPackages = with pkgs; [
curl
git
vim
];
nix.settings = {
warn-dirty = false;
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [ username ];
};
}