users/admin: make the account passwordless

This commit is contained in:
Gabriel Arazas 2022-12-13 09:19:48 +08:00
parent 8021cb270e
commit 57078178f3

View File

@ -1,5 +1,4 @@
# This is the main account for servers. It is also used for managing the # Mainly used for managing the installations with deploy-rs.
# installations with deploy-rs.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
@ -8,7 +7,6 @@ in
{ {
users.users.${name} = { users.users.${name} = {
description = "The administrator account for the servers."; description = "The administrator account for the servers.";
hashedPassword = "$6$KXZD6NvjtSkle/id$ECs7zIwDBOlQiFACsyot1gyjKG9UWMlUdRknVujE9efpHMQGx7.YZWyJ0VkV0ja0BPzeF/EzTu6n4EEF5ZHPD0";
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = [ "wheel" ];
useDefaultShell = true; useDefaultShell = true;
@ -18,6 +16,17 @@ in
]; ];
}; };
# We're going passwordless, baybee!
security.sudo.extraRules = [{
users = [ name ];
options = [ "NOPASSWD" ];
}];
security.doas.extraRules = [{
users = [ name ];
noPass = true;
}];
# This is also a trusted user for the Nix daemon. # This is also a trusted user for the Nix daemon.
nix.settings.trusted-users = [ name ]; nix.settings.trusted-users = [ name ];