@@ -32,19 +32,35 @@ with lib;
3232 #services.rogue.enable = true;
3333
3434 # Disable some other stuff we don't need.
35− security.sudo.enable = mkDefault false;
3635 services.udisks2.enable = mkDefault false;
3736
37+ # Use less privileged nixos user
38+ users.users.nixos = {
39+ isNormalUser = true;
40+ extraGroups = [ "wheel" "networkmanager" "video" ];
41+ # Allow the graphical user to login without password
42+ initialHashedPassword = "";
43+ };
44+
45+ # Allow the user to log in as root without a password.
46+ users.users.root.initialHashedPassword = "";
47+
48+ # Allow passwordless sudo from nixos user
49+ security.sudo = {
50+ enable = mkDefault true;
51+ wheelNeedsPassword = mkForce false;
52+ };
53+
3854 # Automatically log in at the virtual consoles.
39− services.mingetty.autologinUser = "root";
55+ services.mingetty.autologinUser = "nixos";
4056
4157 # Some more help text.
4258 services.mingetty.helpLine =
4359 ''
4460
45− The "root" account has an empty password. ${
61+ The "nixos" and "root" account have empty passwords. ${
4662 optionalString config.services.xserver.enable
47− "Type `systemctl start display-manager' to\nstart the graphical user interface."}
63+ "Type `sudo systemctl start display-manager' to\nstart the graphical user interface."}
4864 '';
4965
5066 # Allow sshd to be started manually through "systemctl start sshd".
@@ -86,8 +102,5 @@ with lib;
86102 # because we have the firewall enabled. This makes installs from the
87103 # console less cumbersome if the machine has a public IP.
88104 networking.firewall.logRefusedConnections = mkDefault false;
89−
90− # Allow the user to log in as root without a password.
91− users.users.root.initialHashedPassword = "";
92105 };
93106}