summaryrefslogtreecommitdiffstats
path: root/modules/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'modules/desktop')
-rw-r--r--modules/desktop/hyprland.nix242
-rw-r--r--modules/desktop/niri.nix38
2 files changed, 27 insertions, 253 deletions
diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix
deleted file mode 100644
index 3ab743f..0000000
--- a/modules/desktop/hyprland.nix
+++ /dev/null
@@ -1,242 +0,0 @@
-{
- config,
- options,
- lib,
- pkgs,
- ...
-}: let
- hyprlandConf = config.modules.desktop.hyprland;
- device = config.modules.device;
- defaultApps = config.modules.desktop.defaultApplications.apps;
- configDir = config.nixosConfig.configDir;
-
- # binds $mod + [shift +] {1..10} to [move to] workspace {1..10}
- workspaces = builtins.concatLists (builtins.genList (
- x: let
- ws = let
- c = (x + 1) / 10;
- in
- builtins.toString (x + 1 - (c * 10));
- in
- [
- "$mod, ${ws}, exec, /etc/nixos/bin/hyprland/workspace ${toString (x + 1)}"
- "$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
- ]
- )
- 10);
-
- decoration = {
- rounding = 7;
- blur = {
- enabled = true;
- size = 3;
- passes = 1;
- };
- };
-
- animations = {
- enabled = true;
- animation = [
- "border, 1, 2, default"
- "fade, 1, 4, default"
- "windows, 1, 3, default, popin 80%"
- "workspaces, 1, 2, default, slide"
- ];
- };
-
- keybinds = let
- monocle = "dwindle:no_gaps_when_only";
- in [
- # Compositor commands
- "$mod ALTL, Q, exec, pkill Hyprland"
- "$mod, Q, killactive"
-
- # Layout
- "$mod, F, fullscreen"
- "$mod, Space, togglefloating"
- "$mod, S, togglesplit"
- "$mod, P, pseudo"
- "$mod SHIFT, grave, movetoworkspace, special"
- "$mod, grave, togglespecialworkspace"
-
- # Group
- "$mod, G, togglegroup"
- "$mod, TAB, changegroupactive"
-
- #Focus windows
- "$mod, left, movefocus, l"
- "$mod, right, movefocus, r"
- "$mod, up, movefocus, u"
- "$mod, down, movefocus, d"
-
- #Focus monitor
- "$mod SHIFT, left, focusmonitor, l"
- "$mod SHIFT, right, focusmonitor, r"
-
- #Exec binds
- "$mod, D, exec, wofi --show drun"
- "$mod, Return, exec, ${defaultApps.terminal.cmd}"
- "$mod, W, exec, ${defaultApps.browser.cmd}"
- "$mod ALT, B, exec, killall -SIGUSR2 waybar"
-
- #Screenshot
- "$mod, Print, exec, slurp | grim -g - ~/pic/$(date +%s).png"
- ]
- ++ workspaces;
-
- mousebinds = let
- in [
- "$mod, mouse:272, movewindow"
- "$mod, mouse:273, resizewindow"
- ];
-in {
- options.modules.desktop.hyprland = {
- enable = lib.mkOption {
- type = lib.types.bool;
- default = false;
- };
- xwayland = lib.mkOption {
- type = lib.types.bool;
- default = true;
- };
- };
-
- config = lib.mkIf (hyprlandConf.enable) (lib.mkMerge [
- {
- home.packages = [
- pkgs.killall
- pkgs.wl-clipboard
- pkgs.wdisplays
- pkgs.swaylock
- pkgs.swayidle
- pkgs.slurp
- pkgs.grim
- pkgs.mako
- pkgs.libnotify
- pkgs.wofi
- pkgs.jq
- pkgs.awww
- ];
-
- modules.device.displayProtocol = "wayland";
-
- xdg.portal = {
- enable = true;
- wlr = {
- enable = true;
- settings = {
- screencast = {
- chooser_type = "simple";
- chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
- };
- };
- };
- extraPortals = [
- pkgs.xdg-desktop-portal-gtk
- pkgs.xdg-desktop-portal-hyprland
- ];
- config.common.default = ["wlr" "gtk" "hyprland" ];
- };
-
- environment.sessionVariables.NIXOS_OZONE_WL = "1";
- home.manager.wayland.windowManager.hyprland = {
- enable = true;
- xwayland.enable = hyprlandConf.xwayland;
- systemd.enable = true;
-
- settings = {
- "$mod" = "SUPER";
-
- input = {
- kb_layout = "us";
- follow_mouse = 1;
- sensitivity = 0;
- };
-
- dwindle = {
- pseudotile = true;
- preserve_split = true;
- };
-
- general = {
- gaps_in = 5;
- gaps_out = 10;
- border_size = 2;
- "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
- "col.inactive_border" = "rgba(595959aa)";
-
- layout = "dwindle";
- };
- exec-once = [
- "swww init"
- "swww img ${configDir}/hypr/wallpaper.png"
- ];
-
- env = lib.mkMerge [
- ([
- "XDG_CURRENT_DESKTOP,Hyprland"
- "XDG_SESSION_TYPE,wayland"
- "XDG_SESSION_DESKTOP,Hyprland"
-
- "GDK_BACKEND,wayland,x11"
- "SDL_VIDEODRIVER,wayland"
- "CLUTTER_BACKEND,wayland"
- "MOZ_ENABLE_WAYLAND,1"
- "MOZ_DISABLE_RDD_SANDBOX,1"
- "_JAVA_AWT_WM_NONREPARENTING,1"
- "QT_AUTO_SCREEN_SCALE_FACTOR,1"
- "QT_QPA_PLATFORM,wayland"
- "QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
-
- "disable_hyprland_logo,true"
- "force_default_wallpaper,0"
- ])
- ( lib.mkIf (config.modules.device.gpu == "nvidia")
- [
- "GBM_BACKEND,nvidia"
- "__GLX_VENDOR_LIBRARY_NAME,nvidia"
- "LIBVA_DRIVER_NAME,nvidia"
- "NVD_BACKEND,direct"
- "WLR_DRM_NO_ATOMIC,1"
- "WLR_USE_LIBINPUT,1"
- "WLR_RENDERER_ALLOW_SOFTWARE,1"
- ])];
-
- decoration = decoration;
- animations = animations;
- bind = keybinds;
- bindm = mousebinds;
- };
- };
-
- programs.waybar = {
- enable = true;
- };
-
- home.manager.xdg.configFile."hypr/hyprpaper.conf".source = "${configDir}/hypr/hyprpaper.conf";
- #Symlink waybar
- system.userActivationScripts.linkwaybar.text = ''
- if [[ ! -h "$HOME/.config/waybar" ]]; then
- ln -s "${configDir}/waybar" "$HOME/.config/waybar"
- fi
- '';
-
- security.pam.services.swaylock = {};
- }
- (lib.mkIf (config.modules.desktop.greetd.enable) {
- services.greetd.settings = {
- default_session.command = ''
- ${pkgs.greetd.tuigreet}/bin/tuigreet \
- --time \
- --asterisks \
- --user-menu \
- --cmd Hyprland
- '';
- };
-
- environment.etc."greetd/environments".text = ''
- Hyprland
- '';
- })
- ]);
-}
diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix
index eeef603..292c5ba 100644
--- a/modules/desktop/niri.nix
+++ b/modules/desktop/niri.nix
@@ -21,8 +21,9 @@ in {
{
programs.niri.enable = true;
programs.waybar.enable = true;
- programs.xwayland.enable = true;
+ #programs.xwayland.enable = true;
+ services.gnome.gnome-keyring.enable = true;
home.manager.services.polkit-gnome.enable = true;
fonts.packages =
@@ -34,33 +35,50 @@ in {
libnotify
killall
wdisplays
- xwayland-satellite
wofi
mako
jq
awww
+ swaybg
+ networkmanagerapplet
+ xwayland-satellite
adwaita-icon-theme
adwaita-icon-theme-legacy
];
home.manager.xdg.configFile."niri/config.kdl".source = "${configDir}/niri/${config.networking.hostName}.kdl";
+ home.file.".icons/default".source = "${pkgs.adwaita-icon-theme}/share/icons/Adwaita";
+
+ home.manager.gtk.cursorTheme = {
+ name = "Adwaita";
+ size = 12;
+ };
+
+ xdg.portal = {
+ enable = true;
+ extraPortals = [
+ pkgs.xdg-desktop-portal-gtk
+ ];
+ config.common.default = ["gtk" ];
+ };
programs.regreet = {
enable = true;
- theme.name = "Adwaita";
+ theme.name = "Adwaita-dark";
cursorTheme.name = "Adwaita";
};
- home.file.".icons/default".source = "${pkgs.adwaita-icon-theme}/share/icons/Adwaita";
-
modules.device.displayProtocol = "wayland";
- environment.sessionVariables.NIXOS_OZONE_WL = "1";
+ environment = {
+ sessionVariables.NIXOS_OZONE_WL = "1";
+ pathsToLink = [ "/libexec" ];
+ };
- home.manager.gtk.cursorTheme = {
- name = "Adwaita";
- size = 12;
+ services.dbus = {
+ enable = true;
+ implementation = "broker";
};
system.userActivationScripts.linkwaybar.text = ''
@@ -69,7 +87,5 @@ in {
fi
'';
}
- (lib.mkIf (config.modules.desktop.greetd.enable) {
- })
]);
}