nixos-config/components/terminal/remote-install.nix

32 lines
787 B
Nix
Raw Normal View History

2024-08-29 03:26:04 +02:00
{
pkgs,
config,
lib,
...
}:
2023-05-28 20:22:23 +02:00
with lib;
{
options.components.terminal.remote-install.enable = mkOption {
type = lib.types.bool;
default = config.components.terminal.enable;
};
config = mkIf (config.components.terminal.remote-install.enable) {
services.tor = {
enable = true;
client.enable = true;
2024-08-29 03:26:04 +02:00
relay.onionServices.liveos.map = [ { port = 1337; } ];
2023-05-28 20:22:23 +02:00
};
environment.systemPackages = [
(pkgs.writeShellScriptBin "remote-install-start-service" ''
echo "starting announcment server to receive remote-install iso onion id"
${pkgs.nmap}/bin/ncat -k -l -p 1337
'')
(pkgs.writeShellScriptBin "remote-install-get-hiddenReceiver" ''
sudo cat /var/lib/tor/onion/liveos/hostname
'')
];
};
}