diff --git a/hosts/fern/default.nix b/hosts/fern/default.nix index 924c72a9..5f5b423b 100644 --- a/hosts/fern/default.nix +++ b/hosts/fern/default.nix @@ -1,4 +1,4 @@ -{username, ...} @ args: +_: ############################################################# # # Fern - MacBook Pro 2022 13-inch M2 16G, mainly for business. @@ -10,15 +10,4 @@ in { networking.hostName = hostname; networking.computerName = hostname; system.defaults.smb.NetBIOSName = hostname; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users."${username}" = { - home = "/Users/${username}"; - description = username; - - # set user's default shell back to zsh - # `chsh -s /bin/zsh` - # DO NOT change the system's default shell to nushell! it will break some apps! - # It's better to change only starship/alacritty/vscode's shell to nushell! - }; } diff --git a/hosts/harmonica/default.nix b/hosts/harmonica/default.nix index 5ff956d3..550bcc2f 100644 --- a/hosts/harmonica/default.nix +++ b/hosts/harmonica/default.nix @@ -1,4 +1,4 @@ -{username, ...} @ args: +_: ############################################################# # # Harmonica - MacBook Pro 2020 13-inch i5 16G, mainly for personal use @@ -10,15 +10,4 @@ in { networking.hostName = hostname; networking.computerName = hostname; system.defaults.smb.NetBIOSName = hostname; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users."${username}" = { - home = "/Users/${username}"; - description = username; - - # set user's default shell back to zsh - # `chsh -s /bin/zsh` - # DO NOT change the system's default shell to nushell! it will break some apps! - # It's better to change only starship/alacritty/vscode's shell to nushell! - }; } diff --git a/modules/base.nix b/modules/base.nix index aa2cad91..66244e1f 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -1,5 +1,6 @@ -{username, ...}: { +{username, userfullname, ...}: { users.users.${username} = { + description = userfullname; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDiipi59EnVbi6bK1bGrcbfEM263wgdNfbrt6VBC1rHx ryan@ai-idols" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSfp/hvegbK04HykWvoY1EbDW+vXu1AlCjVivWE2ZeR ryan@shoukei" diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index 7579a16a..7bbcce70 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -1,9 +1,7 @@ -{ - imports = [ - ../base.nix - ./nix-core.nix - - ./apps.nix - ./system.nix - ]; +{mylib, ...}: { + imports = + (mylib.scanPaths ./.) + ++ [ + ../base.nix + ]; } diff --git a/modules/darwin/users.nix b/modules/darwin/users.nix new file mode 100644 index 00000000..0c2de7c8 --- /dev/null +++ b/modules/darwin/users.nix @@ -0,0 +1,11 @@ +{username, ...}: { + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users."${username}" = { + home = "/Users/${username}"; + + # set user's default shell back to zsh + # `chsh -s /bin/zsh` + # DO NOT change the system's default shell to nushell! it will break some apps! + # It's better to change only starship/alacritty/vscode's shell to nushell! + }; +} diff --git a/modules/nixos/base/user-group.nix b/modules/nixos/base/user-group.nix index dc79edc8..83e09f52 100644 --- a/modules/nixos/base/user-group.nix +++ b/modules/nixos/base/user-group.nix @@ -25,7 +25,6 @@ initialHashedPassword = "$7$CU..../....Sdl/JRH..9eIvZ6mE/52r.$xeR6lyvTcVVKt28Owcoc/vPOOECcYSiq1xjw/QCz2t0"; home = "/home/${username}"; isNormalUser = true; - description = username; extraGroups = [ username "users"