feat: add host IROH, improve hyprland config, add ausweisapp

This commit is contained in:
Jacob Bachmann 2024-03-25 15:51:13 +01:00
parent 7c5af81e75
commit 1e8844c6a3
Signed by: bchmnn
GPG key ID: 732A612DAD28067D
18 changed files with 554 additions and 73 deletions

View file

@ -6,7 +6,7 @@
./programs
] ++ optionals (gui.enable && elem "sway" gui.flavour) [
./sway
] ++ optionals (gui.enable && elem "hyprland" gui.flavour) [
] ++ optionals (gui.enable && elem "Hyprland" gui.flavour) [
./hyprland
] ++ optionals (gui.enable && elem "i3" gui.flavour) [
./i3

View file

@ -1,18 +1,78 @@
{ pkgs, lib, nixosConfig, ... }:
{ pkgs, lib, nixosConfig, hy3, ... }:
let
common = (import ../common.nix) { pkgs = pkgs; lib = lib; };
dropterm = rec {
class = "alacritty-dropterm";
name = "toggle-${class}";
package = pkgs.writeShellScriptBin name ''
TOGGLE=/tmp/${class}
WINDOW=$(${pkgs.hyprland}/bin/hyprctl -j clients | ${pkgs.jq}/bin/jq 'any(.[]; .class == "${class}")')
if [ -f "$TOGGLE" ]; then
if [ $WINDOW == "true" ]; then
${pkgs.hyprland}/bin/hyprctl --batch \
"dispatch movewindowpixel 0 -700,${class}; dispatch pin ${class}; dispatch cyclenext"
rm $TOGGLE
else
${pkgs.alacritty}/bin/alacritty --class=${class} & disown
fi
else
if [ $WINDOW == "true" ]; then
${pkgs.hyprland}/bin/hyprctl --batch \
"dispatch movewindowpixel 0 700,${class}; dispatch pin ${class}; dispatch focuswindow ${class}"
else
${pkgs.alacritty}/bin/alacritty --class=${class} & disown
fi
touch $TOGGLE
fi
'';
bin = "${package}/bin/${name}";
};
in
{
imports = [
../sway/waybar.nix
../sway/wofi.nix
];
home.packages = with pkgs; [
brightnessctl # this program allows you read and control device brightness
pavucontrol # pulseaudio volume control
playerctl # command-line utility and library for controlling media players that implement mpris
networkmanagerapplet # networkmanager control applet for gnome
udiskie # removable disk automounter for udisks
dracula-theme # dracula variant of the ant theme
gnome3.adwaita-icon-theme
wl-clipboard # command-line copy/paste utilities for wayland
sway-contrib.grimshot # a helper for screenshots within sway
wdisplays # a graphical application for configuring displays in wayland compositors
wlr-randr # an xrandr clone for wlroots compositors
kanshi # dynamic display configuration tool
nextcloud-client # nextcloud themed desktop client
libsForQt5.kdeconnect-kde # kde connect provides several features to integrate your phone and your computer
system-config-printer # graphical user interface for cups administration
emote # modern emoji picker for linux
];
programs.swaylock = {
enable = true;
# package = pkgs.swaylock-effects;
};
wayland.windowManager.hyprland = {
enable = true;
enableNvidiaPatches = nixosConfig.bchmnn.nvidia.enable;
# plugins = [ hy3.packages.x86_64-linux.hy3 ];
plugins = [ hy3.packages.x86_64-linux.hy3 ];
settings = {
env = with lib; with nixosConfig.bchmnn; optionals nvidia.enable [
"LIBVA_DRIVER_NAME,nvidia"
"env = XDG_SESSION_TYPE,wayland"
"GBM_BACKEND,nvidia-drm"
"__GLX_VENDOR_LIBRARY_NAME,nvidia"
"WLR_NO_HARDWARE_CURSORS,1"
];
"exec-once" = with pkgs; [
"${swaybg}/bin/swaybg -m fill -i ${common.wallpaper}"
"${waybar}/bin/waybar"
"${dbus}/bin/dbus-update-activation-environment --all"
"${kanshi}/bin/kanshi"
@ -33,6 +93,7 @@ in
};
};
general = {
layout = "hy3";
border_size = "2";
gaps_out = "5";
gaps_in = "5";
@ -46,15 +107,38 @@ in
shadow_scale = "0.5"; # float [0.0-1.0]
"col.shadow" = "rgba(00000099)";
};
plugin = {
hy3 = {
tabs = {
height = 20;
text_font = common.font;
text_height = 12;
"col.active" = "0xffffdeeb"; # common.colorschemes.default.active;
"col.urgent" = "0xffc92a2a"; # common.colorschemes.default.alert;
"col.inactive" = "0xff212529"; # common.colorschemes.default.inactiveDark;
"col.text.active" = "0xff000000"; # common.colorschemes.default.black;
"col.text.urgent" = "0xffffffff"; # common.colorschemes.default.white;
"col.text.inactive" = "0xffffffff"; # common.colorschemes.default.white;
};
};
};
"$terminal" = "${pkgs.alacritty}/bin/alacritty";
"$fileManager" = "${pkgs.gnome.nautilus}/bin/nautilus";
"$menu" = "${pkgs.wofi}/bin/wofi";
"$mod" = "SUPER";
windowrule = [
"float, ${dropterm.class}"
"size 96% 33%, ${dropterm.class}"
"move 2% 50, ${dropterm.class}"
];
bind = [
"$mod, grave, exec, ${dropterm.bin}"
"$mod, escape, exec, ${dropterm.bin}"
"$mod, Q, killactive,"
"$mod, return, exec, $terminal"
"$mod SHIFT, Q, exit,"
"$mod SHIFT, E, exec, $fileManager"
"$mod, F, fullscreen,"
"$mod, D, togglefloating,"
"$mod, space, exec, $menu"
"$mod CONTROL SHIFT, L, exec, ${pkgs.swaylock-effects}/bin/swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 7 --effect-blur 7x5 --effect-vignette 0.5:0.5 --ring-color ffffff --key-hl-color ${common.colorschemes.default._activeDark} --line-color 00000000 --inside-color 00000088 --inside-ver-color ${common.colorschemes.default._activeDark} --separator-color 00000000 --text-color ${common.colorschemes.default._activeDark} --fade-in 0.1"
@ -63,23 +147,21 @@ in
"$mod SHIFT, N, exec, ${pkgs.networkmanagerapplet}/bin/nm-connection-editor"
"$mod SHIFT, A, exec, ${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw"
"$mod, period, exec, ${pkgs.emote}/bin/emote"
# bind = $mod, P, pseudo, # dwindle
# bind = $mod, J, togglesplit, # dwindle
# Move focus
"$mod, H, movefocus, l"
"$mod, L, movefocus, r"
"$mod, K, movefocus, u"
"$mod, J, movefocus, d"
"$mod, H, hy3:movefocus, l"
"$mod, L, hy3:movefocus, r"
"$mod, K, hy3:movefocus, u"
"$mod, J, hy3:movefocus, d"
"$mod, P, focusmonitor, l"
"$mod, N, focusmonitor, r"
# Move windows
"$mod SHIFT, H, movewindow, l"
"$mod SHIFT, J, movewindow, d"
"$mod SHIFT, K, movewindow, u"
"$mod SHIFT, L, movewindow, r"
"$mod SHIFT, H, hy3:movewindow, l"
"$mod SHIFT, J, hy3:movewindow, d"
"$mod SHIFT, K, hy3:movewindow, u"
"$mod SHIFT, L, hy3:movewindow, r"
# Switch workspaces
"$mod, 1, workspace, 1"
@ -111,7 +193,10 @@ in
"$mod CONTROL SHIFT, J, movecurrentworkspacetomonitor, l"
"$mod CONTROL SHIFT, K, movecurrentworkspacetomonitor, r"
"$mod, W, togglegroup,"
"$mod, W, hy3:changegroup, toggletab"
"$mod, B, hy3:makegroup, h"
"$mod, V, hy3:makegroup, v"
", print, exec, ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"
];

View file

@ -9,7 +9,7 @@ let
};
spotify = pkgs.fetchurl {
url = "https://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Spotify_icon.svg/232px-Spotify_icon.svg.png";
sha256 = "0568b108bf4533e7382e0f3526e211308868d2d2aa35ab8f0cc7beb464e70d5f";
sha256 = "4251a663072b97fe5434638d9c58bbe20c2aea6da44e8d614f664b324ffe9e73";
meta.licenses = lib.licenses.publicDomain;
};
teams = pkgs.fetchurl {
@ -84,3 +84,4 @@ in
};
}

View file

@ -14,30 +14,28 @@
];
};
/*
gaming = {
iroh = {
outputs = [
{
criteria = "LVDS-1";
status = "disable";
}
{
criteria = "Dell Inc. DELL U2515H 9X2VY5490XUL";
status = "disable";
}
{
criteria = "Dell Inc. DELL U2515H 9X2VY5C7138L";
criteria = "DP-3";
status = "enable";
mode = "1920x1080";
mode = "2560x1440";
position = "0,0";
}
{
criteria = "HJW VGA TO HDMI 0x00000100";
status = "disable";
criteria = "DP-2";
status = "enable";
mode = "2560x1440";
position = "2560,0";
}
{
criteria = "DP-1";
status = "enable";
mode = "2560x1440";
position = "5120,0";
}
];
};
*/
station = {
outputs = [

View file

@ -5,8 +5,12 @@
settings.mainBar = {
layer = "top";
margin = "5 5 5 5";
modules-left = [ "sway/workspaces" "sway/window" "sway/mode"
# "hyprland/workspaces" "hyprland/window"
modules-left = [
"sway/workspaces"
"sway/window"
"sway/mode"
"hyprland/workspaces"
"hyprland/window"
];
modules-center = [ "clock" ];
modules-right = [ "tray" "network" "pulseaudio" "custom/mem" "temperature" "backlight" "battery" ];