Created
September 24, 2019 03:55
-
-
Save msafadieh/73b3d98f80c4530dcb7776bd396bed2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
{ | |
systemd.services = { | |
"suspend@" = { | |
description = "i3lock"; | |
before = [ "sleep.target" ]; | |
environment = { DISPLAY = ":0"; }; | |
serviceConfig = { Type = "forking"; User = "mhmd"; }; | |
script = "${pkgs.i3lock}/bin/i3lock -c 323232"; | |
wantedBy = [ "sleep.target" ]; | |
}; | |
"mullvad-vpn@" = { | |
enable = true; | |
description = "Mullvad VPN"; | |
script = '' | |
choose_vpn() { | |
server=$(ls /etc/wireguard | grep -Po "mullvad-us[0-9]+" | shuf -n 1) | |
${pkgs.systemd}/bin/systemctl start wg-quick@$server | |
} | |
sleep $1 | |
choose_vpn | |
''; | |
scriptArgs = "%U"; | |
wantedBy = [ "multi-user.target" ]; | |
}; | |
}; | |
services.mpd = { | |
enable = true; | |
musicDirectory = "/home/mhmd/Music"; | |
extraConfig = '' | |
auto_update "yes" | |
audio_output { | |
type "pulse" | |
name "pulse audio" | |
} | |
audio_output { | |
type "fifo" | |
name "FIFO" | |
path "/tmp/mpd.fifo" | |
format "44100:16:2" | |
} | |
''; | |
}; | |
services.xserver = { | |
enable = true; | |
displayManager.startx.enable = true; | |
windowManager.default = "xmonad"; | |
windowManager.xmonad = { | |
enable = true; | |
enableContribAndExtras = true; | |
extraPackages = haskellPackages: [ | |
haskellPackages.roman-numerals | |
haskellPackages.xmonad-wallpaper | |
]; | |
}; | |
xautolock = { | |
enable = true; | |
time = 15; | |
locker = "${pkgs.systemd}/bin/systemctl suspend"; | |
extraOptions = [ "-detectsleep" "-corners 0-00" ]; | |
}; | |
# disabled middle click to I dont press it accidentally | |
libinput = { | |
enable = true; | |
buttonMapping = "1 1 3 4 5 6 7 8 9 10"; | |
}; | |
layout = "us,ara"; | |
xkbOptions = "grp:alt_space_toggle"; | |
xkbModel = "pc105"; | |
xkbVariant = ",qwerty"; | |
}; | |
services.compton = { | |
enable = true; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment