mirror of
https://github.com/srid/nixos-config.git
synced 2026-01-07 08:37:34 +08:00
34 lines
955 B
Nix
34 lines
955 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
|
|
# vixen host key (see distributed-build.nix)
|
|
# TODO: This should be added to 'pureintent' only
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIImY2zbqe3HlPF62gSgUrJI7xY3n3NEBwRi/MkDrVjp5"
|
|
];
|
|
in
|
|
{
|
|
root.openssh.authorizedKeys.keys = myKeys;
|
|
${me.username} = {
|
|
openssh.authorizedKeys.keys = myKeys;
|
|
shell = pkgs.zsh;
|
|
} // lib.optionalAttrs pkgs.stdenv.isLinux {
|
|
isNormalUser = true;
|
|
extraGroups = [ "networkmanager" "wheel" ];
|
|
};
|
|
};
|
|
|
|
programs.zsh.enable = lib.mkIf pkgs.stdenv.isLinux true;
|
|
|
|
# Make me a sudoer without password
|
|
security = lib.optionalAttrs pkgs.stdenv.isLinux {
|
|
sudo.execWheelOnly = true;
|
|
sudo.wheelNeedsPassword = false;
|
|
};
|
|
}
|