dotfiles/machines/common/shared/user.nix

35 lines
664 B
Nix
Raw Normal View History

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