Skip to content

Instantly share code, notes, and snippets.

@rycee
Last active November 26, 2017 13:50
Show Gist options
  • Save rycee/d9277a75b780460d4819a42e4a9f6338 to your computer and use it in GitHub Desktop.
Save rycee/d9277a75b780460d4819a42e4a9f6338 to your computer and use it in GitHub Desktop.
{
# …
services.xserver = {
enable = true;
layout = "us";
displayManager.lightdm.enable = true;
displayManager.job.logToJournal = false;
# displayManager.job.logToFile = lib.mkForce false;
monitorSection = ''
# Set the right DPI. Screen is 344x193 mm.
DisplaySize 344 193
'';
libinput.enable = true;
};
# …
}
if [[ -e "$HOME/.profile" ]]; then
. "$HOME/.profile"
fi
# If there are any running services from a previous session.
# Need to run this in xprofile because the NixOS xsession
# script starts up graphical-session.target.
systemctl --user stop graphical-session.target graphical-session-pre.target
systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS
systemctl --user import-environment DISPLAY
systemctl --user import-environment SSH_AUTH_SOCK
systemctl --user import-environment XAUTHORITY
systemctl --user import-environment XDG_DATA_DIRS
systemctl --user import-environment XDG_RUNTIME_DIR
systemctl --user import-environment XDG_SESSION_ID
export HM_XPROFILE_SOURCED=1
if [[ ! -v HM_XPROFILE_SOURCED ]]; then
. ~/.xprofile
fi
unset HM_XPROFILE_SOURCED
systemctl --user start hm-graphical-session.target
# Set a default pointer.
xsetroot -cursor_name left_ptr
# Turn off beeps.
xset -b
# Quicker blanking of screen.
xset dpms 120 360 800
/nix/store/ni1rwdykbc085lja4ziqw72mw2sg7hz7-xmonad-with-packages/bin/xmonad
systemctl --user stop graphical-session.target
systemctl --user stop graphical-session-pre.target
# Wait until the units actually stop.
while [[ -n "$(systemctl --user --no-legend --state=deactivating list-units)" ]]; do
sleep 0.5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment