1
0
Fork 0
selfhostblocks/examples/homeassistant/configuration.nix

37 lines
882 B
Nix
Raw Normal View History

2023-07-01 18:46:19 +02:00
{ 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;
};
}