2023-08-04 13:08:58 +02:00
|
|
|
{ home-manager, lib, pkgs, ... }: {
|
2023-08-01 15:35:09 +02:00
|
|
|
# https://nixos.wiki/wiki/Sway
|
|
|
|
# https://nix-community.github.io/home-manager/options.html
|
|
|
|
|
2023-08-04 13:08:58 +02:00
|
|
|
security.polkit.enable = true;
|
|
|
|
|
2023-08-01 15:35:09 +02:00
|
|
|
home-manager.users.caspervk = {
|
|
|
|
wayland.windowManager.sway = {
|
|
|
|
enable = true;
|
|
|
|
config = {
|
|
|
|
input = {
|
2023-08-12 15:49:21 +02:00
|
|
|
"type:keyboard" = {
|
2023-08-01 15:35:09 +02:00
|
|
|
xkb_layout = "us";
|
|
|
|
xkb_variant = "altgr-intl";
|
2023-08-04 13:08:58 +02:00
|
|
|
repeat_delay = "250";
|
2023-08-12 15:49:21 +02:00
|
|
|
};
|
|
|
|
"type:touchpad" = {
|
2023-08-01 15:35:09 +02:00
|
|
|
tap = "enabled";
|
|
|
|
natural_scroll = "enable";
|
2023-08-01 16:55:53 +02:00
|
|
|
dwt = "disabled"; # don't disable-while-typing
|
2023-08-01 15:35:09 +02:00
|
|
|
};
|
2023-08-12 18:44:46 +02:00
|
|
|
"type:pointer" = {
|
2023-08-14 01:46:41 +02:00
|
|
|
pointer_accel = "0.1"; # pointer SPEED, not acceleration
|
|
|
|
};
|
|
|
|
};
|
|
|
|
output = {
|
|
|
|
"*" = {
|
|
|
|
bg = "${./img/background.png} fill";
|
2023-08-12 18:44:46 +02:00
|
|
|
};
|
2023-08-01 15:35:09 +02:00
|
|
|
};
|
2023-08-01 16:55:53 +02:00
|
|
|
modifier = "Mod4"; # super
|
2023-08-04 13:08:58 +02:00
|
|
|
keybindings = lib.mkOptionDefault {
|
2023-08-08 18:18:16 +02:00
|
|
|
"Mod4+x" = "focus child";
|
2023-08-04 13:08:58 +02:00
|
|
|
"Mod4+Escape" = "exec loginctl lock-session";
|
|
|
|
|
2023-08-12 18:44:46 +02:00
|
|
|
# Move workspace between outputs
|
|
|
|
"Mod4+Control+Shift+h" = "move workspace to output left";
|
|
|
|
"Mod4+Control+Shift+l" = "move workspace to output right";
|
|
|
|
|
2023-08-04 13:08:58 +02:00
|
|
|
# Brightness
|
|
|
|
"XF86MonBrightnessUp" = "exec light -A 5";
|
|
|
|
"XF86MonBrightnessDown" = "exec light -U 5";
|
|
|
|
|
|
|
|
# Volume
|
|
|
|
"XF86AudioRaiseVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ +2%'";
|
|
|
|
"XF86AudioLowerVolume" = "exec 'pactl set-sink-volume @DEFAULT_SINK@ -2%'";
|
|
|
|
"XF86AudioMute" = "exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'";
|
2023-08-13 19:29:18 +02:00
|
|
|
|
|
|
|
# Media
|
|
|
|
"XF86AudioPlay" = "exec 'playerctl play-pause'";
|
|
|
|
"XF86AudioNext" = "exec 'playerctl next'";
|
|
|
|
"XF86AudioPrev" = "exec 'playerctl previous'";
|
2023-08-04 13:08:58 +02:00
|
|
|
};
|
2023-08-14 01:46:41 +02:00
|
|
|
focus = {
|
|
|
|
followMouse = "no";
|
|
|
|
};
|
2023-08-01 15:35:09 +02:00
|
|
|
terminal = "alacritty";
|
|
|
|
workspaceAutoBackAndForth = true;
|
2023-08-04 13:08:58 +02:00
|
|
|
bars = [{ command = "${pkgs.waybar}/bin/waybar"; }];
|
2023-08-01 15:35:09 +02:00
|
|
|
};
|
|
|
|
};
|
2023-08-04 13:08:58 +02:00
|
|
|
|
|
|
|
programs.waybar =
|
|
|
|
let
|
|
|
|
mkDefaultConfig = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "waybarDefaultConfig";
|
|
|
|
src = "${pkgs.waybar}/etc/xdg/waybar";
|
|
|
|
installPhase = ''
|
|
|
|
sed 's#//.*##' config | ${pkgs.jq}/bin/jq > $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
defaultConfig = builtins.fromJSON (lib.readFile "${mkDefaultConfig}");
|
|
|
|
in
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
bar = lib.mkMerge [
|
|
|
|
defaultConfig
|
|
|
|
{
|
|
|
|
modules-right = lib.mkForce [ "tray" "idle_inhibitor" "pulseaudio" "cpu" "memory" "backlight" "network" "battery" "clock" ];
|
2023-08-04 13:38:13 +02:00
|
|
|
battery = {
|
|
|
|
states = lib.mkForce {
|
|
|
|
warning = 15;
|
|
|
|
critical = 5;
|
|
|
|
};
|
|
|
|
};
|
2023-08-04 13:08:58 +02:00
|
|
|
clock = {
|
|
|
|
interval = 5;
|
|
|
|
locale = "da_DK.UTF-8";
|
|
|
|
format = "{:%a %e. %b %H:%M}";
|
|
|
|
calendar = {
|
|
|
|
mode = "year";
|
|
|
|
mode-mon-col = 6;
|
|
|
|
weeks-pos = "left";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
backlight = {
|
|
|
|
format-icons = lib.mkForce [ "" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-08-14 01:46:41 +02:00
|
|
|
programs.swaylock = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
image = "${./img/lockscreen.png}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-08-04 13:08:58 +02:00
|
|
|
services.swayidle =
|
|
|
|
let
|
2023-08-14 01:46:41 +02:00
|
|
|
lock = "${pkgs.swaylock}/bin/swaylock --daemonize";
|
2023-08-04 13:08:58 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
events = [
|
|
|
|
{ event = "lock"; command = lock; }
|
|
|
|
{ event = "before-sleep"; command = lock; }
|
|
|
|
];
|
|
|
|
timeouts = [
|
|
|
|
{ timeout = 600; command = lock; }
|
|
|
|
];
|
|
|
|
};
|
2023-08-13 19:43:24 +02:00
|
|
|
|
|
|
|
services.kanshi = {
|
|
|
|
enable = true;
|
|
|
|
profiles = {
|
|
|
|
# Output names ("criteria") from `swaymsg -t get_outputs`.
|
2023-08-14 02:40:13 +02:00
|
|
|
omega.outputs = [
|
2023-08-13 19:43:24 +02:00
|
|
|
{
|
|
|
|
criteria = "ASUSTek COMPUTER INC ROG XG27AQ M3LMQS370969";
|
|
|
|
mode = "2560x1440@144Hz";
|
|
|
|
position = "0,0";
|
|
|
|
adaptiveSync = true;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
criteria = "BNQ BenQ XL2411Z SCD06385SL0";
|
|
|
|
mode = "1920x1080@144Hz";
|
|
|
|
position = "2560,0";
|
|
|
|
}
|
|
|
|
];
|
2023-08-14 02:40:13 +02:00
|
|
|
zeta.outputs = [
|
|
|
|
{
|
|
|
|
criteria = "Chimei Innolux Corporation 0x14D2 Unknown";
|
|
|
|
mode = "1920x1080@60Hz";
|
|
|
|
}
|
|
|
|
];
|
2023-08-13 19:43:24 +02:00
|
|
|
};
|
|
|
|
};
|
2023-08-01 15:35:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
alacritty
|
2023-08-04 13:08:58 +02:00
|
|
|
clipman
|
2023-08-11 19:33:39 +02:00
|
|
|
gnome3.adwaita-icon-theme # cursor
|
2023-08-13 19:29:18 +02:00
|
|
|
grim # screenshot
|
2023-08-04 13:08:58 +02:00
|
|
|
pavucontrol # PulseAudio Volume Control
|
2023-08-13 19:29:18 +02:00
|
|
|
playerctl # media control
|
2023-08-08 22:07:48 +02:00
|
|
|
pulseaudio # pactl
|
2023-08-13 19:29:18 +02:00
|
|
|
slurp # wayland region selector; for grim(shot)
|
2023-08-04 13:08:58 +02:00
|
|
|
swaylock
|
2023-08-12 18:44:46 +02:00
|
|
|
wdisplays
|
2023-08-14 02:40:13 +02:00
|
|
|
wl-mirror # screen mirroing; wl-mirror (slurp -f%o -o)
|
2023-08-13 19:29:18 +02:00
|
|
|
wl-clipboard # wl-copy/wl-paste commands
|
2023-08-01 15:35:09 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
# Audio
|
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
|
|
|
alsa = {
|
|
|
|
enable = true;
|
|
|
|
support32Bit = true;
|
|
|
|
};
|
|
|
|
jack.enable = true;
|
|
|
|
pulse.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Video
|
2023-08-01 16:55:53 +02:00
|
|
|
programs.light.enable = true; # allows controlling screen brightness
|
2023-08-01 15:35:09 +02:00
|
|
|
|
|
|
|
# Allow sharing screen
|
|
|
|
#xdg.portal.wlr.enable = true;
|
2023-08-01 16:49:22 +02:00
|
|
|
|
2023-08-04 13:08:58 +02:00
|
|
|
security.pam.services.swaylock.text = ''
|
|
|
|
# PAM configuration file for the swaylock screen locker. By default, it includes
|
|
|
|
# the 'login' configuration file (see /etc/pam.d/login)
|
|
|
|
auth include login
|
|
|
|
'';
|
2023-08-01 16:49:22 +02:00
|
|
|
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
2023-08-01 16:55:53 +02:00
|
|
|
extraPackages = with pkgs; [ intel-media-driver ];
|
2023-08-01 16:49:22 +02:00
|
|
|
};
|
2023-08-04 13:08:58 +02:00
|
|
|
|
|
|
|
fonts.fonts = with pkgs; [
|
|
|
|
noto-fonts
|
|
|
|
noto-fonts-cjk
|
|
|
|
noto-fonts-emoji
|
|
|
|
liberation_ttf
|
|
|
|
fira-code
|
|
|
|
fira-code-symbols
|
|
|
|
mplus-outline-fonts.githubRelease
|
|
|
|
dina-font
|
|
|
|
proggyfonts
|
|
|
|
font-awesome # for waybar
|
|
|
|
];
|
2023-08-01 15:35:09 +02:00
|
|
|
}
|