Skip to content

Instantly share code, notes, and snippets.

@caadar
caadar / autologin-tty-nixos.org
Last active July 29, 2024 04:26
How to make a user autologin at the console on NixOS

Autologin a user at the console (NixOS)

Problem

NixOS provide services.mingetty.autologinUser option, but it can’t be used for the specific TTY.

Minimal working example

TTY1 and user “guest”:

@caadar
caadar / ftp-uploadscript.sh
Created October 13, 2019 06:38
Pure-FTPd with uploadscript on NixOS
#!/run/current-system/sw/bin/bash
SCANNED="$1"
AFFIX="${1##*.}"
DATESTAMP=$(date '+%Y%m%d')
TIMESTAMP=$(date '+%H%M%S')
mv "${SCANNED}" "/home/user/${DATESTAMP}..scan-${TIMESTAMP}.${AFFIX}"