From fa19b3c3aa6dbfe0f4e568484db70eaf3a8dbdc9 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Sun, 14 Apr 2024 09:49:41 +0200 Subject: [PATCH 1/4] Basic waybar setup --- hosts/lars/default.nix | 2 ++ hosts/lars/hyprland.nix | 5 +++++ hosts/lars/waybar.nix | 15 +++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 hosts/lars/waybar.nix diff --git a/hosts/lars/default.nix b/hosts/lars/default.nix index d7176b6..0add695 100644 --- a/hosts/lars/default.nix +++ b/hosts/lars/default.nix @@ -16,6 +16,8 @@ }; }; + waybar.enable = true; + programs = { vesktop.enable = true; btop.enable = true; diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 0b7f57e..1357dc7 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -3,6 +3,10 @@ with lib; let username = config.modules.other.system.username; cfg = config.modules.hyprland; in { + imports = [ + ./waybar.nix + ]; + options.modules.hyprland.nvidia.enable = mkEnableOption "nvidia"; options.modules.hyprland = { enable = mkEnableOption "hyprland"; @@ -74,6 +78,7 @@ in { ]; exec-once = [ + "waybar" ]; bind = [ diff --git a/hosts/lars/waybar.nix b/hosts/lars/waybar.nix new file mode 100644 index 0000000..ac9533c --- /dev/null +++ b/hosts/lars/waybar.nix @@ -0,0 +1,15 @@ +{ config, lib, inputs, pkgs, ... }: +with lib; let + username = config.modules.other.system.username; + cfg = config.modules.waybar; +in { + options.modules.waybar = { + enable = mkEnableOption "hyprland"; + }; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.waybar.enable = true; + }; + }; +} From 5777514467968b15a5c84f3fd578b1ef7f1e59b1 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Sun, 14 Apr 2024 10:03:43 +0200 Subject: [PATCH 2/4] Add yazi --- hosts/lars/default.nix | 1 + modules/tui/default.nix | 1 + modules/tui/yazi.nix | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 modules/tui/yazi.nix diff --git a/hosts/lars/default.nix b/hosts/lars/default.nix index 0add695..135c60f 100644 --- a/hosts/lars/default.nix +++ b/hosts/lars/default.nix @@ -22,6 +22,7 @@ vesktop.enable = true; btop.enable = true; mpv.enable = true; + yazi.enable = true; zsh = { enable = true; diff --git a/modules/tui/default.nix b/modules/tui/default.nix index 8cf84cb..459fc7a 100644 --- a/modules/tui/default.nix +++ b/modules/tui/default.nix @@ -5,5 +5,6 @@ _: { ./neovim.nix # ./newsboat.nix ./ncmpcpp.nix + ./yazi.nix ]; } diff --git a/modules/tui/yazi.nix b/modules/tui/yazi.nix new file mode 100644 index 0000000..251d67e --- /dev/null +++ b/modules/tui/yazi.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: +with lib; let + cfg = config.modules.programs.yazi; + username = config.modules.other.system.username; +in { + options.modules.programs.yazi = { + enable = mkEnableOption "yazi"; + }; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.yazi = { + enable = true; + enableZshIntegration = true; + }; + }; + }; +} From ba34cd3256c1f36e101063bdc1e19f604e760476 Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Sun, 14 Apr 2024 20:41:13 +0200 Subject: [PATCH 3/4] hyprland syntax fix --- modules/gui/WM/hyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gui/WM/hyprland.nix b/modules/gui/WM/hyprland.nix index 8bcbc06..15beefc 100644 --- a/modules/gui/WM/hyprland.nix +++ b/modules/gui/WM/hyprland.nix @@ -47,7 +47,7 @@ in xwayland.enable = true; settings = { exec-once = if cfg.gnome-keyring then ["${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"] - else []); + else []; monitor = map ( m: "${m.device},${builtins.toString m.resolution.x}x${builtins.toString m.resolution.y}@${builtins.toString m.refresh_rate},${builtins.toString m.position.x}x${builtins.toString m.position.y},${builtins.toString m.scale},transform,${builtins.toString m.transform}" ) monitors; #TODO: default value From e40d39495ef8ce8ad056436c3b3685d917a55b8d Mon Sep 17 00:00:00 2001 From: LarsZauberer Date: Sun, 14 Apr 2024 21:11:01 +0200 Subject: [PATCH 4/4] fixing xdg stuff --- hosts/lars/default.nix | 2 +- hosts/lars/hyprland.nix | 13 +++++++++---- hosts/lars/programs.nix | 2 ++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/hosts/lars/default.nix b/hosts/lars/default.nix index 135c60f..dfed115 100644 --- a/hosts/lars/default.nix +++ b/hosts/lars/default.nix @@ -29,7 +29,7 @@ profiling = false; extraAliases = { cls = "clear"; - + Hyprland = "dbus-run-session Hyprland"; }; ohmyzsh = { enable = true; diff --git a/hosts/lars/hyprland.nix b/hosts/lars/hyprland.nix index 1357dc7..51b35d3 100644 --- a/hosts/lars/hyprland.nix +++ b/hosts/lars/hyprland.nix @@ -22,8 +22,8 @@ in { }; }; - config = mkIf cfg.enable { - environment.sessionVariables = mkIf cfg.nvidia.enable { + config = mkIf cfg.enable { + environment.sessionVariables = mkIf cfg.nvidia.enable { LIBVA_DRIVER_NAME = "nvidia"; XDG_SESSION_TYPE = "wayland"; GBM_BACKEND = "nvidia-drm"; @@ -38,11 +38,16 @@ in { GTK_USE_PORTAL = "1"; NIXOS_XDG_OPEN_USE_PORTAL = "1"; }; + programs.hyprland = { enable = true; - xwayland.enable = true; - }; + xwayland.enable = true; + }; + xdg.portal.wlr.enable = true; + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + xdg.portal.config.common.default = "gtk"; + xdg.portal.lxqt.enable = false; systemd.user.services.xdg-desktop-portal-gnome.enable = false; diff --git a/hosts/lars/programs.nix b/hosts/lars/programs.nix index 8997cfc..688597c 100644 --- a/hosts/lars/programs.nix +++ b/hosts/lars/programs.nix @@ -53,6 +53,8 @@ in { wl-clipboard pavucontrol wofi + dolphin + xdg-utils # xdg-mime script ]; }; }