From 6f5759488496ffd6f30ebc99af920641b3c69613 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Thu, 24 Apr 2025 13:41:09 +0200 Subject: [PATCH] Fix hyprland --- flake.nix | 1 + homes/julian/aspi.nix | 5 +- homes/julian/features/gammastep/default.nix | 12 +- homes/julian/features/hyprland/default.nix | 298 +++++++++++------- homes/julian/features/hyprland/hyprbars.nix | 80 +++++ .../features/hyprland/hyprlock/default.nix | 2 +- .../julian/features/hyprland/mako/default.nix | 18 +- homes/julian/features/hyprland/swayidle.nix | 63 ++++ homes/julian/features/hyprland/swaylock.nix | 48 +++ .../features/hyprland/waybar/default.nix | 4 +- homes/julian/features/hyprland/waypipe.nix | 30 ++ .../features/hyprland/wlogout/default.nix | 2 +- .../julian/features/hyprland/wofi/default.nix | 2 +- homes/julian/features/hyprland/zathura.nix | 35 ++ homes/julian/hm-standalone-config.nix | 15 +- hosts/aspi/default.nix | 13 +- hosts/common/global/locale.nix | 2 + hosts/common/global/nix.nix | 1 + hosts/common/optional/greetd.nix | 16 +- hosts/common/users/julian/default.nix | 3 + 20 files changed, 502 insertions(+), 148 deletions(-) create mode 100644 homes/julian/features/hyprland/hyprbars.nix create mode 100644 homes/julian/features/hyprland/swayidle.nix create mode 100644 homes/julian/features/hyprland/swaylock.nix create mode 100644 homes/julian/features/hyprland/waypipe.nix create mode 100644 homes/julian/features/hyprland/zathura.nix diff --git a/flake.nix b/flake.nix index 3200eb8..c00aab4 100644 --- a/flake.nix +++ b/flake.nix @@ -76,6 +76,7 @@ config.permittedInsecurePackages = [ "olm-3.2.16" ]; + warn-dirty = false; } ); in diff --git a/homes/julian/aspi.nix b/homes/julian/aspi.nix index 8430b4c..dea436a 100644 --- a/homes/julian/aspi.nix +++ b/homes/julian/aspi.nix @@ -10,7 +10,10 @@ ./features/alacritty ./features/yazi ./features/emacs - ./features/i3 + # ./features/i3 + + ./features/hyprland + ./features/nix-helper ./features/desktop diff --git a/homes/julian/features/gammastep/default.nix b/homes/julian/features/gammastep/default.nix index ab92d5d..5166fb6 100644 --- a/homes/julian/features/gammastep/default.nix +++ b/homes/julian/features/gammastep/default.nix @@ -1,8 +1,14 @@ { services.gammastep = { enable = true; - latitude = 47.92; - longitude = 10.12; - provider = "manual"; + provider = "geoclue2"; + temperature = { + day = 6000; + night = 4600; + }; + settings = { + general.adjustment-method = "wayland"; + }; + }; } diff --git a/homes/julian/features/hyprland/default.nix b/homes/julian/features/hyprland/default.nix index d7604bf..a792331 100644 --- a/homes/julian/features/hyprland/default.nix +++ b/homes/julian/features/hyprland/default.nix @@ -2,33 +2,68 @@ pkgs, inputs, config, + lib, ... }: let - inherit (inputs.nix-colors.colorschemes.${builtins.toString config.colorscheme}) + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.colorscheme.name}) palette ; in { imports = [ - inputs.hyprland.homeManagerModules.default - + # inputs.hyprland.homeManagerModules.default ./waybar ./wofi ./mako - ./hyprlock + # ./hyprlock ./wlogout + ../gammastep + + ./swayidle.nix + ./swaylock.nix + ./zathura.nix + ./waypipe.nix + + ./hyprbars.nix ]; + xdg.portal = { + extraPortals = [ pkgs.xdg-desktop-portal-wlr ]; + config.hyprland = { + default = [ + "wlr" + "gtk" + ]; + }; + }; + + programs.imv.enable = true; # TODO: what is that + home.packages = with pkgs; [ # hyprpicker # TODO # hyprcursor # TODO brightnessctl # grimblast frajul.hyprshot-gui + + wf-recorder + wl-clipboard ]; + services.cliphist = { + enable = true; + }; + + xdg.mimeApps.enable = true; # TODO: what is that? + + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = 1; + QT_QPA_PLATFORM = "wayland"; + LIBSEAT_BACKEND = "logind"; + }; + # services.hypridle = { # enable = true; # settings = { @@ -66,7 +101,29 @@ in wayland.windowManager.hyprland = { # Whether to enable Hyprland wayland compositor enable = true; - package = inputs.hyprland.packages."${pkgs.system}".hyprland; # does only work with nixos-unstable + # package = config.lib.nixGL.wrap ( + # pkgs.hyprland.override { + # # nixgl needed? + # wrapRuntimeDeps = false; + # } + # ); + + systemd = { + enable = true; + # Same as default, but stop graphical-session too + extraCommands = lib.mkBefore [ + "systemctl --user stop graphical-session.target" + "systemctl --user start hyprland-session.target" + ]; + variables = [ + "DISPLAY" + "HYPRLAND_INSTANCE_SIGNATURE" + "WAYLAND_DISPLAY" + "XDG_CURRENT_DESKTOP" + ]; + }; + + # package = inputs.hyprland.packages."${pkgs.system}".hyprland; # does only work with nixos-unstable # The hyprland package to use (simplifies use of plugins) # package = inputs.hyprland.packages.${pkgs.system}.hyprland; @@ -75,12 +132,12 @@ in # Optional # Whether to enable hyprland-session.target on hyprland startup - systemd.enable = true; + # systemd.enable = true; # Make PATH available to systemd services - systemd.variables = [ "--all" ]; + # systemd.variables = [ "--all" ]; plugins = [ - inputs.hyprland-plugins.packages.${pkgs.system}.hyprbars # does only work with nixos-unstable + # inputs.hyprland-plugins.packages.${pkgs.system}.hyprbars # does only work with nixos-unstable # hyprlandPlugins.hyprbars ]; @@ -100,28 +157,28 @@ in layout = "dwindle"; - "col.active_border" = "0xff${palette.base0C} 0xff${palette.base0D} 270deg"; - "col.inactive_border" = "0xff${palette.base00}"; + # "col.active_border" = "0xff${palette.base0C} 0xff${palette.base0D} 270deg"; + # "col.inactive_border" = "0xff${palette.base00}"; }; decoration = { # power saving blur.enabled = false; # power saving - drop_shadow = false; + # drop_shadow = false; }; # Dwindle layout dwindle = { pseudotile = true; # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true; # You probably want this - no_gaps_when_only = 2; # with border + # no_gaps_when_only = 2; # with border }; # Master layout master = { new_status = "slave"; - no_gaps_when_only = 2; # with border + # no_gaps_when_only = 2; # with border mfact = 0.5; # Do not make master bigger }; @@ -175,115 +232,136 @@ in ]; # binds - bind = [ - # compositor commands - "$mod, Space, focuswindow, floating" - "$mod SHIFT, Space, togglefloating," - "$mod, F, fullscreen," - "$mod, X, killactive," + bind = + [ + # compositor commands + "$mod, Space, focuswindow, floating" + "$mod SHIFT, Space, togglefloating," + "$mod, F, fullscreen," + "$mod, X, killactive," - "$mod, O, togglesplit," # dwindle + "$mod, O, togglesplit," # dwindle - # opening applications - "$mod, D, exec, wofi --show drun,run" - "$mod, E, exec, pcmanfm" - "$mod, Return, exec, kitty" - "$mod, B, exec, firefox" - "$mod, C, exec, qalculate-gtk" + # opening applications + "$mod, D, exec, wofi --show drun,run" + "$mod, E, exec, pcmanfm" + "$mod, Return, exec, kitty" + "$mod, B, exec, firefox" + "$mod, C, exec, qalculate-gtk" - # other commands - "$mod SHIFT, E, exec, wlogout -p layer-shell" - "$mod, Escape, exec, wlogout -p layer-shell" - "$mod, TAB, exec, hyprlock" - "$mod SHIFT, R, exec, hyprctl reload" - ", Print, exec, hyprshot-gui" + # other commands + "$mod SHIFT, E, exec, wlogout -p layer-shell" + "$mod, Escape, exec, wlogout -p layer-shell" + "$mod SHIFT, R, exec, hyprctl reload" + ", Print, exec, hyprshot-gui" - # "$mod SHIFT, E, exec, pkill Hyprland" - # "$mod, G, togglegroup," - # "$mod SHIFT, N, changegroupactive, f" - # "$mod SHIFT, P, changegroupactive, b" - # "$mod ALT, ,resizeactive," + # "$mod SHIFT, E, exec, pkill Hyprland" + # "$mod, G, togglegroup," + # "$mod SHIFT, N, changegroupactive, f" + # "$mod SHIFT, P, changegroupactive, b" + # "$mod ALT, ,resizeactive," - # media keys - ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ", XF86AudioPlay, exec, playerctl play-pause" - ", XF86AudioPause, exec, playerctl pause" - ", XF86AudioStop, exec, playerctl stop" - ", XF86AudioNext, exec, playerctl next" - ", XF86AudioPrev, exec, playerctl previous" - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86MonBrightnessUp, exec, brightnessctl --class backlight set 5%+" - ", XF86MonBrightnessDown, exec, brightnessctl --class backlight set 5%-" + # media keys + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioPlay, exec, playerctl play-pause" + ", XF86AudioPause, exec, playerctl pause" + ", XF86AudioStop, exec, playerctl stop" + ", XF86AudioNext, exec, playerctl next" + ", XF86AudioPrev, exec, playerctl previous" + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86MonBrightnessUp, exec, brightnessctl --class backlight set 5%+" + ", XF86MonBrightnessDown, exec, brightnessctl --class backlight set 5%-" - # move focus - "$mod, left, movefocus, l" - "$mod, H, movefocus, l" - "$mod, right, movefocus, r" - "$mod, L, movefocus, r" - "$mod, up, movefocus, u" - "$mod, K, movefocus, u" - "$mod, down, movefocus, d" - "$mod, J, movefocus, d" + # move focus + "$mod, left, movefocus, l" + "$mod, H, movefocus, l" + "$mod, right, movefocus, r" + "$mod, L, movefocus, r" + "$mod, up, movefocus, u" + "$mod, K, movefocus, u" + "$mod, down, movefocus, d" + "$mod, J, movefocus, d" - # move window - "$mod SHIFT, left, movewindow, l" - "$mod SHIFT, H, movewindow, l" - "$mod SHIFT, right, movewindow, r" - "$mod SHIFT, L, movewindow, r" - "$mod SHIFT, up, movewindow, u" - "$mod SHIFT, K, movewindow, u" - "$mod SHIFT, down, movewindow, d" - "$mod SHIFT, J, movewindow, d" + # move window + "$mod SHIFT, left, movewindow, l" + "$mod SHIFT, H, movewindow, l" + "$mod SHIFT, right, movewindow, r" + "$mod SHIFT, L, movewindow, r" + "$mod SHIFT, up, movewindow, u" + "$mod SHIFT, K, movewindow, u" + "$mod SHIFT, down, movewindow, d" + "$mod SHIFT, J, movewindow, d" - # Switch workspaces with mainMod + [0-9] - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" + # Switch workspaces with mainMod + [0-9] + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" - # Move active window to a workspace with mainMod + SHIFT + [0-9] - "$mod SHIFT, 1, movetoworkspace, 1" - "$mod SHIFT, 2, movetoworkspace, 2" - "$mod SHIFT, 3, movetoworkspace, 3" - "$mod SHIFT, 4, movetoworkspace, 4" - "$mod SHIFT, 5, movetoworkspace, 5" - "$mod SHIFT, 6, movetoworkspace, 6" - "$mod SHIFT, 7, movetoworkspace, 7" - "$mod SHIFT, 8, movetoworkspace, 8" - "$mod SHIFT, 9, movetoworkspace, 9" - "$mod SHIFT, 0, movetoworkspace, 10" + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mod SHIFT, 1, movetoworkspace, 1" + "$mod SHIFT, 2, movetoworkspace, 2" + "$mod SHIFT, 3, movetoworkspace, 3" + "$mod SHIFT, 4, movetoworkspace, 4" + "$mod SHIFT, 5, movetoworkspace, 5" + "$mod SHIFT, 6, movetoworkspace, 6" + "$mod SHIFT, 7, movetoworkspace, 7" + "$mod SHIFT, 8, movetoworkspace, 8" + "$mod SHIFT, 9, movetoworkspace, 9" + "$mod SHIFT, 0, movetoworkspace, 10" - # Move active window to a workspace without following with mainMod + CTRL + [0-9] - "$mod CTRL, 1, movetoworkspacesilent, 1" - "$mod CTRL, 2, movetoworkspacesilent, 2" - "$mod CTRL, 3, movetoworkspacesilent, 3" - "$mod CTRL, 4, movetoworkspacesilent, 4" - "$mod CTRL, 5, movetoworkspacesilent, 5" - "$mod CTRL, 6, movetoworkspacesilent, 6" - "$mod CTRL, 7, movetoworkspacesilent, 7" - "$mod CTRL, 8, movetoworkspacesilent, 8" - "$mod CTRL, 9, movetoworkspacesilent, 9" - "$mod CTRL, 0, movetoworkspacesilent, 10" - ]; + # Move active window to a workspace without following with mainMod + CTRL + [0-9] + "$mod CTRL, 1, movetoworkspacesilent, 1" + "$mod CTRL, 2, movetoworkspacesilent, 2" + "$mod CTRL, 3, movetoworkspacesilent, 3" + "$mod CTRL, 4, movetoworkspacesilent, 4" + "$mod CTRL, 5, movetoworkspacesilent, 5" + "$mod CTRL, 6, movetoworkspacesilent, 6" + "$mod CTRL, 7, movetoworkspacesilent, 7" + "$mod CTRL, 8, movetoworkspacesilent, 8" + "$mod CTRL, 9, movetoworkspacesilent, 9" + "$mod CTRL, 0, movetoworkspacesilent, 10" + ] + ++ + # Screen lock + ( + let + swaylock = lib.getExe config.programs.swaylock.package; + in + lib.optionals config.programs.swaylock.enable [ + "$mod,TAB,exec,${swaylock} -S --grace 2 --grace-no-mouse" + ] + ) + ++ + # Notification manager + ( + let + makoctl = lib.getExe' config.services.mako.package "makoctl"; + in + lib.optionals config.services.mako.enable [ + "$mod,w,exec,${makoctl} dismiss" + "$mod SHIFT,W,exec,${makoctl} restore" + ] + ); - plugin = { - hyprbars = { - bar_text_size = 10; - bar_height = 16; - bar_text_font = "Ubuntu Nerd Font"; - bar_precedence_over_border = true; - bar_color = "rgb(${palette.base01})"; + # plugin = { + # hyprbars = { + # bar_text_size = 10; + # bar_height = 16; + # bar_text_font = "Ubuntu Nerd Font"; + # bar_precedence_over_border = true; + # bar_color = "rgb(${palette.base01})"; - hyprbars-button = [ "rgb(${palette.base03}), 14, 󰖭, hyprctl dispatch killactive" ]; - }; - }; + # hyprbars-button = [ "rgb(${palette.base03}), 14, 󰖭, hyprctl dispatch killactive" ]; + # }; + # }; }; }; } diff --git a/homes/julian/features/hyprland/hyprbars.nix b/homes/julian/features/hyprland/hyprbars.nix new file mode 100644 index 0000000..2de4e46 --- /dev/null +++ b/homes/julian/features/hyprland/hyprbars.nix @@ -0,0 +1,80 @@ +{ + config, + pkgs, + lib, + outputs, + ... +}: +let + getHostname = x: lib.last (lib.splitString "@" x); + # remoteColorschemes = lib.mapAttrs' (n: v: { + # name = getHostname n; + # value = v.config.colorscheme.rawColorscheme.colors.${config.colorscheme.mode}; + # }) outputs.homeConfigurations; + rgb = color: "rgb(${lib.removePrefix "#" color})"; + rgba = color: alpha: "rgba(${lib.removePrefix "#" color}${alpha})"; + + hyprbars = + (pkgs.hyprlandPlugins.hyprbars.override { + # Make sure it's using the same hyprland package as we are + hyprland = config.wayland.windowManager.hyprland.package; + }).overrideAttrs + (old: { + # Yeet the initialization notification (I hate it) + postPatch = + (old.postPatch or "") + + '' + ${lib.getExe pkgs.gnused} -i '/Initialized successfully/d' main.cpp + ''; + }); +in +{ + wayland.windowManager.hyprland = { + plugins = [ hyprbars ]; + settings = { + "plugin:hyprbars" = { + bar_height = 25; + # bar_color = rgba config.colorscheme.colors.surface "dd"; + # "col.text" = rgb config.colorscheme.colors.primary; + # bar_text_font = config.fontProfiles.regular.name; + # bar_text_size = config.fontProfiles.regular.size; + bar_part_of_window = true; + bar_precedence_over_border = true; + hyprbars-button = + let + closeAction = "hyprctl dispatch killactive"; + + isOnSpecial = ''hyprctl activewindow -j | jq -re 'select(.workspace.name == "special")' >/dev/null''; + moveToSpecial = "hyprctl dispatch movetoworkspacesilent special"; + moveToActive = "hyprctl dispatch movetoworkspacesilent name:$(hyprctl -j activeworkspace | jq -re '.name')"; + minimizeAction = "${isOnSpecial} && ${moveToActive} || ${moveToSpecial}"; + + maximizeAction = "hyprctl dispatch fullscreen 1"; + in + [ + # Red close button + # "${rgb config.colorscheme.colors.red},12,,${closeAction}" + # # Yellow "minimize" (send to special workspace) button + # "${rgb config.colorscheme.colors.yellow},12,,${minimizeAction}" + # # Green "maximize" (fullscreen) button + # "${rgb config.colorscheme.colors.green},12,,${maximizeAction}" + ]; + }; + + # windowrulev2 = + # [ + # "plugin:hyprbars:bar_color ${rgba config.colorscheme.colors.primary "ee"}, focus:1" + # "plugin:hyprbars:title_color ${rgb config.colorscheme.colors.on_primary}, focus:1" + # ] + # ++ (lib.flatten ( + # lib.mapAttrsToList (name: colors: [ + # "plugin:hyprbars:bar_color ${rgba colors.primary_container "dd"}, title:\\[${name}\\].*" + # "plugin:hyprbars:title_color ${rgb colors.on_primary_container}, title:\\[${name}\\].*" + + # "plugin:hyprbars:bar_color ${rgba colors.primary "ee"}, title:\\[${name}\\].*, focus:1" + # "plugin:hyprbars:title_color ${rgb colors.on_primary}, title:\\[${name}\\].*, focus:1" + # ]) remoteColorschemes + # )); + }; + }; +} diff --git a/homes/julian/features/hyprland/hyprlock/default.nix b/homes/julian/features/hyprland/hyprlock/default.nix index 62594bc..fcf799f 100644 --- a/homes/julian/features/hyprland/hyprlock/default.nix +++ b/homes/julian/features/hyprland/hyprlock/default.nix @@ -7,7 +7,7 @@ ... }: let - inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.colorscheme.name}) palette ; in diff --git a/homes/julian/features/hyprland/mako/default.nix b/homes/julian/features/hyprland/mako/default.nix index 1942ca4..0b05249 100644 --- a/homes/julian/features/hyprland/mako/default.nix +++ b/homes/julian/features/hyprland/mako/default.nix @@ -7,7 +7,7 @@ ... }: let - inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.colorscheme.name}) palette ; in @@ -17,13 +17,13 @@ in services.mako = { enable = true; defaultTimeout = 5000; # milliseconds, can be overwritten by notification sender - backgroundColor = "#${palette.base00}"; - textColor = "#${palette.base05}"; - borderColor = "#${palette.base0D}"; - progressColor = "over #${palette.base02}"; - extraConfig = '' - [urgency=high] - border-color=#${palette.base09} - ''; + # backgroundColor = "#${palette.base00}"; TODO fix + # textColor = "#${palette.base05}"; + # borderColor = "#${palette.base0D}"; + # progressColor = "over #${palette.base02}"; + # extraConfig = '' + # [urgency=high] + # border-color=#${palette.base09} + # ''; }; } diff --git a/homes/julian/features/hyprland/swayidle.nix b/homes/julian/features/hyprland/swayidle.nix new file mode 100644 index 0000000..6c60924 --- /dev/null +++ b/homes/julian/features/hyprland/swayidle.nix @@ -0,0 +1,63 @@ +{ + pkgs, + lib, + config, + ... +}: +let + swaylock = "${config.programs.swaylock.package}/bin/swaylock"; + pgrep = "${pkgs.procps}/bin/pgrep"; + pactl = "${pkgs.pulseaudio}/bin/pactl"; + hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl"; + swaymsg = "${config.wayland.windowManager.sway.package}/bin/swaymsg"; + + isLocked = "${pgrep} -x ${swaylock}"; + lockTime = 4 * 60; # TODO: configurable desktop (10 min)/laptop (4 min) + + # Makes two timeouts: one for when the screen is not locked (lockTime+timeout) and one for when it is. + afterLockTimeout = + { + timeout, + command, + resumeCommand ? null, + }: + [ + { + timeout = lockTime + timeout; + inherit command resumeCommand; + } + { + command = "${isLocked} && ${command}"; + inherit resumeCommand timeout; + } + ]; +in +{ + services.swayidle = { + enable = true; + systemdTarget = "graphical-session.target"; + timeouts = + # Lock screen + [ + { + timeout = lockTime; + # command = "${swaylock} -i ${config.wallpaper} --daemonize --grace 15 --grace-no-mouse"; + command = "${swaylock} --daemonize --grace 15 --grace-no-mouse"; + } + ] + ++ + # Turn off displays (hyprland) + (lib.optionals config.wayland.windowManager.hyprland.enable (afterLockTimeout { + timeout = 300; + command = "${hyprctl} dispatch dpms off"; + resumeCommand = "${hyprctl} dispatch dpms on"; + })) + ++ + # Turn off displays (sway) + (lib.optionals config.wayland.windowManager.sway.enable (afterLockTimeout { + timeout = 300; + command = "${swaymsg} 'output * dpms off'"; + resumeCommand = "${swaymsg} 'output * dpms on'"; + })); + }; +} diff --git a/homes/julian/features/hyprland/swaylock.nix b/homes/julian/features/hyprland/swaylock.nix new file mode 100644 index 0000000..aac9041 --- /dev/null +++ b/homes/julian/features/hyprland/swaylock.nix @@ -0,0 +1,48 @@ +{ + config, + pkgs, + ... +}: +let + inherit (config.colorscheme) colors; +in +{ + programs.swaylock = { + enable = true; + package = pkgs.swaylock-effects; + settings = { + effect-blur = "20x3"; + fade-in = 0.1; + + # font = config.fontProfiles.regular.name; + # font-size = config.fontProfiles.regular.size + 3; + + line-uses-inside = true; + disable-caps-lock-text = true; + indicator-caps-lock = true; + indicator-radius = 40; + indicator-idle-visible = true; + indicator-y-position = 1000; + + # TODO customize + # ring-color = "${colors.surface_bright}"; + # inside-wrong-color = "${colors.on_error}"; + # ring-wrong-color = "${colors.error}"; + # key-hl-color = "${colors.tertiary}"; + # bs-hl-color = "${colors.on_tertiary}"; + # ring-ver-color = "${colors.secondary}"; + # inside-ver-color = "${colors.on_secondary}"; + # inside-color = "${colors.surface}"; + # text-color = "${colors.on_surface}"; + # text-clear-color = "${colors.on_surface_variant}"; + # text-ver-color = "${colors.on_secondary}"; + # text-wrong-color = "${colors.on_surface_variant}"; + # text-caps-lock-color = "${colors.on_surface_variant}"; + # inside-clear-color = "${colors.surface}"; + # ring-clear-color = "${colors.primary}"; + # inside-caps-lock-color = "${colors.on_tertiary}"; + # ring-caps-lock-color = "${colors.surface}"; + # separator-color = "${colors.surface}"; + }; + }; +} diff --git a/homes/julian/features/hyprland/waybar/default.nix b/homes/julian/features/hyprland/waybar/default.nix index edf7dd9..1f178cb 100644 --- a/homes/julian/features/hyprland/waybar/default.nix +++ b/homes/julian/features/hyprland/waybar/default.nix @@ -7,9 +7,7 @@ ... }: let - inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) - palette - ; + palette = (inputs.nix-colors.colorschemes.${builtins.toString config.colorscheme.name}).palette; in { programs.waybar = { diff --git a/homes/julian/features/hyprland/waypipe.nix b/homes/julian/features/hyprland/waypipe.nix new file mode 100644 index 0000000..19a7f67 --- /dev/null +++ b/homes/julian/features/hyprland/waypipe.nix @@ -0,0 +1,30 @@ +{ + pkgs, + lib, + config, + ... +}: +{ + home.packages = [ pkgs.waypipe ]; + systemd.user.services = { + waypipe-client = { + Unit.Description = "Runs waypipe on startup to support SSH forwarding"; + Service = { + ExecStartPre = "${lib.getExe' pkgs.coreutils "mkdir"} %h/.waypipe -p"; + ExecStart = "${lib.getExe (config.lib.nixGL.wrap pkgs.waypipe)} --socket %h/.waypipe/client.sock client"; + ExecStopPost = "${lib.getExe' pkgs.coreutils "rm"} -f %h/.waypipe/client.sock"; + }; + Install.WantedBy = [ "graphical-session.target" ]; + }; + waypipe-server = { + Unit.Description = "Runs waypipe on startup to support SSH forwarding"; + Service = { + Type = "simple"; + ExecStartPre = "${lib.getExe' pkgs.coreutils "mkdir"} %h/.waypipe -p"; + ExecStart = "${lib.getExe (config.lib.nixGL.wrap pkgs.waypipe)} --socket %h/.waypipe/server.sock --title-prefix '[%H] ' --login-shell --display wayland-waypipe server -- ${lib.getExe' pkgs.coreutils "sleep"} infinity"; + ExecStopPost = "${lib.getExe' pkgs.coreutils "rm"} -f %h/.waypipe/server.sock %t/wayland-waypipe"; + }; + Install.WantedBy = [ "default.target" ]; + }; + }; +} diff --git a/homes/julian/features/hyprland/wlogout/default.nix b/homes/julian/features/hyprland/wlogout/default.nix index 3c60e4a..3a5354d 100644 --- a/homes/julian/features/hyprland/wlogout/default.nix +++ b/homes/julian/features/hyprland/wlogout/default.nix @@ -7,7 +7,7 @@ ... }: let - inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.colorscheme.name}) palette ; in diff --git a/homes/julian/features/hyprland/wofi/default.nix b/homes/julian/features/hyprland/wofi/default.nix index c0be24f..4553246 100644 --- a/homes/julian/features/hyprland/wofi/default.nix +++ b/homes/julian/features/hyprland/wofi/default.nix @@ -7,7 +7,7 @@ ... }: let - inherit (inputs.nix-colors.colorschemes.${builtins.toString config.modules.desktop.colorscheme}) + inherit (inputs.nix-colors.colorschemes.${builtins.toString config.colorscheme.name}) palette ; in diff --git a/homes/julian/features/hyprland/zathura.nix b/homes/julian/features/hyprland/zathura.nix new file mode 100644 index 0000000..812a2b6 --- /dev/null +++ b/homes/julian/features/hyprland/zathura.nix @@ -0,0 +1,35 @@ +{ config, ... }: +let + inherit (config.colorscheme) colors; +in +{ + programs.zathura = { + enable = true; + options = { + selection-clipboard = "clipboard"; + # TODO fix + # font = "${config.fontProfiles.regular.name} ${toString config.fontProfiles.regular.size}"; + # recolor = true; + # default-bg = "${colors.surface}"; + # default-fg = "${colors.surface_bright}"; + # statusbar-bg = "${colors.surface_container}"; + # statusbar-fg = "${colors.on_surface_variant}"; + # inputbar-bg = "${colors.surface}"; + # inputbar-fg = "${colors.on_secondary}"; + # notification-bg = "${colors.surface}"; + # notification-fg = "${colors.on_secondary}"; + # notification-error-bg = "${colors.error}"; + # notification-error-fg = "${colors.on_error}"; + # notification-warning-bg = "${colors.error}"; + # notification-warning-fg = "${colors.on_error}"; + # highlight-color = "${colors.tertiary}"; + # highlight-active-color = "${colors.secondary}"; + # completion-bg = "${colors.surface_bright}"; + # completion-fg = "${colors.on_surface}"; + # completions-highlight-bg = "${colors.secondary}"; + # completions-highlight-fg = "${colors.on_secondary}"; + # recolor-lightcolor = "${colors.surface}"; + # recolor-darkcolor = "${colors.inverse_surface}"; + }; + }; +} diff --git a/homes/julian/hm-standalone-config.nix b/homes/julian/hm-standalone-config.nix index 90ca91a..97495bd 100644 --- a/homes/julian/hm-standalone-config.nix +++ b/homes/julian/hm-standalone-config.nix @@ -7,13 +7,14 @@ # Apply overlays nixpkgs = { overlays = builtins.attrValues outputs.overlays; - # config = { - # allowUnfree = true; - # allowUnfreePredicate = _: true; # TODO: what is this - # permittedInsecurePackages = [ - # "olm-3.2.16" - # ]; - # }; + config = { + allowUnfree = true; + allowUnfreePredicate = _: true; # TODO: what is this + permittedInsecurePackages = [ + "olm-3.2.16" + ]; + warn-dirty = false; + }; }; # Setup binary caches diff --git a/hosts/aspi/default.nix b/hosts/aspi/default.nix index 37052db..ad118db 100644 --- a/hosts/aspi/default.nix +++ b/hosts/aspi/default.nix @@ -1,5 +1,6 @@ { pkgs, + inputs, ... }: { @@ -12,20 +13,24 @@ ../common/users/julian # ../common/optional/openssh.nix - # ../common/optional/greetd.nix ../common/optional/pipewire.nix ../common/optional/remote-builder.nix ../common/optional/boot-efi.nix ../common/optional/pcmanfm.nix - ../common/optional/i3.nix - ../common/optional/gdm.nix + + # ../common/optional/i3.nix + # ../common/optional/gdm.nix + ../common/optional/greetd.nix + ../common/optional/redshift.nix ../common/optional/virtualbox.nix - ../common/optional/xdg-portal.nix + ../common/optional/xdg-portal.nix # TODO: not needed? ../common/optional/polkit.nix # TODO: maybe not needed! ../common/optional/keyring.nix # TODO: maybe not needed! ]; + # programs.hyprland.enable = true; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.blacklistedKernelModules = [ "pcspkr" ]; # Disables "beep" diff --git a/hosts/common/global/locale.nix b/hosts/common/global/locale.nix index cd320cf..41fa6b7 100644 --- a/hosts/common/global/locale.nix +++ b/hosts/common/global/locale.nix @@ -19,4 +19,6 @@ layout = "de"; variant = ""; }; + + console.keyMap = "de"; } diff --git a/hosts/common/global/nix.nix b/hosts/common/global/nix.nix index cceb329..2662f95 100644 --- a/hosts/common/global/nix.nix +++ b/hosts/common/global/nix.nix @@ -12,6 +12,7 @@ config = { allowUnfree = true; allowUnfreePredicate = _: true; # TODO: what is this + warn-dirty = false; permittedInsecurePackages = [ "olm-3.2.16" ]; diff --git a/hosts/common/optional/greetd.nix b/hosts/common/optional/greetd.nix index 4fa578b..6c16299 100644 --- a/hosts/common/optional/greetd.nix +++ b/hosts/common/optional/greetd.nix @@ -33,14 +33,14 @@ in enable = true; iconTheme = julianCfg.gtk.iconTheme; theme = julianCfg.gtk.theme; - font = julianCfg.fontProfiles.regular; - cursorTheme = { - inherit (julianCfg.gtk.cursorTheme) name package; - }; - settings.background = { - path = julianCfg.wallpaper; - fit = "Cover"; - }; + # font = julianCfg.fontProfiles.regular; # TODO: do + # cursorTheme = { + # inherit (julianCfg.gtk.cursorTheme) name package; + # }; # TODO: fix + # settings.background = { + # path = julianCfg.wallpaper; + # fit = "Cover"; + # }; # TODO: fix }; services.greetd = { enable = true; diff --git a/hosts/common/users/julian/default.nix b/hosts/common/users/julian/default.nix index 115281d..937daee 100644 --- a/hosts/common/users/julian/default.nix +++ b/hosts/common/users/julian/default.nix @@ -42,4 +42,7 @@ in }; home-manager.users.julian = import ../../../../homes/julian/${config.networking.hostName}.nix; + + security.pam.services.swaylock = { }; # Make swaylock unlocking work + }