<commit_before>args: with args;

# !!! What does this package do, and does it belong in Nixpkgs?

stdenv.mkDerivation {
	name = "xlaunch";
	inherit xorgserver;
	buildCommand = "
		cat << EOF > realizeuid.c
		#include <sys/types.h>
		#include <unistd.h>
		#include <stdio.h>
		int main(int argc, char ** argv, char ** envp)
		{
			uid_t a,b,c;
			int i;
			char *nargv[10000];
			char arg1 [10];
			nargv[0]=argv[0];
			for (i=1; i<=argc; i++){
				nargv[i+1]=argv[i];
			}
			nargv[1]=arg1;
			getresuid (&a,&b,&c);
			snprintf(arg1,8,\"%d\",a);
			setresuid(c,c,c);
			execve(\"\$out/libexec/xlaunch\", nargv, envp);
		}
EOF
		mkdir -p \$out/bin
		mkdir -p \$out/libexec
		gcc realizeuid.c -o \$out/bin/xlaunch
		echo '#! ${stdenv.shell}
			USER=\$(egrep '\\''^[-a-z0-9A-Z_]*:[^:]*:'\\''\$1'\\'':'\\'' /etc/passwd | sed -e '\\''s/:.*//'\\'' )
			shift
			case \"\$1\" in 
				:*) export _display=\"\$1\"; 
				shift
			esac
			_display=\${_display:-:0}
			_display=\${_display#:}
			echo Using :\$_display
			if [ -n \"\$DO_X_RESET\" ]; then 
			  RESET_OPTION=\"-once\"
			else
			  RESET_OPTION=\"-noreset\"
			fi;
			XCMD=\"\$(egrep \"^env\" /etc/event.d/xserver | sed -e \"s/env/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo ${xorgserver}/bin/X \\\$_XARGS_ \$RESET_OPTION )\" 
			echo \"\$XCMD\" 
			echo \"\$XCMD\" | bash &
			while ! test -e /tmp/.X11-unix/X\$_display &>/dev/null ; do sleep 0.5; done
			su -l \${USER:-identityless-shelter} -c \"DISPLAY=:\$_display \$*\";
		' >\$out/libexec/xlaunch
		chmod a+x \$out/libexec/xlaunch
	";
}<commit_msg>Update xlaunch to match NixOS update<commit_after>args: with args;

# !!! What does this package do, and does it belong in Nixpkgs?

stdenv.mkDerivation {
	name = "xlaunch";
	inherit xorgserver;
	buildCommand = "
		cat << EOF > realizeuid.c
		#include <sys/types.h>
		#include <unistd.h>
		#include <stdio.h>
		int main(int argc, char ** argv, char ** envp)
		{
			uid_t a,b,c;
			int i;
			char *nargv[10000];
			char arg1 [10];
			nargv[0]=argv[0];
			for (i=1; i<=argc; i++){
				nargv[i+1]=argv[i];
			}
			nargv[1]=arg1;
			getresuid (&a,&b,&c);
			snprintf(arg1,8,\"%d\",a);
			setresuid(c,c,c);
			execve(\"\$out/libexec/xlaunch\", nargv, envp);
		}
EOF
		mkdir -p \$out/bin
		mkdir -p \$out/libexec
		gcc realizeuid.c -o \$out/bin/xlaunch
		echo '#! ${stdenv.shell}
			USER=\$(egrep '\\''^[-a-z0-9A-Z_]*:[^:]*:'\\''\$1'\\'':'\\'' /etc/passwd | sed -e '\\''s/:.*//'\\'' )
			shift
			case \"\$1\" in 
				:*) export _display=\"\$1\"; 
				shift
			esac
			_display=\${_display:-:0}
			_display=\${_display#:}
			echo Using :\$_display
			if [ -n \"\$DO_X_RESET\" ]; then 
			  RESET_OPTION=\"-once\"
			else
			  RESET_OPTION=\"-noreset\"
			fi;
			XCMD=\"\$(egrep \"^env\" /etc/init/xserver.conf | sed -e \"s/env/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo ${xorgserver}/bin/X \\\$_XARGS_ \$RESET_OPTION )\" 
			echo \"\$XCMD\" 
			echo \"\$XCMD\" | bash &
			while ! test -e /tmp/.X11-unix/X\$_display &>/dev/null ; do sleep 0.5; done
			su -l \${USER:-identityless-shelter} -c \"DISPLAY=:\$_display \$*\";
		' >\$out/libexec/xlaunch
		chmod a+x \$out/libexec/xlaunch
	";
}
{'fraction_non_alphanumeric': 0.2502147151445749, 'fraction_numerical': 0.01660463784712282, 'mean_word_length': 2.558044806517312, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '909955', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1503, 'n_words': 307}