tips:linux:nixos:config:25.05:jp:user

ユーザーの作成詳細

# Define a user account. Don't forget to set a password with ‘passwd’.
# users.users.alice = {
#   isNormalUser = true;
#   extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
#   packages = with pkgs; [
#     firefox
#     tree
#   ];
# };
  • ユーザー名 alice 通常ユーザー指定、sudo許可のwheelグループ入り、firefox と tree を alice 専用にいれる指定。
 programs.zsh.enable = true;
 users.users.alice = {        #alice
   isNormalUser = true;       #一般ユーザー指定
 # extraGroups = [ "wheel" ]; #sudo を許容する
 # initialPassword = "alice"; #パスワードalice (平文注意)
   initialHashedPassword =    #パスワードは mkpass なんたら で出てきたものをコピペ
     "$y$j9T$uVTf6etKqPVfGGmqWSj3b.$6MxxtBIopgOPThF1XzuxzJ38KU0SmQWpIscbhN34Fr8";  # mkpass pass つまりパスワードは pass の4文字を初期指定する
   description = "Alice Q. User"; #概要説明
   group = "users";
   expires = "2025-09-30";      #特定日付以降無効とする。指定はyyyy-mm-dd 書式で。
   shell   = pkgs.zsh;        #シェルを指定。規定値はbash。
   packages = with pkgs; [    #alice専用パッケージを指定
     vim
   ];
 };
  • デフォルトシェルにzshを有効にし、パスワードも初期指定するなどしている。
  • tips/linux/nixos/config/25.05/jp/user.txt
  • 最終更新: 2025/09/28 14:26
  • by asaasa