1
0
Fork 0
selfhostblocks/examples/homeassistant/configuration.nix
2023-07-10 18:36:25 -07:00

36 lines
882 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, ... }:
{
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelModules = [ "kvm-intel" ];
fileSystems."/" =
{ device = "/dev/vda";
fsType = "ext4";
};
system.stateVersion = "22.11";
# As we intend to run this example using `nixos-rebuild build-vm`, we need to setup the user
# ourselves, see https://nixos.wiki/wiki/NixOS:nixos-rebuild_build-vm
users.users.nixos = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
initialPassword = "nixos";
};
security.sudo.extraRules = [
{ users = [ "nixos" ];
commands = [
{ command = "ALL";
options = [ "NOPASSWD" ];
}
];
}
];
services.openssh.enable = true;
services.openssh = {
permitRootLogin = "no";
passwordAuthentication = true;
};
}