diff --git a/custom/lf-sixel/default.nix b/custom/lf-sixel/default.nix index 5bd2977..aec00be 100644 --- a/custom/lf-sixel/default.nix +++ b/custom/lf-sixel/default.nix @@ -16,7 +16,7 @@ buildGoModule rec { hash = "sha256-FBjvZueSh9+grdDrD8DTOlJb6GaCQuJhrsOXRwlpDSQ="; }; - vendorSha256 = "sha256-oIIyQbw42+B6T6Qn6nIV62Xr+8ms3tatfFI8ocYNr0A="; + vendorHash = "sha256-oIIyQbw42+B6T6Qn6nIV62Xr+8ms3tatfFI8ocYNr0A="; nativeBuildInputs = [ installShellFiles ]; @@ -46,4 +46,4 @@ buildGoModule rec { platforms = platforms.unix; maintainers = with maintainers; [ dotlambda ]; }; -} \ No newline at end of file +} diff --git a/flake.lock b/flake.lock index 73f8212..294013c 100644 --- a/flake.lock +++ b/flake.lock @@ -169,11 +169,11 @@ ] }, "locked": { - "lastModified": 1699783872, - "narHash": "sha256-4zTwLT2LL45Nmo6iwKB3ls3hWodVP9DiSWxki/oewWE=", + "lastModified": 1702538064, + "narHash": "sha256-At5GwJPu2tzvS9dllhBoZmqK6lkkh/sOp2YefWRlaL8=", "owner": "nix-community", "repo": "home-manager", - "rev": "280721186ab75a76537713ec310306f0eba3e407", + "rev": "0e2e443ff24f9d75925e91b89d1da44b863734af", "type": "github" }, "original": { @@ -213,11 +213,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1702236723, - "narHash": "sha256-zIEnimM1vhsFkz+Kubb8kJ6YgHuLe56pALOSJc6CMVY=", + "lastModified": 1702576940, + "narHash": "sha256-oZAcNIJ9T49N9V+8HDRqPpSMp4R2+S+CO6iomsDYwU0=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "167f2ed3b2bb18ceeabb831ac80b655ef8e16867", + "rev": "f7cde9c92cb9e7c908f18ecf10ebdb366d0832b5", "type": "github" }, "original": { @@ -253,11 +253,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1700612854, - "narHash": "sha256-yrQ8osMD+vDLGFX7pcwsY/Qr5PUd6OmDMYJZzZi0+zc=", + "lastModified": 1702312524, + "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "19cbff58383a4ae384dea4d1d0c823d72b49d614", + "rev": "a9bf124c46ef298113270b1f84a164865987a91c", "type": "github" }, "original": { @@ -269,11 +269,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1699781429, - "narHash": "sha256-UYefjidASiLORAjIvVsUHG6WBtRhM67kTjEY4XfZOFs=", + "lastModified": 1702312524, + "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e44462d6021bfe23dfb24b775cc7c390844f773d", + "rev": "a9bf124c46ef298113270b1f84a164865987a91c", "type": "github" }, "original": { @@ -321,11 +321,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1702242258, - "narHash": "sha256-DSiwYD1DZY+YJALahnCVKacWk2AGy+s1pd3Z07tEF/U=", + "lastModified": 1702559747, + "narHash": "sha256-d6AmQp3M00WMPJquNfGVzIol5iojD1pi9slek+4N9VY=", "owner": "danth", "repo": "stylix", - "rev": "b5ad31b710294038f9ed70efdf787db6a82d7327", + "rev": "41d218597590a89324a4b7c50cf0bf088a7214ba", "type": "github" }, "original": { @@ -384,11 +384,11 @@ ] }, "locked": { - "lastModified": 1700508250, - "narHash": "sha256-X4o/mifI7Nhu0UKYlxx53wIC+gYDo3pVM9L2u3PE2bE=", + "lastModified": 1702334919, + "narHash": "sha256-ibOZ3TLjqndGMcj2f+07NFwDWoum4IbzF58byZuJJNg=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "eb120ff25265ecacd0fc13d7dab12131b60d0f47", + "rev": "f5c3576c3b6cb1c31a8dfa3e4113f59bfe40cd71", "type": "github" }, "original": { diff --git a/global/home.nix b/global/home.nix index ef5851c..3db58d4 100644 --- a/global/home.nix +++ b/global/home.nix @@ -35,6 +35,7 @@ in libnotify dig jq + ripgrep usbutils wl-clipboard du-dust diff --git a/hardware/zenix.nix b/hardware/zenix.nix index 14fd370..dcd322c 100644 --- a/hardware/zenix.nix +++ b/hardware/zenix.nix @@ -22,12 +22,16 @@ boot.initrd.postDeviceCommands = pkgs.lib.mkBefore '' mkdir -m 0755 -p /key - until cryptsetup luksOpen /dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0 usbkey + dev=/dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0 + sleep 1 + until cryptsetup luksOpen "$dev" usbkey do - echo "Failed to unlock usbkey!" - echo "Found block devices:" - ls /dev/disk/by-id/ - sleep 2 + echo "Insert key and press enter..." + read res + if test "$res" = "fzf" + then + ls /dev/disk/by-id | ${pkgs.fzf}/bin/fzf + fi done mount -n -t vfat -o ro /dev/mapper/usbkey /key ''; @@ -98,7 +102,6 @@ DP-1 = 5; }; - home.packages = with pkgs; [ monado openxr-loader ]; }]; } diff --git a/lib/modules/display.nix b/lib/modules/display.nix index 7bc4922..7257c79 100644 --- a/lib/modules/display.nix +++ b/lib/modules/display.nix @@ -3,13 +3,9 @@ with lib; let cfg = config.displays; - renderDisplaysForHyprland = displays: - "# === DISPLAY MODULE ===\n" - + concatStringsSep "\n" (map displayHyprlandSetting displays) - + "\n"; + renderDisplaysForHyprland = displays: (map displayHyprlandSetting displays); - displayHyprlandSetting = display: - "monitor = " + specificDisplay display + + displayHyprlandSetting = display: specificDisplay display + ", " + resToString display.resolution + ", " + positionToHyprlandString display.position + ", " + toString display.scaling + @@ -25,7 +21,7 @@ let concatStringsSep " " (map swaybgCmd displays); }; Install = { - WantedBy = ["graphical-session.target"]; + WantedBy = [ "graphical-session.target" ]; }; }; @@ -134,7 +130,7 @@ in config = mkIf cfg.enable { home-manager.users.${user}.imports = [ { - wayland.windowManager.hyprland.extraConfig = mkIf (cfg.displays != [ ]) + wayland.windowManager.hyprland.settings.monitor = mkIf (cfg.displays != [ ]) (renderDisplaysForHyprland cfg.displays); systemd.user.services.swaybg = swaybgJob cfg.displays; diff --git a/lib/modules/gamer.nix b/lib/modules/gamer.nix index 3d6e7f8..13b58ef 100644 --- a/lib/modules/gamer.nix +++ b/lib/modules/gamer.nix @@ -8,7 +8,7 @@ with lib; config = mkIf config.roles.gamer.enable { # required for heroic launcher nixpkgs.config.permittedInsecurePackages = [ - "electron-24.8.6" + "electron-25.9.0" ]; home-manager.users.${user}.imports = [{ @@ -23,6 +23,12 @@ with lib; protontricks protonup-qt gamemode + gamescope + + monado + openxr-loader + opencomposite + (makeDesktopItem { name = "x11steam"; desktopName = "X11 Steam Wrapper"; diff --git a/lib/modules/keyboard.nix b/lib/modules/keyboard.nix index 551f6ab..d394236 100644 --- a/lib/modules/keyboard.nix +++ b/lib/modules/keyboard.nix @@ -10,20 +10,20 @@ with lib; config = { home-manager.users.${user}.imports = [ { - wayland.windowManager.hyprland.extraConfig = '' - # === KEYBOARD MODULE === - input { - kb_layout = gb - kb_options = caps:escape - numlock_by_default = true - } - - # moonlander is programmed in dvorak! - device:zsa-technology-labs-moonlander-mark-i { - kb_variant = - kb_options = esperanto:qwerty,lv3:ralt_switch - } - ''; + wayland.windowManager.hyprland = { + settings = { + input = { + kb_layout = "gb"; + kb_options = "caps:escape"; + numlock_by_default = true; + }; + # moonlander is programmed in dvorak! + "device:zsa-technology-labs-moonlander-mark-i" = { + kb_variant = ""; + kb_options = "esperanto:qwerty,lv3:ralt_switch"; + }; + }; + }; } ]; services.xserver.xkbVariant = if config.keyboard.dvorak.enable then "dvorak" else ""; diff --git a/lib/modules/laptop.nix b/lib/modules/laptop.nix index de3c425..2e3448f 100644 --- a/lib/modules/laptop.nix +++ b/lib/modules/laptop.nix @@ -10,11 +10,11 @@ in displays = mkEnableOption "laptop display defaults"; }; }; - + config = mkIf cfg.enable { displays = mkIf cfg.displays { enable = true; - displays = [{ + displays = [{ name = "eDP-1"; scaling = 1.2; }]; @@ -23,23 +23,20 @@ in home-manager.users.${user}.imports = [{ wayland.windowManager.hyprland = { - extraConfig = '' - # === LAPTOP MODULE === - general { - gaps_out = 10 - border_size = 3 - } - - # so hard to reach X on a laptop - bind = SUPER_SHIFT, Q, killactive, - - # toggle built in keyboard layout - device:at-translated-set-2-keyboard { - kb_variant = dvorak, - kb_layout = gb,gb - kb_options = grp:alt_shift_toggle,caps:escape - } - ''; + settings = { + general = { + gaps_out = 10; + border_size = 3; + }; + }; + bind = [ + "SUPER_SHIFT, Q, killactive," + ]; + "device:at-translated-set-2-keyboard" = { + kb_variant = "dvorak,"; + kb_layout = "gb,gb"; + kb_options = "grp:alt_shift_toggle,caps:escape"; + }; }; }]; }; diff --git a/lib/modules/scripts.nix b/lib/modules/scripts.nix index 98a9528..098ee17 100644 --- a/lib/modules/scripts.nix +++ b/lib/modules/scripts.nix @@ -50,15 +50,11 @@ let bindScript = script: concatStrings ( map - (hotkey: '' - bind = ${hotkey.modifier}, ${hotkey.key}, exec, ${scriptExec {inherit script hotkey;}} - '') + (hotkey: + "${hotkey.modifier}, ${hotkey.key}, exec, ${scriptExec {inherit script hotkey;}}" + ) script.hotkeys); - bindScripts = scripts: - "# === USER SCRIPTS MODULE ===\n" - + concatStringsSep "\n" (map bindScript scripts); - in { options.programs = { @@ -71,7 +67,7 @@ in config = { home-manager.users.${user}.imports = [{ home.packages = installScripts scripts; - wayland.windowManager.hyprland.extraConfig = bindScripts scripts; + wayland.windowManager.hyprland.settings.bind = (map bindScript scripts); }]; }; diff --git a/lib/modules/wayland.nix b/lib/modules/wayland.nix index 7a61c10..8ddbc40 100644 --- a/lib/modules/wayland.nix +++ b/lib/modules/wayland.nix @@ -24,149 +24,140 @@ in default_session = if cfg.sway then sway_session else hypr_session; }; }; - + home-manager.users.${user}.imports = [{ wayland.windowManager.hyprland = mkIf cfg.hyprland { enable = true; - systemdIntegration = true; + systemd.enable = true; + settings = { + input = { + touchpad = { + natural_scroll = true; + scroll_factor = 0.5; + }; + }; + gestures = { + workspace_swipe = true; + workspace_swipe_numbered = true; + }; + decoration = { + rounding = 5; + drop_shadow = false; + }; + bezier = [ + "overshot, 0.05, 0.9, 0.1, 1.1" + "linear, 0.0, 0.0, 1.0, 1.0" + ]; + animations = { + enabled = true; + animation = [ + "windows, 1, 1, default, popin" + "border, 1, 1, default" + "fade, 1, 1, default" + "workspaces, 1, 3, overshot" + "borderangle,1, 50, linear, loop" + ]; + }; + bind = [ + "SUPER, h, movefocus,l" + "SUPER, l, movefocus,r" + "SUPER, j, layoutmsg,cyclenext" + "SUPER, k, layoutmsg,cycleprev" + "SUPER, space, layoutmsg,swapwithmaster master" + "SUPER, F, fullscreen," + "SUPER, V, togglefloating," + "SUPER, W, layoutmsg, orientationprev" + "SUPER_SHIFT, W, layoutmsg, orientationnext" + "SUPER_SHIFT, V, togglegroup," + "SUPER_SHIFT, h, changegroupactive,b" + "SUPER_SHIFT, h, moveintogroup,l" + "SUPER_SHIFT, l, moveintogroup,r" + "SUPER_SHIFT, l, changegroupactive,f" + "SUPER, Y, togglespecialworkspace" + "SUPER_SHIFT, Y, movetoworkspace, special" + "SUPER, R, submap, resize" + "SUPER,1,workspace,1" + "SUPER,2,workspace,2" + "SUPER,3,workspace,3" + "SUPER,4,workspace,4" + "SUPER,5,workspace,5" + "SUPER,6,workspace,6" + "SUPER,7,workspace,7" + "SUPER,8,workspace,8" + "SUPER,9,workspace,9" + "SUPER,0,workspace,10" + "SUPER,left,workspace,r-1" + "SUPER,right,workspace,r+1" + "SUPER_SHIFT,1,movetoworkspace,1" + "SUPER_SHIFT,2,movetoworkspace,2" + "SUPER_SHIFT,3,movetoworkspace,3" + "SUPER_SHIFT,4,movetoworkspace,4" + "SUPER_SHIFT,5,movetoworkspace,5" + "SUPER_SHIFT,6,movetoworkspace,6" + "SUPER_SHIFT,7,movetoworkspace,7" + "SUPER_SHIFT,8,movetoworkspace,8" + "SUPER_SHIFT,9,movetoworkspace,9" + "SUPER_SHIFT,0,movetoworkspace,10" + ]; + bindm = [ + "SUPER, mouse:272, movewindow" + "SUPER, mouse:273, resizewindow" + ]; + env = [ + "GDK_BACKEND,wayland,x11" + "QT_QPA_PLATFORM,wayland;xcb" + "SDL_VIDEODRIVER,wayland" + "CLUTTER_BACKEND,wayland" + "XDG_CURRENT_DESKTOP,Hyprland" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "QT_AUTO_SCREEN_SCALE_FACTOR,1" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "NIXOS_OZONE_WL,1" + ]; + windowrule = [ + "float, title:wlogout" + "idleinhibit always, vrmonitor" + "idleinhibit focus, steam_app" + ]; + workspace = [ + "11, default:true" + ]; + general = { + gaps_out = 10; + resize_on_border = true; + layout = "master"; + # "col.active_border" = "rgb(FFFF00) rgb(00FFFF) rgb(FF00FF)"; + border_size = 5; + }; + master = { + mfact = 0.7; + new_on_top = true; + }; + misc = { + vrr = 2; + focus_on_activate = true; + }; + }; # https://wiki.hyprland.org/Configuring/Variables/ extraConfig = '' - # === GLOBAL CONFIG === - env = GDK_BACKEND,wayland,x11 - env = QT_QPA_PLATFORM,wayland;xcb - env = SDL_VIDEODRIVER,wayland - env = CLUTTER_BACKEND,wayland - env = XDG_CURRENT_DESKTOP,Hyprland - env = XDG_SESSION_TYPE,wayland - env = XDG_SESSION_DESKTOP,Hyprland - env = QT_AUTO_SCREEN_SCALE_FACTOR,1 - env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1 - env = NIXOS_OZONE_WL,1 - - input { - touchpad { - natural_scroll = yes - scroll_factor = 0.5 - } - } - - bind = SUPER_SHIFT, X, killactive, - bind = SUPER_SHIFT, E, exit, - bind = SUPER, SLASH, focuswindow, brave-browser - bind = SUPER, n, focuswindow, Logseq - - windowrule = float, title:wlogout - windowrule = idleinhibit always, vrmonitor - windowrule = idleinhibit focus, steam_app - - bind = SUPER, h, movefocus,l - bind = SUPER, l, movefocus,r - - bindm = SUPER, mouse:272, movewindow - bindm = SUPER, mouse:273, resizewindow - - bind = SUPER, j, layoutmsg,cyclenext - bind = SUPER, k, layoutmsg,cycleprev - bind = SUPER, space, layoutmsg,swapwithmaster master - bind = SUPER, F, fullscreen, - bind = SUPER, V, togglefloating, - bind = SUPER, W, layoutmsg, orientationprev - bind = SUPER_SHIFT, W, layoutmsg, orientationnext - bind = SUPER_SHIFT, V, togglegroup, - bind = SUPER_SHIFT, h, changegroupactive,b - bind = SUPER_SHIFT, h, moveintogroup,l - bind = SUPER_SHIFT, l, moveintogroup,r - bind = SUPER_SHIFT, l, changegroupactive,f - bind = SUPER, Y, togglespecialworkspace - bind = SUPER_SHIFT, Y, movetoworkspace, special - - bind = SUPER, R, submap, resize submap = resize + binde = ,right,resizeactive,10 0 + binde = ,left,resizeactive,-10 0 + binde = ,up,resizeactive,0 -10 + binde = ,down,resizeactive,0 10 + binde = ,k,resizeactive,0 -10 + binde = ,j,resizeactive,0 10 + binde = ,l,splitratio,0.05 + binde = ,h,splitratio,-0.05 + binde = SHIFT,l,splitratio,0.3 + binde = SHIFT,h,splitratio,-0.3 - binde=,right,resizeactive,10 0 - binde=,left,resizeactive,-10 0 - binde=,up,resizeactive,0 -10 - binde=,down,resizeactive,0 10 - - binde=,k,resizeactive,0 -10 - binde=,j,resizeactive,0 10 - - binde=,l,splitratio,0.05 - binde=,h,splitratio,-0.05 - binde=SHIFT,l,splitratio,0.3 - binde=SHIFT,h,splitratio,-0.3 - - bind = , escape, submap,reset - bind = , enter, submap,reset - bind = SUPER, R, submap,reset - bind = CONTROL, C, submap,reset + bind = , escape, submap,reset + bind = , enter, submap,reset + bind = SUPER, R, submap,reset + bind = CONTROL, C, submap,reset submap = reset - - workspace = 11, default:true - bind = SUPER,1,workspace,1 - bind = SUPER,2,workspace,2 - bind = SUPER,3,workspace,3 - bind = SUPER,4,workspace,4 - bind = SUPER,5,workspace,5 - bind = SUPER,6,workspace,6 - bind = SUPER,7,workspace,7 - bind = SUPER,8,workspace,8 - bind = SUPER,9,workspace,9 - bind = SUPER,0,workspace,10 - - bind = SUPER,left,workspace,r-1 - bind = SUPER,right,workspace,r+1 - - bind = SUPER_SHIFT,1,movetoworkspace,1 - bind = SUPER_SHIFT,2,movetoworkspace,2 - bind = SUPER_SHIFT,3,movetoworkspace,3 - bind = SUPER_SHIFT,4,movetoworkspace,4 - bind = SUPER_SHIFT,5,movetoworkspace,5 - bind = SUPER_SHIFT,6,movetoworkspace,6 - bind = SUPER_SHIFT,7,movetoworkspace,7 - bind = SUPER_SHIFT,8,movetoworkspace,8 - bind = SUPER_SHIFT,9,movetoworkspace,9 - bind = SUPER_SHIFT,0,movetoworkspace,10 - - gestures { - workspace_swipe = yes - workspace_swipe_numbered = yes - } - - decoration { - rounding = 5 - drop_shadow = no - } - - bezier = overshot, 0.05, 0.9, 0.1, 1.1 - bezier = linear, 0.0, 0.0, 1.0, 1.0 - - animations { - enabled = 1 - animation = windows, 1, 1, default, popin - animation = border, 1, 1, default - animation = fade, 1, 1, default - animation = workspaces, 1, 3, overshot - animation = borderangle,1, 50, linear, loop - } - - general { - gaps_out = 10 - resize_on_border = yes - layout = master - col.active_border = rgb(FFFF00) rgb(00FFFF) rgb(FF00FF) - border_size = 5 - } - - master { - mfact = 0.7 - new_on_top = yes - } - - misc { - vrr = 2 - focus_on_activate = yes - } ''; }; @@ -292,7 +283,7 @@ in ''; }; - + }]; }; }