Compare commits

...

6 Commits

7 changed files with 211 additions and 147 deletions

View File

@ -3,9 +3,38 @@
pkgs, pkgs,
... ...
}: { }: {
home.file."${config.xdg.configHome}/mpv" = { home.file."${config.xdg.configHome}/mpv/scripts".source = ./files/scripts;
source = ./files; home.file."${config.xdg.configHome}/mpv/fonts".source = ./files/fonts;
recursive = true;
programs.mpv = {
enable = true;
config = {
osc = false;
save-position-on-quit = true;
sub-auto = "fuzzy";
sub-font-size = 46;
profile = "gpu-hq";
scale = "ewa_lanczossharp";
cscale = "ewa_lanczossharp";
video-sync = "display-resample";
interpolation = true;
tscale = "oversample";
vo = "gpu";
hwdec = "auto";
force-window = true;
keep-open = true;
};
bindings = {
"Ctrl+Shift+r" = "add sub-scale +0.05";
"Ctrl+r" = "add sub-scale -0.05";
"Ctrl+Alt+r" = "set sub-scale 1";
};
profiles.Idle = {
profile-cond = ''p["idle-active"]'';
profile-restore = "copy-equal";
title = "' '";
keepaspect = false;
background = "none";
};
}; };
programs.mpv = {enable = true;};
} }

View File

@ -1,20 +0,0 @@
osc=no
save-position-on-quit=yes
sub-auto=fuzzy
profile=gpu-hq
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
video-sync=display-resample
interpolation
tscale=oversample
vo=gpu
hwdec=auto
force-window=yes
keep-open=yes
[Idle]
profile-cond=p["idle-active"]
profile-restore=copy-equal
title=' '
keepaspect=no
background=none

View File

@ -1,4 +1,8 @@
{pkgs, scale ? null, ...}: let {
pkgs,
scale ? null,
...
}: let
terminal = "${pkgs.foot}/bin/footclient"; terminal = "${pkgs.foot}/bin/footclient";
nautilus = "${pkgs.nautilus}/bin/nautilus"; nautilus = "${pkgs.nautilus}/bin/nautilus";
playerctl = "${pkgs.playerctl}/bin/playerctl"; playerctl = "${pkgs.playerctl}/bin/playerctl";
@ -53,6 +57,9 @@
in { in {
# Since native Home Manager doesn't have a programs.niri module yet, # Since native Home Manager doesn't have a programs.niri module yet,
# we generate the KDL configuration file directly. # we generate the KDL configuration file directly.
home.packages = with pkgs; [
wl-clipboard
];
programs.hyprlock = { programs.hyprlock = {
enable = true; enable = true;
settings = { settings = {
@ -85,140 +92,144 @@ in {
}; };
xdg.configFile."niri/config.kdl".text = '' xdg.configFile."niri/config.kdl".text = ''
spawn-at-startup "${pkgs.swaybg}/bin/swaybg" "-i" "${../hyprland/files/wallpaper.png}" "-m" "fill" spawn-at-startup "${pkgs.swaybg}/bin/swaybg" "-i" "${../hyprland/files/wallpaper.png}" "-m" "fill"
spawn-at-startup "foot" "--server" spawn-at-startup "foot" "--server"
spawn-at-startup "ags" "run" spawn-at-startup "ags" "run"
spawn-at-startup "${pkgs.mate-polkit}/bin/polkit-mate" spawn-at-startup "${pkgs.mate-polkit}/bin/polkit-mate"
prefer-no-csd prefer-no-csd
hotkey-overlay { hotkey-overlay {
skip-at-startup skip-at-startup
} }
gestures { gestures {
hot-corners { hot-corners {
off off
}
}
layout {
gaps 5
border {
off
}
focus-ring {
width 4
active-color "rgba(0, 47, 95, 238)"
inactive-color "rgba(255, 255, 255, 0)"
}
}
input {
mouse {
accel-speed 0.5
}
touchpad {
tap
}
keyboard {
xkb {
options "compose:rctrl"
} }
} }
focus-follows-mouse max-scroll-amount="10%"
warp-mouse-to-focus
}
${if scale != null then ''
output "eDP-1" {
scale ${toString scale}
}
'' else ""} window-rule {
match app-id="vicinae"
open-floating true
}
binds {
// General Binds
Mod+Return { spawn "sh" "-c" "${launch_terminal}/bin/launch_terminal $(niri msg --json focused-window | ${pkgs.jq}/bin/jq .pid)"; }
Mod+Shift+Return { spawn "${terminal}"; }
Mod+Q { close-window; }
Mod+A { spawn "${nautilus}"; }
Mod+B { spawn "Helium"; }
Mod+M { maximize-column; }
Mod+F {maximize-window-to-edges;}
Mod+Tab { toggle-overview; }
// Vicinae Binds layout {
Mod+C { spawn "vicinae" "vicinae://extensions/vicinae/clipboard/history"; } gaps 5
Mod+N { spawn "vicinae" "vicinae://extensions/vicinae/wm/switch-windows"; } border {
Mod+Escape { spawn "vicinae" "open" "-q" "Power Management "; } off
Mod+Space { spawn "vicinae" "toggle"; } }
focus-ring {
width 4
active-color "rgba(0, 47, 95, 238)"
inactive-color "rgba(255, 255, 255, 0)"
}
}
Mod+Comma { consume-or-expel-window-left; } input {
Mod+Period { consume-or-expel-window-right; } mouse {
accel-speed 0.5
}
touchpad {
tap
}
keyboard {
xkb {
options "compose:rctrl"
}
}
focus-follows-mouse max-scroll-amount="10%"
warp-mouse-to-focus
}
${
if scale != null
then ''
output "eDP-1" {
scale ${toString scale}
}
''
else ""
} window-rule {
match app-id="vicinae"
open-floating true
}
Mod+Alt+H { set-column-width "-5%"; } binds {
Mod+Alt+L { set-column-width "+5%"; } // General Binds
Mod+Alt+K { set-window-height "-5%"; } Mod+Return { spawn "sh" "-c" "${launch_terminal}/bin/launch_terminal $(niri msg --json focused-window | ${pkgs.jq}/bin/jq .pid)"; }
Mod+Alt+J { set-window-height "+5%"; } Mod+Shift+Return { spawn "${terminal}"; }
Mod+Q { close-window; }
Mod+A { spawn "${nautilus}"; }
Mod+B { spawn "Helium"; }
Mod+M { maximize-column; }
Mod+F {maximize-window-to-edges;}
Mod+Tab { toggle-overview; }
// Movement // Vicinae Binds
Mod+H { focus-column-left; } Mod+C { spawn "vicinae" "vicinae://launch/clipboard/history"; }
Mod+J { focus-window-down; } Mod+N { spawn "vicinae" "vicinae://launch/wm/switch-windows"; }
Mod+K { focus-window-up; } Mod+Escape { spawn "vicinae" "open" "-q" "Power Management "; }
Mod+L { focus-column-right; } Mod+Space { spawn "vicinae" "toggle"; }
Mod+Shift+H { move-column-left; } Mod+Comma { consume-or-expel-window-left; }
Mod+Shift+L { move-column-right; } Mod+Period { consume-or-expel-window-right; }
Mod+Shift+J { move-window-down; }
Mod+Shift+K { move-window-up; }
// Workspaces Mod+Alt+H { set-column-width "-5%"; }
Mod+Shift+U { move-column-to-workspace-down; } Mod+Alt+L { set-column-width "+5%"; }
Mod+Shift+I { move-column-to-workspace-up; } Mod+Alt+K { set-window-height "-5%"; }
Mod+Alt+J { set-window-height "+5%"; }
Mod+I { focus-workspace-up; } // Movement
Mod+U { focus-workspace-down; } Mod+H { focus-column-left; }
Mod+1 { focus-workspace 1; } Mod+J { focus-window-down; }
Mod+2 { focus-workspace 2; } Mod+K { focus-window-up; }
Mod+3 { focus-workspace 3; } Mod+L { focus-column-right; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
// Move to workspace Mod+Shift+H { move-column-left; }
Mod+Shift+1 { move-column-to-workspace 1; } Mod+Shift+L { move-column-right; }
Mod+Shift+2 { move-column-to-workspace 2; } Mod+Shift+J { move-window-down; }
Mod+Shift+3 { move-column-to-workspace 3; } Mod+Shift+K { move-window-up; }
Mod+Shift+4 { move-column-to-workspace 4; }
Mod+Shift+5 { move-column-to-workspace 5; }
Mod+Shift+6 { move-column-to-workspace 6; }
Mod+Shift+7 { move-column-to-workspace 7; }
Mod+Shift+8 { move-column-to-workspace 8; }
Mod+Shift+9 { move-column-to-workspace 9; }
Print { screenshot; } // Workspaces
Ctrl+Alt+L {spawn "${pkgs.hyprlock}/bin/hyprlock"; } Mod+Shift+U { move-column-to-workspace-down; }
Mod+Shift+I { move-column-to-workspace-up; }
XF86MonBrightnessUp { spawn "${brightnessctl}" "set" "+10%"; } Mod+I { focus-workspace-up; }
XF86MonBrightnessDown { spawn "${brightnessctl}" "set" "10%-"; } Mod+U { focus-workspace-down; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
// Volume // Move to workspace
XF86AudioRaiseVolume { spawn "${wpctl}" "set-volume" "@DEFAULT_AUDIO_SINK@" "10%+" "--limit" "1.0"; } Mod+Shift+1 { move-column-to-workspace 1; }
XF86AudioLowerVolume { spawn "${wpctl}" "set-volume" "@DEFAULT_AUDIO_SINK@" "10%-"; } Mod+Shift+2 { move-column-to-workspace 2; }
XF86AudioMute { spawn "${wpctl}" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } Mod+Shift+3 { move-column-to-workspace 3; }
XF86AudioMicMute { spawn "${wpctl}" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } Mod+Shift+4 { move-column-to-workspace 4; }
Mod+Shift+5 { move-column-to-workspace 5; }
Mod+Shift+6 { move-column-to-workspace 6; }
Mod+Shift+7 { move-column-to-workspace 7; }
Mod+Shift+8 { move-column-to-workspace 8; }
Mod+Shift+9 { move-column-to-workspace 9; }
// Media Print { screenshot; }
XF86AudioNext { spawn "${playerctl}" "next"; } Ctrl+Alt+L {spawn "${pkgs.hyprlock}/bin/hyprlock"; }
XF86AudioPrev { spawn "${playerctl}" "previous"; }
Mod+XF86AudioMute { spawn "${playerctl}" "play-pause"; } XF86MonBrightnessUp { spawn "${brightnessctl}" "set" "+10%"; }
Mod+XF86AudioRaiseVolume { spawn "${playerctl}" "next"; } XF86MonBrightnessDown { spawn "${brightnessctl}" "set" "10%-"; }
Mod+XF86AudioLowerVolume { spawn "${playerctl}" "previous"; }
} // Volume
XF86AudioRaiseVolume { spawn "${wpctl}" "set-volume" "@DEFAULT_AUDIO_SINK@" "10%+" "--limit" "1.0"; }
XF86AudioLowerVolume { spawn "${wpctl}" "set-volume" "@DEFAULT_AUDIO_SINK@" "10%-"; }
XF86AudioMute { spawn "${wpctl}" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute { spawn "${wpctl}" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
// Media
XF86AudioNext { spawn "${playerctl}" "next"; }
XF86AudioPrev { spawn "${playerctl}" "previous"; }
Mod+XF86AudioMute { spawn "${playerctl}" "play-pause"; }
Mod+XF86AudioRaiseVolume { spawn "${playerctl}" "next"; }
Mod+XF86AudioLowerVolume { spawn "${playerctl}" "previous"; }
}
''; '';
} }

View File

@ -5,5 +5,27 @@
enable = true; enable = true;
autoStart = true; autoStart = true;
}; };
settings = {
font = {
normal = {
family = "Ubuntu Nerd Font";
size = 8;
};
};
theme = {
dark = {
name = "ayu-dark";
};
};
launcher_window = {
opacity = 0.95;
client_side_decorations = {
enabled = true;
border_width = 0;
rounding = 10;
shadow_size = 0;
};
};
};
}; };
} }

View File

@ -77,6 +77,10 @@
source ${./files/keys.zsh} source ${./files/keys.zsh}
eval "$(direnv hook zsh)" eval "$(direnv hook zsh)"
export LD_LIBRARY_PATH=${pkgs.sqlite.out}/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=${pkgs.sqlite.out}/lib:$LD_LIBRARY_PATH
# Fix zsh-vi-mode bracketed paste: the trailing ~ of \e[201~ leaks
# into vicmd and toggles case of the last pasted character.
bindkey -M viins '^[[200~' .bracketed-paste
bindkey -M vicmd '^[[200~' .bracketed-paste
} }
function o() { function o() {
${pkgs.handlr-regex}/bin/handlr open $@ < /dev/null &> /dev/null & disown ${pkgs.handlr-regex}/bin/handlr open $@ < /dev/null &> /dev/null & disown

View File

@ -89,8 +89,8 @@
# xplr # xplr shell (https://github.com/sayanarijit/xplr) # xplr # xplr shell (https://github.com/sayanarijit/xplr)
# vim_shell # vim shell indicator (:sh) # vim_shell # vim shell indicator (:sh)
# midnight_commander # midnight commander shell (https://midnight-commander.org/) # midnight_commander # midnight commander shell (https://midnight-commander.org/)
nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) # nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html)
vi_mode # vi mode (you don't need this if you've enabled prompt_char) # vi_mode # vi mode (you don't need this if you've enabled prompt_char)
# vpn_ip # virtual private network indicator # vpn_ip # virtual private network indicator
# load # CPU load # load # CPU load
# disk_usage # disk usage # disk_usage # disk usage

View File

@ -128,7 +128,7 @@ in {
peers = [ peers = [
{ {
publicKey = "/9ppjm3yeD0duDvxrqgcHscHmftXko+0s2RbivNEy2c="; publicKey = "/9ppjm3yeD0duDvxrqgcHscHmftXko+0s2RbivNEy2c=";
allowedIPs = ["0.0.0.0/0" "::/0"]; allowedIPs = ["0.0.0.0/0"];
endpoint = "external.thomasave.be:13231"; endpoint = "external.thomasave.be:13231";
persistentKeepalive = 25; persistentKeepalive = 25;
} }
@ -138,7 +138,7 @@ in {
address = ["10.0.0.5/24"]; address = ["10.0.0.5/24"];
privateKeyFile = "/home/user/.secrets/Wireguard/Aloria.key"; privateKeyFile = "/home/user/.secrets/Wireguard/Aloria.key";
listenPort = 51820; listenPort = 51820;
autostart = true; autostart = false;
postUp = "resolvectl dns OPNsense 10.0.0.1; resolvectl domain OPNsense ~thomasave.be;"; postUp = "resolvectl dns OPNsense 10.0.0.1; resolvectl domain OPNsense ~thomasave.be;";
dns = ["10.0.0.1"]; dns = ["10.0.0.1"];
peers = [ peers = [
@ -162,6 +162,7 @@ in {
enable = true; enable = true;
extraUpFlags = [ extraUpFlags = [
"--login-server=https://headscale.thomasave.be" "--login-server=https://headscale.thomasave.be"
"--accept-routes"
]; ];
authKeyFile = "/home/user/.secrets/Tailscale/Aloria/authkey"; authKeyFile = "/home/user/.secrets/Tailscale/Aloria/authkey";
}; };
@ -177,5 +178,22 @@ in {
"net.ipv6.conf.all.disable_ipv6" = 1; "net.ipv6.conf.all.disable_ipv6" = 1;
"net.ipv6.conf.default.disable_ipv6" = 1; "net.ipv6.conf.default.disable_ipv6" = 1;
"net.ipv6.conf.lo.disable_ipv6" = 1; "net.ipv6.conf.lo.disable_ipv6" = 1;
"net.ipv4.ip_forward" = 1;
"net.ipv4.conf.all.forwarding" = 1;
};
systemd.services.tailscale-ethtool-tweaks = {
description = "Apply ethtool tweaks for Tailscale subnet routing performance";
wantedBy = ["multi-user.target"];
after = ["network-online.target"];
wants = ["network-online.target"];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = pkgs.writeShellScript "tailscale-ethtool-tweaks" ''
NETDEV=$(${pkgs.iproute2}/bin/ip -o route get 1.1.1.1 | ${pkgs.coreutils}/bin/cut -f 5 -d " ")
${pkgs.ethtool}/bin/ethtool -K "$NETDEV" rx-udp-gro-forwarding on rx-gro-list off
'';
};
}; };
} }