add root-password module
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
sshd = ./sshd.nix;
|
sshd = ./sshd.nix;
|
||||||
sunshine = ./sunshine.nix;
|
sunshine = ./sunshine.nix;
|
||||||
syncthing = ./syncthing.nix;
|
syncthing = ./syncthing.nix;
|
||||||
|
root-password = ./root-password.nix;
|
||||||
thelounge = ./thelounge.nix;
|
thelounge = ./thelounge.nix;
|
||||||
vm-user = ./vm-user.nix;
|
vm-user = ./vm-user.nix;
|
||||||
waypipe = ./waypipe.nix;
|
waypipe = ./waypipe.nix;
|
||||||
|
|||||||
19
clanModules/root-password.nix
Normal file
19
clanModules/root-password.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ pkgs, config, ... }:
|
||||||
|
{
|
||||||
|
users.mutableUsers = false;
|
||||||
|
users.extraUsers.root.hashedPasswordFile = "/run/secrets-for-users/passwordHash";
|
||||||
|
sops.secrets."${config.clanCore.machineName}-passwordHash".neededForUsers = true;
|
||||||
|
clanCore.facts.services.password = {
|
||||||
|
secret.password = { };
|
||||||
|
secret.passwordHash = { };
|
||||||
|
generator.path = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
xkcdpass
|
||||||
|
mkpasswd
|
||||||
|
];
|
||||||
|
generator.script = ''
|
||||||
|
xkcdpass -c 3 -d - > $secrets/password
|
||||||
|
cat $secrets/password | mkpasswd -s -m sha-512 > $secrets/passwordHash
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user