You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

282 lines
8.8 KiB

  1. { config, lib, pkgs, ... }:
  2. {
  3. imports = [
  4. ./sound.nix
  5. ./applications.nix
  6. ./waybar.nix
  7. ];
  8. hardware.opengl.enable = true;
  9. users.users.pbb.packages = with pkgs; [
  10. qt5.qtwayland
  11. grim
  12. slurp
  13. wl-clipboard
  14. wldash
  15. wofi
  16. gnome3.gnome-clocks
  17. gnome3.nautilus
  18. gnome3.quadrapassel
  19. gnome3.file-roller
  20. gnome3.vinagre
  21. ];
  22. environment.variables.TERMINAL = "alacritty";
  23. environment.variables.QT_QPA_PLATFORM = "wayland";
  24. environment.variables.QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
  25. environment.variables._JAVA_AWT_WM_NONREPARENTING = "1";
  26. # be careful with those, they *will* break some applications
  27. environment.variables.SDL_VIDEODRIVER = "wayland";
  28. environment.variables.GDK_BACKEND = "wayland";
  29. environment.variables.QUTE_SKIP_WAYLAND_WEBGL_CHECK = "1";
  30. systemd.user.services.mako = {
  31. serviceConfig.ExecStart = "${pkgs.mako}/bin/mako";
  32. restartTriggers = [
  33. config.home-manager.users.pbb.xdg.configFile."mako/config".source
  34. ];
  35. };
  36. home-manager.users.pbb = {
  37. programs.alacritty = {
  38. enable = true;
  39. settings = {
  40. font.normal = {
  41. family = "DejaVu Sans Mono";
  42. size = 9.0;
  43. };
  44. colors = {
  45. primary = {
  46. background = "0x000000";
  47. foreground = "0xeaeaea";
  48. };
  49. normal = {
  50. black = "0x6c6c6c";
  51. red = "0xe9897c";
  52. green = "0xb6e77d";
  53. yellow = "0xecebbe";
  54. blue = "0xa9cdeb";
  55. magenta = "0xea96eb";
  56. cyan = "0xc9caec";
  57. white = "0xf2f2f2";
  58. };
  59. bright = {
  60. black = "0x747474";
  61. red = "0xf99286";
  62. green = "0xc3f786";
  63. yellow = "0xfcfbcc";
  64. blue = "0xb6defb";
  65. magenta = "0xfba1fb";
  66. cyan = "0xd7d9fc";
  67. white = "0xe2e2e2";
  68. };
  69. };
  70. background_opacity = 0.6;
  71. };
  72. };
  73. programs.mako = {
  74. enable = true;
  75. defaultTimeout = 3000;
  76. borderColor = "#ffffff";
  77. backgroundColor = "#00000070";
  78. textColor = "#ffffff";
  79. };
  80. services.redshift = {
  81. enable = true;
  82. package = pkgs.redshift.overrideAttrs (oldAttrs: {
  83. src = pkgs.fetchFromGitHub {
  84. owner = "minus7";
  85. repo = "redshift";
  86. rev = "eecbfedac48f827e96ad5e151de8f41f6cd3af66";
  87. sha256 = "0rs9bxxrw4wscf4a8yl776a8g880m5gcm75q06yx2cn3lw2b7v22";
  88. };
  89. });
  90. latitude = "52.52";
  91. longitude = "13.41";
  92. };
  93. home.file.".wallpapers".source = ./wallpapers;
  94. wayland.windowManager.sway = let
  95. cfg = config.home-manager.users.pbb.wayland.windowManager.sway;
  96. wallpaperCommand = "find ~/.wallpapers/* | shuf -n 1";
  97. lockCommand = "sudo physlock";
  98. modifier = cfg.config.modifier;
  99. kc = (import ./keycodes.nix).neo;
  100. in {
  101. enable = true;
  102. package = pkgs.sway;
  103. #xwayland = false;
  104. wrapperFeatures.gtk = true;
  105. extraConfig = ''
  106. default_border pixel 0
  107. '';
  108. config = {
  109. output = {
  110. "*" = {
  111. bg = "\`${wallpaperCommand}\` fill";
  112. };
  113. };
  114. input."*" = {
  115. xkb_layout = "de";
  116. xkb_variant = "neo";
  117. };
  118. bars = [];
  119. fonts = [ "DejaVu Sans 11" ];
  120. terminal = "alacritty";
  121. menu = "wofi --show drun";
  122. startup = [
  123. /*{ command = ''
  124. swayidle \
  125. timeout 300 '${lockCommand}' \
  126. before-sleep '${lockCommand}' \
  127. lock '${lockCommand}'
  128. EOF
  129. ''; }*/
  130. { command = "systemctl --user restart mako"; always = true; }
  131. { command = "systemctl --user restart waybar"; always = true; }
  132. ];
  133. keybindings = {
  134. "${modifier}+Return" = "exec ${cfg.config.terminal}";
  135. "${modifier}+Left" = "focus left";
  136. "${modifier}+Down" = "focus down";
  137. "${modifier}+Up" = "focus up";
  138. "${modifier}+Right" = "focus right";
  139. "${modifier}+Shift+Left" = "move left";
  140. "${modifier}+Shift+Down" = "move down";
  141. "${modifier}+Shift+Up" = "move up";
  142. "${modifier}+Shift+Right" = "move right";
  143. "${modifier}+Shift+space" = "floating toggle";
  144. "${modifier}+space" = "focus mode_toggle";
  145. "${modifier}+1" = "workspace 1";
  146. "${modifier}+2" = "workspace 2";
  147. "${modifier}+3" = "workspace 3";
  148. "${modifier}+4" = "workspace 4";
  149. "${modifier}+5" = "workspace 5";
  150. "${modifier}+6" = "workspace 6";
  151. "${modifier}+7" = "workspace 7";
  152. "${modifier}+8" = "workspace 8";
  153. "${modifier}+9" = "workspace 9";
  154. "${modifier}+0" = "workspace 10";
  155. "${modifier}+Shift+1" = "move container to workspace 1";
  156. "${modifier}+Shift+2" = "move container to workspace 2";
  157. "${modifier}+Shift+3" = "move container to workspace 3";
  158. "${modifier}+Shift+4" = "move container to workspace 4";
  159. "${modifier}+Shift+5" = "move container to workspace 5";
  160. "${modifier}+Shift+6" = "move container to workspace 6";
  161. "${modifier}+Shift+7" = "move container to workspace 7";
  162. "${modifier}+Shift+8" = "move container to workspace 8";
  163. "${modifier}+Shift+9" = "move container to workspace 9";
  164. "${modifier}+Shift+0" = "move container to workspace 10";
  165. "XF86AudioRaiseVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%";
  166. "XF86AudioLowerVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%";
  167. "XF86AudioMute" = "exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle";
  168. "XF86AudioMicMute" = "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle";
  169. "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 2%-";
  170. "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set +2%";
  171. };
  172. keycodebindings = {
  173. "${modifier}+Shift+${kc.x}" = "kill";
  174. "${modifier}+${kc.a}" = "exec ${cfg.config.menu}";
  175. "${modifier}+${kc.z}" = "exec ${lockCommand}";
  176. "${modifier}+${kc.n}" = "focus left";
  177. "${modifier}+${kc.t}" = "focus down";
  178. "${modifier}+${kc.r}" = "focus up";
  179. "${modifier}+${kc.d}" = "focus right";
  180. "${modifier}+Shift+${kc.n}" = "move left";
  181. "${modifier}+Shift+${kc.t}" = "move down";
  182. "${modifier}+Shift+${kc.r}" = "move up";
  183. "${modifier}+Shift+${kc.d}" = "move right";
  184. "${modifier}+${kc.s}" = "split h";
  185. "${modifier}+${kc.p}" = "split v";
  186. "${modifier}+${kc.e}" = "fullscreen toggle";
  187. "${modifier}+${kc.i}" = "layout stacking";
  188. "${modifier}+${kc.v}" = "layout tabbed";
  189. "${modifier}+${kc.l}" = "layout toggle split";
  190. "${modifier}+Shift+${kc.c}" = "reload";
  191. "${modifier}+Shift+${kc.l}" = "exit";
  192. "${modifier}+${kc.c}" = "mode resize";
  193. "${modifier}+Shift+${kc.f}" = "exec pkill element-desktop";
  194. "${modifier}+${kc.f}" = "exec element-desktop";
  195. "${modifier}+Shift+${kc.q}" = "exec pkill -9 qutebrowser";
  196. "${modifier}+${kc.q}" = "exec qutebrowser";
  197. "--no-repeat 49" = "exec dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.startTalking";
  198. "--release 49" = "exec dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.stopTalking";
  199. };
  200. };
  201. };
  202. };
  203. services.waybar = {
  204. enable = true;
  205. config = {
  206. battery = {
  207. format = "{icon} {capacity}% {time}";
  208. format-charging = "{icon}  {capacity}%";
  209. format-icons = [ "" "" "" "" "" ];
  210. interval = 10;
  211. states = {
  212. critical = 20;
  213. warning = 30;
  214. };
  215. };
  216. clock = {
  217. format = "{:%a %Y-%m-%d %H:%M:%S}";
  218. interval = 1;
  219. };
  220. cpu = { format = " {}%"; };
  221. memory = { format = " {}%"; };
  222. modules-center = [ "clock" ];
  223. modules-left = [ "sway/workspaces" "sway/mode" "tray" ];
  224. modules-right = [ "temperature" "battery" ];
  225. pulseaudio = {
  226. format = "{icon} {volume}%";
  227. format-icons = [ "" "" ];
  228. format-muted = "";
  229. };
  230. "sway/workspaces" = {
  231. all-outputs = true;
  232. disable-scroll = true;
  233. };
  234. temperature = {
  235. critical-threshold = 90;
  236. format = "{icon} {temperatureC}°C";
  237. format-icons = [ "" "" "" "" "" ];
  238. hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input";
  239. interval = 1;
  240. };
  241. };
  242. };
  243. }