2020-04-22 22:13:03 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2020-06-05 14:38:58 +02:00
|
|
|
let tmux_config = builtins.readFile /home/coolneng/.tmux.conf;
|
|
|
|
|
|
|
|
in {
|
2020-04-22 22:13:03 +02:00
|
|
|
# Display manager
|
2020-05-09 01:17:35 +02:00
|
|
|
services.xserver.enable = true;
|
2020-05-08 21:53:52 +02:00
|
|
|
services.xserver.displayManager = {
|
2020-04-22 22:13:03 +02:00
|
|
|
defaultSession = "sway";
|
2020-07-13 23:33:17 +02:00
|
|
|
autoLogin = {
|
|
|
|
enable = true;
|
|
|
|
user = "coolneng";
|
|
|
|
};
|
2020-05-11 06:39:22 +02:00
|
|
|
lightdm = {
|
2020-04-22 22:13:03 +02:00
|
|
|
enable = true;
|
2020-05-14 02:09:23 +02:00
|
|
|
greeter.package = pkgs.lightdm_gtk_greeter;
|
2020-04-22 22:13:03 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Window manager
|
|
|
|
programs.sway = {
|
|
|
|
enable = true;
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
xwayland
|
|
|
|
swaylock
|
2020-05-10 03:13:30 +02:00
|
|
|
swayidle
|
2020-04-22 22:13:03 +02:00
|
|
|
swaybg
|
|
|
|
rofi
|
|
|
|
waybar
|
|
|
|
clipman
|
2020-05-10 03:13:30 +02:00
|
|
|
wl-clipboard
|
2020-04-22 22:13:03 +02:00
|
|
|
grim
|
|
|
|
slurp
|
2020-05-09 18:45:10 +02:00
|
|
|
light
|
2020-04-22 22:13:03 +02:00
|
|
|
imv
|
|
|
|
kanshi
|
2020-05-09 13:53:59 +02:00
|
|
|
kitty
|
2020-04-22 22:13:03 +02:00
|
|
|
];
|
|
|
|
extraSessionCommands = ''
|
2020-05-16 05:20:59 +02:00
|
|
|
export MOZ_ENABLE_WAYLAND=1
|
2020-05-14 02:09:23 +02:00
|
|
|
export MOZ_DBUS_REMOTE=1
|
2020-04-22 22:13:03 +02:00
|
|
|
export GRIM_DEFAULT_DIR=/home/coolneng/Photos/Screenshots
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
export QT_QPA_PLATFORM=wayland
|
|
|
|
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
|
|
|
export SDL_VIDEODRIVER=wayland
|
2020-05-19 13:26:50 +02:00
|
|
|
export GTK_THEME=Adapta-Eta
|
2020-04-22 22:13:03 +02:00
|
|
|
'';
|
|
|
|
};
|
2020-05-10 03:13:30 +02:00
|
|
|
|
2020-05-09 18:45:10 +02:00
|
|
|
# Backlight
|
|
|
|
programs.light.enable = true;
|
|
|
|
|
2020-04-22 22:13:03 +02:00
|
|
|
# Blue light filter
|
2020-05-11 06:39:22 +02:00
|
|
|
location = {
|
|
|
|
latitude = 35.89;
|
|
|
|
longitude = -5.32;
|
|
|
|
provider = "manual";
|
|
|
|
};
|
|
|
|
|
2020-04-22 22:13:03 +02:00
|
|
|
services.redshift = {
|
|
|
|
package = pkgs.redshift-wlr;
|
|
|
|
enable = true;
|
|
|
|
temperature = {
|
|
|
|
day = 6500;
|
2020-05-11 06:39:22 +02:00
|
|
|
night = 5300;
|
2020-04-22 22:13:03 +02:00
|
|
|
};
|
|
|
|
};
|
2020-05-09 18:45:10 +02:00
|
|
|
|
2020-04-22 22:13:03 +02:00
|
|
|
# Bar
|
|
|
|
programs.waybar.enable = true;
|
2020-05-10 03:13:30 +02:00
|
|
|
|
|
|
|
# GPG agent
|
2020-05-14 02:09:23 +02:00
|
|
|
programs.gnupg.agent = {
|
|
|
|
enable = true;
|
2020-05-19 13:26:50 +02:00
|
|
|
pinentryFlavor = "gtk2";
|
2020-05-14 02:09:23 +02:00
|
|
|
};
|
2020-05-15 03:43:23 +02:00
|
|
|
|
|
|
|
# Tmux
|
|
|
|
programs.tmux = {
|
|
|
|
enable = true;
|
|
|
|
historyLimit = 5000;
|
|
|
|
keyMode = "vi";
|
|
|
|
shortcut = "x";
|
|
|
|
terminal = "screen-256";
|
|
|
|
baseIndex = 1;
|
2020-06-05 14:38:58 +02:00
|
|
|
extraConfig = tmux_config;
|
2020-05-15 03:43:23 +02:00
|
|
|
};
|
2020-05-23 15:43:54 +02:00
|
|
|
|
|
|
|
# Automount external storage
|
2020-05-28 03:02:44 +02:00
|
|
|
services.autofs = {
|
|
|
|
enable = true;
|
|
|
|
timeout = 5;
|
|
|
|
autoMaster = let
|
|
|
|
mapConf = pkgs.writeText "auto" ''
|
|
|
|
usb -fstype=auto :/dev/sdb1
|
|
|
|
sdcard -fstype=auto :/dev/mmcblk0p1
|
|
|
|
'';
|
|
|
|
in ''
|
|
|
|
/media file:${mapConf} --timeout=5
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# Upgrade Doom Emacs daily
|
|
|
|
systemd.user.services.doom-upgrade = {
|
|
|
|
description = "Upgrade Doom Emacs";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
path = [ pkgs.emacs pkgs.git ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
2020-06-23 01:30:21 +02:00
|
|
|
ExecStart =
|
|
|
|
"/bin/sh /home/coolneng/.emacs.d/bin/doom -y upgrade ; /bin/sh /home/coolneng/.emacs.d/bin/doom -y update";
|
2020-05-28 03:02:44 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.timers.doom-upgrade = {
|
|
|
|
description = "Daily upgrade of Doom Emacs";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "20:00:00";
|
|
|
|
Unit = "doom-upgrade.service";
|
|
|
|
};
|
|
|
|
};
|
2020-05-23 15:43:54 +02:00
|
|
|
|
2020-06-05 14:38:58 +02:00
|
|
|
# Clean up Doom Emacs monthly
|
|
|
|
systemd.user.services.doom-purge = {
|
|
|
|
description = "Purge Doom Emacs";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
path = [ pkgs.emacs pkgs.git ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = "/bin/sh /home/coolneng/.emacs.d/bin/doom purge";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.timers.doom-purge = {
|
|
|
|
description = "Monthly purge of Doom Emacs";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "13 22:00:00";
|
|
|
|
Unit = "doom-purge.service";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Upgrade Neovim plugins weekly
|
|
|
|
systemd.user.services.vim-plug-upgrade = {
|
|
|
|
description = "Upgrade Vim-Plug";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
path = [ pkgs.git pkgs.neovim ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = "${pkgs.neovim}/bin/nvim +PlugUpgrade +PlugUpdate +qa";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.user.timers.vim-plug-upgrade = {
|
|
|
|
description = "Weekly upgrade of Vim-Plug";
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "Wed 18:00:00";
|
|
|
|
Unit = "vim-plug-upgrade.service";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-22 22:13:03 +02:00
|
|
|
}
|