diff --git a/hosts/imxyy-nix/home.nix b/hosts/imxyy-nix/home.nix index a619819..eeade1c 100644 --- a/hosts/imxyy-nix/home.nix +++ b/hosts/imxyy-nix/home.nix @@ -78,12 +78,6 @@ }; my = { - autologin = { - enable = true; - user = username; - ttys = [ 6 ]; - }; - gpg.enable = true; cli.all.enable = true; coding.all.enable = true; diff --git a/modules/getty-autologin.nix b/modules/getty-autologin.nix deleted file mode 100644 index c2c9089..0000000 --- a/modules/getty-autologin.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: - -with lib; - -let - cfg = config.my.autologin; - gettycfg = config.services.getty; - - baseArgs = [ - "--login-program" - "${gettycfg.loginProgram}" - ] - ++ optionals (gettycfg.loginOptions != null) [ - "--login-options" - gettycfg.loginOptions - ] - ++ gettycfg.extraArgs; - - gettyCmd = args: "@${pkgs.util-linux}/sbin/agetty agetty ${escapeShellArgs baseArgs} ${args}"; - - forAllAutologinTTYs = - config: - attrsets.mergeAttrsList (map (ttynum: { "getty@tty${toString ttynum}" = config; }) cfg.ttys); - - autologinModule = types.submodule { - options = { - enable = mkEnableOption "autologin"; - user = mkOption { - type = types.str; - default = ""; - example = "foo"; - description = mdDoc '' - Username of the account that will be automatically logged in at the console. - ''; - }; - ttys = mkOption { - type = types.listOf types.int; - default = [ 6 ]; - description = mdDoc '' - TTY numbers for autologin.user to login to. - ''; - }; - }; - }; - -in - -{ - ###### interface - - options = { - - my.autologin = mkOption { - type = autologinModule; - default = { }; - }; - - }; - - ###### implementation - - config = mkIf cfg.enable { - systemd.services = forAllAutologinTTYs { - overrideStrategy = "asDropin"; # needed for templates to work - serviceConfig.ExecStart = [ - "" - (gettyCmd "--noclear --keep-baud %I 115200,38400,9600 -a ${cfg.user} $TERM") - ]; - }; - }; - -}