From 1d2b3f799d232d4abe1a5f92c4d80b9131efedac Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Sun, 23 Feb 2025 18:30:30 +0100 Subject: [PATCH] some more desktop functionality --- README.md | 3 +- hosts/spectre-x360-2018/default.nix | 1 + modules/home-manager/fish.nix | 4 ++ .../home-manager/hyprland-customization.nix | 50 +++++++++++++++++-- modules/home-manager/xdg-portals.nix | 11 ++++ modules/nixos/hyprland.nix | 1 - modules/nixos/networking.nix | 3 ++ users/remy.nix | 2 +- 8 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 modules/home-manager/xdg-portals.nix diff --git a/README.md b/README.md index 37f4f6b..ec15675 100644 --- a/README.md +++ b/README.md @@ -44,4 +44,5 @@ This will create an iso image in the result directory. - https://fasterthanli.me/series/building-a-rust-service-with-nix/part-10 - https://ianthehenry.com/posts/how-to-learn-nix/profiles/ - https://github.com/JohnRTitor/nix-conf -- https://github.com/mwaldleben/nix-config \ No newline at end of file +- https://github.com/mwaldleben/nix-config +- https://github.com/anotherhadi/nixy diff --git a/hosts/spectre-x360-2018/default.nix b/hosts/spectre-x360-2018/default.nix index 42cd0fe..ded8da5 100644 --- a/hosts/spectre-x360-2018/default.nix +++ b/hosts/spectre-x360-2018/default.nix @@ -6,6 +6,7 @@ ./hardware-configuration.nix ../../modules/nixos/hyprland.nix ../../modules/nixos/monitoring.nix + ../../modules/nixos/networking.nix ../../modules/nixos/nvidia.nix ../../modules/nixos/pipewire.nix ../../modules/nixos/podman.nix diff --git a/modules/home-manager/fish.nix b/modules/home-manager/fish.nix index 1c27895..024591e 100644 --- a/modules/home-manager/fish.nix +++ b/modules/home-manager/fish.nix @@ -22,6 +22,10 @@ ]; }; + home.packages = [ + pkgs.fishPlugins.tide + ]; + # sets the "default" shell to fish # actually keeps bash as a posix-compliant default but starts fish if the shell is not bash # See https://nixos.wiki/wiki/Fish diff --git a/modules/home-manager/hyprland-customization.nix b/modules/home-manager/hyprland-customization.nix index 3c489ef..6c051bd 100644 --- a/modules/home-manager/hyprland-customization.nix +++ b/modules/home-manager/hyprland-customization.nix @@ -13,11 +13,24 @@ "$mod, return, exec, walker" "$mod_SHIFT, return, exec, kitty" "$mod, s, exec, code" + "$mod, Q, killactive," # Close window + "$mod, T, togglefloating," # Toggle Floating + + "$mod, left, movefocus, l" # Move focus left + "$mod, right, movefocus, r" # Move focus Right + "$mod, up, movefocus, u" # Move focus Up + "$mod, down, movefocus, d" # Move focus Down + # "$shiftMod, up, focusmonitor, -1" # Focus previous monitor + # "$shiftMod, down, focusmonitor, 1" # Focus next monitor + # "$shiftMod, left, layoutmsg, addmaster" # Add to master + # "$shiftMod, right, layoutmsg, removemaster" # Remove from master ]; general = { + resize_on_border = true; gaps_in = 5; gaps_out = 5; border_size = 1; + layout = "master"; }; misc = { @@ -26,12 +39,31 @@ input = { kb_layout = "de"; + kb_options = "caps:control"; + numlock_by_default = true; + # mouse input should be unchanged + natural_scroll = false; + touchpad = { + disable_while_typing = false; + natural_scroll = true; + }; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_fingers = 4; + workspace_swipe_touch = true; }; decoration = { rounding = 5; }; # plugin.virtual-desktops = {} + + monitor = [ + "eDP-1, highres, 0x0, 1.5" # the internal laptop monitor + ", preferred, auto, 1" # automatically add any newly detected monitor + ]; }; plugins = [ @@ -46,21 +78,33 @@ # the overlay makes this available as a home manager module programs.hyprpanel = { enable = true; + # autostart after hyprland hyprland.enable = true; overwrite.enable = true; overlay.enable = true; + + theme = "monochrome"; settings = { bar = { clock.format = "%H:%M"; clock.showIcon = false; launcher.icon = "🚀"; + launcher.autoDetectIcon = true; + workspaces.show_icons = true; + }; + }; + + layout = { + "bar.layouts" = { + "*" = { + left = ["workspaces"]; + middle = ["clock"]; + right = ["volume" "systray" "nm-applet" "notifications" ]; + }; }; }; - - - # Add custom widgets + styling }; diff --git a/modules/home-manager/xdg-portals.nix b/modules/home-manager/xdg-portals.nix new file mode 100644 index 0000000..4c1b255 --- /dev/null +++ b/modules/home-manager/xdg-portals.nix @@ -0,0 +1,11 @@ +{inputs, pkgs, ...}: +{ + xdg.enable = true; + + xdg.portal = { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + }; +} diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix index 9098389..5768876 100644 --- a/modules/nixos/hyprland.nix +++ b/modules/nixos/hyprland.nix @@ -21,5 +21,4 @@ wayland = true; }; - } diff --git a/modules/nixos/networking.nix b/modules/nixos/networking.nix index baca895..b649823 100644 --- a/modules/nixos/networking.nix +++ b/modules/nixos/networking.nix @@ -1,4 +1,7 @@ {lib, ...}:{ networking.networkmanager.enable = true; networking.networkmanager.wifi.powersave = lib.mkDefault true; + users.users.remy.extraGroups = [ + "networkmanager" + ]; } \ No newline at end of file diff --git a/users/remy.nix b/users/remy.nix index 0da3267..507af02 100644 --- a/users/remy.nix +++ b/users/remy.nix @@ -7,11 +7,11 @@ with lib.hm.gvariant; ../modules/home-manager/fish.nix ../modules/home-manager/flatpaks.nix ../modules/home-manager/hyprland-customization.nix - # ../modules/home-manager/gnome-shell-customization.nix ../modules/home-manager/keepassxc.nix ../modules/home-manager/obsidian.nix ../modules/home-manager/owncloud-client.nix ../modules/home-manager/thunderbird.nix + ../modules/home-manager/xdg-portals.nix ]; ## Home Manager configuration