clan-core/installer.nix
Jörg Thalheim 9aaac528f8 switch from alejandra -> nixpkgs-fmt
alejandra has someone questionable choices for formatting that no one would apply to there code if they would format manually.
nixpkgs-fmt seems to produce more readable results.
2023-07-21 11:15:28 +02:00

30 lines
833 B
Nix

{ config
, lib
, pkgs
, ...
}: {
systemd.tmpfiles.rules = [
"d /var/shared 0777 root root - -"
];
services.openssh.settings.PermitRootLogin = "yes";
system.activationScripts.root-password = ''
${pkgs.pwgen}/bin/pwgen -s 16 1 > /var/shared/root-password
echo "root:$(cat /var/shared/root-password)" | chpasswd
'';
hidden-announce = {
enable = true;
script = pkgs.writers.writeDash "write-hostname" ''
echo "$1" > /var/shared/onion-hostname
'';
};
services.getty.autologinUser = lib.mkForce "root";
programs.bash.interactiveShellInit = ''
if [ "$(tty)" = "/dev/tty1" ]; then
echo "ssh://root:$(cat /var/shared/root-password)@$(cat /var/shared/onion-hostname)"
fi
'';
formatConfigs.install-iso = {
isoImage.squashfsCompression = "zstd -Xcompression-level 1";
};
}