NixOS on ZFS: replace manual root password generation with bash variable
Signed-off-by: Maurice Zhou <jasper@apvc.uk>
This commit is contained in:
committed by
George Melikov
parent
41cdd28cf6
commit
7fe3e8ceb1
@@ -26,15 +26,14 @@ of declaratively configuring the system.
|
||||
|
||||
#. Generate password hash::
|
||||
|
||||
mkpasswd -m SHA-512 -s
|
||||
#output: $6$DeHnzc
|
||||
INST_ROOT_PASSWD=$(mkpasswd -m SHA-512 -s)
|
||||
|
||||
#. Declare `initialHashedPassword
|
||||
<https://nixos.org/manual/nixos/stable/options.html#opt-users.users._name_.initialHashedPassword>`__
|
||||
for root user::
|
||||
|
||||
tee -a /mnt/etc/nixos/${INST_CONFIG_FILE} <<-'EOF'
|
||||
users.users.root.initialHashedPassword = "$6$DeHnzc";
|
||||
tee -a /mnt/etc/nixos/${INST_CONFIG_FILE} <<EOF
|
||||
users.users.root.initialHashedPassword = "${INST_ROOT_PASSWD}";
|
||||
EOF
|
||||
|
||||
System installation
|
||||
|
||||
Reference in New Issue
Block a user