storopoli / flakes

NixOS/MacOS Nix Minimalist-Hardened-Privacy-oriented Configs
MIT License
48 stars 5 forks source link

Abount username and password #48

Closed Dandeptraibodoiwa closed 8 months ago

Dandeptraibodoiwa commented 8 months ago

H-Hello, it's me again. I've built it finished but, it's still the console. image ,

And I've accessed Use the hashed password generated by the mkpasswd {PASSWORD} -m sha-512 command to replace the value of users.users. <name>.hashedPassword in /mnt/etc/nixos/flakes/linux/default.nix (there are two places to edit) But I don't know how to set it up ?

{ config, ... }:

{
  imports = [
    ./system.nix
    ./filesystem.nix
    ./networking.nix
    ./packages.nix
    ./bluetooth.nix
    ./fonts.nix
    ./wayland.nix
    ./hyprland.nix
    ./impermanence.nix
  ];
  users = {
    mutableUsers = false;
    users = {
      root.hashedPasswordFile = config.age.secrets.root.path;
      user = {
        hashedPasswordFile = config.age.secrets.password.path;
        isNormalUser = true;
        extraGroups =
          [ "wheel" "docker" "libvirtd" "video" "audio" "networkmanager" ];
      };
    };
  };
}

Result is i don't know user name and password. I'm really sorry for bothering you, still looking forward to your help. Sorry if my english is not good.

storopoli commented 8 months ago

Example:

~# mkpasswd MyPassword123 -m sha-512
$6$Qe1/.wYuEk06m1RW$61uMAGHa.DPgWPS1.zs2QH07mB3IkMqLK9SpKf61JczkkTk1zEJzXj3.5xzo7leI/Z/uawOP1qtrvTPUIaw1N/

Then:

  users = {
    mutableUsers = false;
    users = {
      root.hashedPassword = "$6$Qe1/.wYuEk06m1RW$61uMAGHa.DPgWPS1.zs2QH07mB3IkMqLK9SpKf61JczkkTk1zEJzXj3.5xzo7leI/Z/uawOP1qtrvTPUIaw1N/";
      user = {
        hashedPassword = "$6$Qe1/.wYuEk06m1RW$61uMAGHa.DPgWPS1.zs2QH07mB3IkMqLK9SpKf61JczkkTk1zEJzXj3.5xzo7leI/Z/uawOP1qtrvTPUIaw1N/";
        isNormalUser = true;
        extraGroups =
          [ "wheel" "docker" "libvirtd" "video" "audio" "networkmanager" ];
      };
    };

Is that clear?