1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-16 11:43:21 +03:00
mobile-nixos/modules/initrd-telnet.nix

26 lines
444 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.mobile.boot.stage-1.telnet;
in
{
options.mobile.boot.stage-1.telnet = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enables telnet. This is insecure.
'';
};
};
config.mobile.boot.stage-1 = lib.mkIf cfg.enable {
init = ''
TELNET_PORT=23
telnetd -p ''${TELNET_PORT} -l ${shell} &
'';
};
}