Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. { config, pkgs, ... }:
  2.  
  3. {
  4. imports = [ <nixpkgs/nixos/modules/installer/virtualbox-demo.nix> ];
  5.  
  6. users.users = {
  7. mhmd = {
  8. isNormalUser = true;
  9. home = "/home/mhmd";
  10. description = "Mohamad Safadieh";
  11. extraGroups = ["wheel" "audio" "networkmanager"];
  12. shell = pkgs.zsh;
  13. initialPassword = "1234";
  14. createHome = true;
  15. };
  16. };
  17.  
  18. security.sudo.extraRules = [
  19. { commands = [ { command = "ALL"; options = [ "NOPASSWD" ]; } ]; groups = [ "wheel" ]; }
  20. ];
  21.  
  22.  
  23. services.xserver = {
  24. desktopManager.plasma5.enable = pkgs.lib.mkForce false;
  25. displayManager.sddm.enable = pkgs.lib.mkForce false;
  26. displayManager.startx.enable = true;
  27.  
  28. windowManager.xmonad = {
  29. enable = true;
  30. enableContribAndExtras = true;
  31. extraPackages = haskellPackages: [
  32. haskellPackages.roman-numerals
  33. haskellPackages.xmonad-wallpaper
  34. ];
  35. };
  36. xautolock = {
  37. enable = true;
  38. time = 15;
  39. locker = "${pkgs.systemd}/bin/systemctl suspend";
  40. extraOptions = [ "-detectsleep" "-corners 0-00" ];
  41. };
  42.  
  43. # disabled middle click to I dont press it accidentally
  44. libinput.buttonMapping = "1 1 3 4 5 6 7 8 9 10";
  45. layout = "us,ara";
  46. xkbOptions = "grp:alt_space_toggle";
  47. xkbModel = "pc105";
  48. xkbVariant = ",qwerty";
  49. };
  50.  
  51. services.compton = {
  52. enable = true;
  53. };
  54.  
  55. systemd.services = {
  56. "suspend@" = {
  57. description = "i3lock";
  58. before = [ "sleep.target" ];
  59.  
  60. environment = { DISPLAY = ":0"; };
  61. serviceConfig = { Type = "forking"; User = "mhmd"; };
  62. script = "${pkgs.i3lock}/bin/i3lock -c 323232";
  63. wantedBy = [ "sleep.target" ];
  64. };
  65. "mullvad-vpn@" = {
  66. enable = true;
  67. description = "Mullvad VPN";
  68. script = ''
  69. choose_vpn() {
  70. server=$(ls /etc/wireguard | grep -Po "mullvad-us[0.9]+" | shuf -n 1)
  71. ${pkgs.systemd}/bin/systemctl start wg-quick@$server
  72. }
  73. sleep $1
  74. choose_vpn
  75. '';
  76. scriptArgs = "%I";
  77. wantedBy = [ "multi-user.target" ];
  78. };
  79. };
  80.  
  81. time.timeZone = "America/New_York";
  82.  
  83. programs.zsh = {
  84. enable = true;
  85. syntaxHighlighting.enable = true;
  86. ohMyZsh = {
  87. enable = true;
  88. theme = "simple";
  89. plugins = ["git" "python"];
  90. };
  91. loginShellInit = ''
  92. HYPHEN_INSENSITIVE="true"
  93. DISABLE_UPDATE_PROMPT="true"
  94. DISABLE_AUTO_TITLE="true"
  95.  
  96. gpg-connect-agent updatestartuptty /bye > /dev/null
  97. alias ld-off='xrandr --output eDP --off'
  98. if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
  99. exec startx -- vt1 &> /dev/null
  100. fi
  101. '';
  102. };
  103.  
  104. programs.vim = {
  105. defaultEditor = true;
  106. };
  107.  
  108. programs.gnupg.agent = {
  109. enable = true;
  110. enableSSHSupport = true;
  111. };
  112.  
  113. services.mpd = {
  114. enable = true;
  115. musicDirectory = "/home/mhmd/Music";
  116. extraConfig = ''
  117. auto_update "yes"
  118.  
  119.  
  120. audio_output {
  121. type "pulse"
  122. name "pulse audio"
  123. }
  124.  
  125. audio_output {
  126. type "fifo"
  127. name "FIFO"
  128. path "/tmp/mpd.fifo"
  129. format "44100:16:2"
  130. }
  131. '';
  132. };
  133.  
  134.  
  135. hardware.pulseaudio.enable = true;
  136. hardware.pulseaudio.support32Bit = true;
  137.  
  138. environment.systemPackages = with pkgs; [
  139. alacritty
  140. compton
  141. dmenu
  142. feh
  143. git
  144. gimp
  145. gnupg
  146. i3lock
  147. inkscape
  148. mpd
  149. mupdf
  150. neofetch
  151. ncmpcpp
  152. scrot
  153. vim
  154. vscodium
  155. wireguard
  156. xautolock
  157. xmobar
  158. xmonad-with-packages
  159. zsh
  160. zsh-syntax-highlighting
  161. ];
  162.  
  163.  
  164. fonts = {
  165. enableFontDir = true;
  166. enableGhostscriptFonts = true;
  167. fonts = with pkgs; [
  168. anonymousPro
  169. emojione
  170. iosevka
  171. terminus_font
  172. ];
  173. };
  174.  
  175. # boot.kernelPackages = pkgs.linuxPackages_latest;
  176.  
  177. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement