forked from clan/clan-core
installer: wait for onion hostname to be available
This commit is contained in:
parent
d99060695f
commit
930f1660e9
@ -1,11 +1,17 @@
|
||||
{ self, lib, ... }: {
|
||||
flake.packages.x86_64-linux = {
|
||||
install-iso = (lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
self.nixosModules.installer
|
||||
self.inputs.nixos-generators.nixosModules.all-formats
|
||||
];
|
||||
}).config.formats.install-iso;
|
||||
};
|
||||
flake.packages.x86_64-linux =
|
||||
let
|
||||
installer = lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
self.nixosModules.installer
|
||||
self.inputs.nixos-generators.nixosModules.all-formats
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
install-iso = installer.config.formats.install-iso;
|
||||
install-vm-nogui = installer.config.formats.vm-nogui;
|
||||
install-vm = installer.config.formats.vm;
|
||||
};
|
||||
}
|
||||
|
@ -7,18 +7,21 @@
|
||||
];
|
||||
services.openssh.settings.PermitRootLogin = "yes";
|
||||
system.activationScripts.root-password = ''
|
||||
mkdir -p /var/shared
|
||||
${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" ''
|
||||
mkdir -p /var/shared
|
||||
echo "$1" > /var/shared/onion-hostname
|
||||
'';
|
||||
};
|
||||
services.getty.autologinUser = lib.mkForce "root";
|
||||
programs.bash.interactiveShellInit = ''
|
||||
if [ "$(tty)" = "/dev/tty1" ]; then
|
||||
until test -e /var/shared/onion-hostname; do sleep 1; done
|
||||
echo "ssh://root:$(cat /var/shared/root-password)@$(cat /var/shared/onion-hostname)"
|
||||
fi
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user