mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-27 15:54:58 +08:00
26 lines
653 B
Nix
26 lines
653 B
Nix
# Make flake.config.peope.myself the admin of the machine
|
|
{ flake, pkgs, lib, ... }:
|
|
|
|
{
|
|
# Login via SSH with mmy SSH key
|
|
users.users =
|
|
let
|
|
me = flake.config.me;
|
|
myKeys = [ me.sshKey ];
|
|
in
|
|
{
|
|
root.openssh.authorizedKeys.keys = myKeys;
|
|
${me.username} = {
|
|
openssh.authorizedKeys.keys = myKeys;
|
|
} // lib.optionalAttrs pkgs.stdenv.isLinux {
|
|
isNormalUser = true;
|
|
extraGroups = [ "networkmanager" "wheel" ];
|
|
};
|
|
};
|
|
|
|
# Make me a sudoer without password
|
|
security = lib.optionalAttrs pkgs.stdenv.isLinux {
|
|
sudo.execWheelOnly = true;
|
|
sudo.wheelNeedsPassword = false;
|
|
};
|
|
}
|