dotfiles/machines/common/shared/user.nix

29 lines
619 B
Nix
Raw Normal View History

2023-06-24 21:24:20 +02:00
{
config,
lib,
pkgs,
...
}: let
homeRoot =
if pkgs.stdenv.isDarwin
then "/Users"
else if pkgs.stdenv.isLinux
then "/home"
else throw "Unsupported OS";
in {
users.users."${config.dotfiles.username}" =
{
home = "${homeRoot}/${config.dotfiles.username}";
openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILm0O46zW/XfVOSwz0okRWYeOAg+wCVkCtCAoVTpZsOh"];
shell = pkgs.zsh;
}
// (
if pkgs.stdenv.isLinux
then {
isNormalUser = lib.mkIf pkgs.stdenv.isLinux true;
extraGroups = ["wheel"];
}
else {}
);
}