From 9baf54ef33082c63d2ed69c01980032d22b54f5d Mon Sep 17 00:00:00 2001 From: Amneesh Singh Date: Sun, 29 Jun 2025 19:39:56 +0530 Subject: [PATCH] home/natto: split wayland.nix Signed-off-by: Amneesh Singh --- home/common/direnv/default.nix | 8 ++--- home/common/emacs/default.nix | 2 +- home/natto/default.nix | 13 ++++++-- home/natto/hyprland.nix | 33 ++++++++++++++++++++ home/natto/music.nix | 3 +- home/natto/tofi.nix | 37 ++++++++++++++++++++++ home/natto/wayland.nix | 57 ++-------------------------------- 7 files changed, 86 insertions(+), 67 deletions(-) create mode 100644 home/natto/hyprland.nix create mode 100644 home/natto/tofi.nix diff --git a/home/common/direnv/default.nix b/home/common/direnv/default.nix index ebe3e06..3288fcc 100644 --- a/home/common/direnv/default.nix +++ b/home/common/direnv/default.nix @@ -1,8 +1,4 @@ -{ config, ... }: +{ ... }: { - programs = { - home-manager.enable = true; - password-store.enable = true; - direnv.enable = true; - }; + programs.direnv.enable = true; } diff --git a/home/common/emacs/default.nix b/home/common/emacs/default.nix index 15f531f..b87b360 100644 --- a/home/common/emacs/default.nix +++ b/home/common/emacs/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, inputs, lib, ... }: +{ pkgs, inputs, ... }: let emacs = pkgs.emacs-git-pgtk; configFile = ./config/emacs/config.org; diff --git a/home/natto/default.nix b/home/natto/default.nix index 2e1c107..c7f1c2a 100644 --- a/home/natto/default.nix +++ b/home/natto/default.nix @@ -12,9 +12,6 @@ ./browser.nix ./pdf.nix ./mpv.nix - ./foot.nix - # ./xsession.nix - ./wayland.nix ./pkgs.nix ./stuff.nix ./gtk.nix @@ -23,5 +20,15 @@ ./music.nix ./zsh.nix ./games.nix + + /* when xserver */ + # ./xsession.nix + + /* when wayland */ + ./wayland.nix + ./hyprland.nix + ./foot.nix + ./tofi.nix + ./ags ]; } diff --git a/home/natto/hyprland.nix b/home/natto/hyprland.nix new file mode 100644 index 0000000..1b03bfd --- /dev/null +++ b/home/natto/hyprland.nix @@ -0,0 +1,33 @@ +{ pkgs, inputs, config, conf, ... }: { + wayland = { + windowManager = { + hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + xwayland = { + enable = true; + }; + extraConfig = (builtins.readFile ./config/hypr/hyprland.conf) + + (with config.home.pointerCursor; '' + exec-once=hyprctl setcursor ${name} ${toString size} + '') + + (with conf.colors.argb { a = "ee"; };'' + general { + col.active_border = 0x${mauve} 0x${flamingo} 135deg + col.inactive_border = 0x${surface0} + } + ''); + }; + }; + }; + + home.packages = with pkgs; [ + grim + slurp + inputs.hyprland-contrib.packages.${pkgs.system}.grimblast + wl-clipboard + swayimg + swaybg + ]; +} diff --git a/home/natto/music.nix b/home/natto/music.nix index 80a2b49..8d576b7 100644 --- a/home/natto/music.nix +++ b/home/natto/music.nix @@ -18,8 +18,7 @@ in }; mpd-discord-rpc = { - # inherit (mpd) enable; - enable = false; + inherit (mpd) enable; settings = { id = 1039532008424099850; # dont really care format = { diff --git a/home/natto/tofi.nix b/home/natto/tofi.nix new file mode 100644 index 0000000..28631ab --- /dev/null +++ b/home/natto/tofi.nix @@ -0,0 +1,37 @@ +{ + conf, + pkgs, + config, + ... +}: +{ + home.file.tofi = { + source = pkgs.writeText "tofi-config" ( + pkgs.lib.generators.toKeyValue { } ( + with conf.colors.default; + { + # https://github.com/philj56/tofi/blob/master/themes/fullscreen + width = "100%"; + height = "100%"; + border-width = 0; + outline-width = 0; + padding-left = "35%"; + padding-top = "35%"; + result-spacing = 25; + num-results = 5; + font = "Fira Mono"; + font-size = 15; + text-color = foreground; + selection-color = rosewater; + selection-match-color = red; + background-color = "#000A"; + } + ) + ); + target = "${config.xdg.configHome}/tofi/config"; + }; + + home.packages = with pkgs; [ + tofi + ]; +} diff --git a/home/natto/wayland.nix b/home/natto/wayland.nix index eb8f9e4..48aa793 100644 --- a/home/natto/wayland.nix +++ b/home/natto/wayland.nix @@ -1,64 +1,11 @@ -{ pkgs, config, conf, inputs, ... }: +{ pkgs, inputs, ... }: { - imports = [ - ./ags - # ./eww - ]; - - wayland = { - windowManager = { - sway = { - enable = true; - }; - hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.hyprland; - portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - xwayland = { - enable = true; - }; - extraConfig = (builtins.readFile ./config/hypr/hyprland.conf) - + (with config.home.pointerCursor; '' - exec-once=hyprctl setcursor ${name} ${toString size} - '') - + (with conf.colors.argb { a = "ee"; };'' - general { - col.active_border = 0x${mauve} 0x${flamingo} 135deg - col.inactive_border = 0x${surface0} - } - ''); - }; - }; - }; - - home.file.tofi = { - source = pkgs.writeText "tofi-config" (pkgs.lib.generators.toKeyValue { } (with conf.colors.default; { - # https://github.com/philj56/tofi/blob/master/themes/fullscreen - width = "100%"; - height = "100%"; - border-width = 0; - outline-width = 0; - padding-left = "35%"; - padding-top = "35%"; - result-spacing = 25; - num-results = 5; - font = "Fira Mono"; - font-size = 15; - text-color = foreground; - selection-color = rosewater; - selection-match-color = red; - background-color = "#000A"; - })); - target = "${config.xdg.configHome}/tofi/config"; - }; - home.packages = with pkgs; [ - tofi - imv grim slurp inputs.hyprland-contrib.packages.${pkgs.system}.grimblast wl-clipboard + swayimg swaybg ]; }