dotfiles/home-manager/modules/home-manager.nix

194 lines
4.4 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }: {
2022-09-26 22:50:43 +00:00
home.username = "opdavies";
home.homeDirectory = "/home/opdavies";
home.stateVersion = "22.05";
programs.home-manager.enable = true;
2023-06-15 18:00:45 +00:00
services.swayidle = {
enable = true;
2023-06-15 18:00:45 +00:00
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock}/bin/swaylock --daemonize --image ~/.config/wallpaper/wallpaper.jpg";
}
];
};
services.swayidle.timeouts = [
{
2023-06-15 18:00:45 +00:00
timeout = 300;
command = "${pkgs.swaylock}/bin/swaylock --daemonize --image ~/.config/wallpaper/wallpaper.jpg";
}
2023-06-15 18:00:45 +00:00
{
2023-06-15 18:00:45 +00:00
timeout = 600;
command = "swaymsg 'output * dpms off'";
resumeCommand = "swaymsg 'output * dpms on'";
}
];
2023-06-15 18:00:45 +00:00
programs.swaylock = {
enable = true;
settings = {
daemonize = true;
image = "~/.config/wallpaper/wallpaper.jpg";
};
};
2023-06-15 18:00:45 +00:00
wayland.windowManager.sway = {
enable = true;
2023-06-15 18:00:45 +00:00
config = {
assigns = {
"1" = [{ app_id = "firefox"; }];
"2" = [{ app_id = "Alacritty"; }];
"3" = [{ class = "vlc"; }];
"10" = [
{ class = "Slack"; }
{ class = "discord"; }
];
# Get app_id with swaymsg -t get_tree
};
2023-06-15 18:00:45 +00:00
bars = [
{
colors = {
2023-07-18 19:21:59 +00:00
background = "#222222";
2023-06-15 18:00:45 +00:00
focusedWorkspace = {
background = "#ffffff";
border = "#ffffff";
text = "#333333";
};
statusline = "#ffffff";
};
2023-06-15 18:00:45 +00:00
fonts = {
names = [ "DejaVu Sans Mono" ];
size = 16.0;
};
2023-06-15 18:00:45 +00:00
statusCommand = "i3status-rs ~/.config/i3status-rust/config-default.toml";
trayPadding = 10;
}
];
2023-06-15 18:00:45 +00:00
gaps = {
inner = 10;
smartBorders = "on";
smartGaps = true;
};
2023-06-15 18:00:45 +00:00
input = {
"*" = {
xkb_layout = "gb";
};
2023-06-15 18:00:45 +00:00
"type:touchpad" = {
dwt = "enabled";
tap = "enabled";
};
2023-06-13 18:51:56 +00:00
};
2023-06-15 18:00:45 +00:00
keybindings =
let modifier = config.wayland.windowManager.sway.config.modifier;
in lib.mkOptionDefault {
"${modifier}+Escape" = "exec swaylock --daemonize";
"${modifier}+Shift+b" = "exec firefox";
"${modifier}+tab" = "workspace back_and_forth";
};
2023-06-15 18:00:45 +00:00
menu = "wofi --show run";
modifier = "Mod4";
output = {
"*" = {
bg = "~/.config/wallpaper/wallpaper.jpg fill";
};
2023-06-15 18:00:45 +00:00
eDP-1 = {
scale = "1.0";
};
};
2023-06-15 18:00:45 +00:00
terminal = "alacritty";
2023-06-15 18:00:45 +00:00
window.border = 3;
};
2023-06-15 18:00:45 +00:00
extraConfig = ''
set $laptop eDP-1
bindswitch --reload --locked lid:on output $laptop disable
bindswitch --reload --locked lid:off output $laptop enable
2023-06-15 18:00:45 +00:00
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
2023-06-15 18:00:45 +00:00
for_window [class="vlc"] inhibit_idle fullscreen
'';
};
programs.i3status-rust = {
enable = true;
bars = {
default = {
blocks = [
{
block = "net";
format = " $ip ";
}
{
block = "battery";
format = " $icon $percentage $time ";
}
{
block = "cpu";
}
{
block = "memory";
format = " $icon $mem_total_used_percents.eng(w:2) ";
format_alt = " $icon_swap $swap_used_percents.eng(w:2) ";
}
{
block = "disk_space";
path = "/";
info_type = "available";
alert_unit = "GB";
interval = 20;
warning = 20.0;
alert = 10.0;
format = " $icon $available.eng(w:2) ";
}
{
block = "time";
interval = 1;
format = " $timestamp.datetime(f:'%F %T') ";
}
];
settings = {
theme = {
theme = "plain";
overrides = {
2023-07-18 19:21:59 +00:00
critical_bg = "#222222";
good_bg = "#222222";
good_fg = "#ffffff";
2023-07-18 19:21:59 +00:00
idle_bg = "#222222";
idle_fg = "#ffffff";
2023-07-18 19:21:59 +00:00
info_bg = "#222222";
info_fg = "#ffffff";
2023-07-18 19:21:59 +00:00
separator_bg = "#222222";
warning_bg = "#222222";
warning_fg = "#ffffff";
};
};
};
};
};
};
2022-09-26 22:50:43 +00:00
}