197 lines
6.4 KiB
Nix
197 lines
6.4 KiB
Nix
{
|
|
config,
|
|
inputs,
|
|
lib,
|
|
osConfig,
|
|
perSystem,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
inherit (config.lib.stylix) colors;
|
|
inherit (lib) mkIf mkEnableOption mkForce getExe;
|
|
cfg = config.desktop.hyprland;
|
|
hostname = osConfig.networking.hostName;
|
|
cursorSize = config.stylix.cursor.size;
|
|
ifLaptop = mkIf (hostname != "dunamis");
|
|
launcher = getExe pkgs.walker;
|
|
lockscreen = getExe pkgs.hyprlock;
|
|
in {
|
|
options = {
|
|
desktop.hyprland.enable =
|
|
mkEnableOption "enable hyprland desktop";
|
|
};
|
|
config = mkIf cfg.enable {
|
|
stylix.targets = {
|
|
waybar.enable = false;
|
|
hyprland.enable = false;
|
|
hyprlock.enable = false;
|
|
qt.enable = false;
|
|
};
|
|
home.pointerCursor.hyprcursor = {
|
|
enable = true;
|
|
size = cursorSize;
|
|
};
|
|
dconf.settings = {
|
|
"org/gnome/desktop/wm/preferences" = {
|
|
button-layout = "icon:close";
|
|
};
|
|
"org/gnome/desktop/interface" = {
|
|
icon-theme = config.gtk.iconTheme.name;
|
|
color-scheme =
|
|
if config.stylix.polarity == "dark"
|
|
then lib.mkDefault "prefer-dark"
|
|
else lib.mkDefault "prefer-light";
|
|
};
|
|
};
|
|
gtk = {
|
|
enable = true;
|
|
iconTheme = let
|
|
name =
|
|
if (lib.strings.hasPrefix "gruvbox" osConfig.module.stylix.theme)
|
|
then "Gruvbox-Plus-Dark"
|
|
else if config.stylix.polarity == "dark"
|
|
then "Papirus-Dark"
|
|
else "Papirus-Light";
|
|
package =
|
|
if (lib.strings.hasPrefix "gruvbox" osConfig.module.stylix.theme)
|
|
then pkgs.gruvbox-plus-icons
|
|
else if (lib.strings.hasPrefix "rose-pine" osConfig.module.stylix.theme)
|
|
then pkgs.papirus-icon-theme.override {color = "indigo";}
|
|
else if (lib.strings.hasPrefix "nord" osConfig.module.stylix.theme)
|
|
then pkgs.papirus-icon-theme.override {color = "nordic";}
|
|
else pkgs.papirus-icon-theme;
|
|
in {inherit name package;};
|
|
};
|
|
qt = {
|
|
enable = true;
|
|
platformTheme.name = "gtk3";
|
|
};
|
|
|
|
programs.walker = import ./programs/walker {inherit config inputs pkgs;};
|
|
programs.waybar = import ./programs/waybar {inherit config colors getExe ifLaptop pkgs;};
|
|
wayland.windowManager.hyprland = import ./hyprland.nix {inherit config osConfig perSystem launcher lockscreen;};
|
|
services = import ./services {inherit pkgs lockscreen getExe perSystem;};
|
|
|
|
home.packages = with pkgs;
|
|
[
|
|
# gui libadwaita apps
|
|
celluloid # mpv gui in libadwaita
|
|
gnome-text-editor
|
|
helvum # pipewire patchbay in rust
|
|
junction # app chooser
|
|
loupe # image viewer and editor in rust
|
|
mission-center # task manager in rust (partly)
|
|
nautilus # file manager
|
|
overskride # bluetooth gui in rust
|
|
papers # pdf reader in rust
|
|
pika-backup # borg gui in rust
|
|
pwvucontrol # pipewire gui in rust
|
|
sonusmix # pipewire routing tool in rust
|
|
wdisplays # wlroots display configurator
|
|
]
|
|
++ [
|
|
# misc utils
|
|
(ifLaptop brightnessctl)
|
|
grim
|
|
slurp
|
|
hyprshot
|
|
dconf
|
|
libnotify
|
|
playerctl
|
|
wl-clipboard-rs # wl-clipboard in rust
|
|
];
|
|
xdg = {
|
|
mime.enable = true;
|
|
mimeApps = {
|
|
enable = true;
|
|
defaultApplications = let
|
|
file_manager = ["org.gnome.Nautilus.desktop"];
|
|
image_viewer = ["org.gnome.Loupe.desktop"];
|
|
pdf_reader = ["org.gnome.Papers.desktop"];
|
|
video_player = ["io.github.celluloid_player.Celluloid.desktop"];
|
|
web_browser = ["re.sonny.Junction.desktop"];
|
|
in {
|
|
"application/pdf" = pdf_reader;
|
|
"image/jpeg" = image_viewer;
|
|
"image/png" = image_viewer;
|
|
"inode/directory" = file_manager;
|
|
"text/html" = web_browser;
|
|
"video/mp4" = video_player;
|
|
"video/mpeg" = video_player;
|
|
"video/x-matroska" = video_player;
|
|
"video/x-mpeg" = video_player;
|
|
"x-scheme-handler/about" = web_browser;
|
|
"x-scheme-handler/http" = web_browser;
|
|
"x-scheme-handler/https" = web_browser;
|
|
"x-scheme-handler/unknown" = web_browser;
|
|
};
|
|
};
|
|
# desktopEntries = {
|
|
# zen-browser-profile = {
|
|
# name = "Zen Browser (Choose profile)";
|
|
# icon = "app.zen_browser.zen";
|
|
# exec = "flatpak run --branch=stable --arch=x86_64 --command=launch-script.sh --file-forwarding app.zen_browser.zen --ProfileManager @@u %u @@";
|
|
# };
|
|
# logseq-wayland = {
|
|
# name = "Logseq Desktop (Wayland)";
|
|
# icon = "com.logseq.Logseq";
|
|
# exec = "flatpak run --branch=stable --arch=x86_64 --command=run.sh --file-forwarding com.logseq.Logseq @@u %U @@ --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations";
|
|
# };
|
|
# };
|
|
};
|
|
systemd.user = {
|
|
settings.Manager.DefaultEnvironment = {
|
|
QT_QPA_PLATFORM = "wayland";
|
|
};
|
|
targets.tray.Unit.Description = "Home Manager System Tray"; # workaround for udiskie
|
|
services = let
|
|
mkGraphicalService = config: graphicalService // config;
|
|
graphicalService = {
|
|
Install.WantedBy = ["hyprland-session.target"];
|
|
Unit = {
|
|
Requisite = ["graphical-session.target"];
|
|
PartOf = ["graphical-session.target"];
|
|
After = ["graphical-session.target"];
|
|
};
|
|
Service = {
|
|
Restart = "on-failure";
|
|
TimeoutStopSec = 10;
|
|
RestartSec = 1;
|
|
};
|
|
};
|
|
in {
|
|
copyq = mkGraphicalService {
|
|
Service =
|
|
graphicalService.Service
|
|
// {
|
|
Environment = mkForce "QT_QPA_PLATFORM=wayland";
|
|
};
|
|
};
|
|
hyprpolkitagent = mkGraphicalService {
|
|
Service =
|
|
graphicalService.Service
|
|
// {
|
|
Type = "simple";
|
|
ExecStart = "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent";
|
|
};
|
|
};
|
|
hyprsunset = mkGraphicalService {
|
|
Unit =
|
|
graphicalService.Unit
|
|
// {
|
|
ConditionEnvironment = "WAYLAND_DISPLAY";
|
|
};
|
|
Service =
|
|
graphicalService.Service
|
|
// {
|
|
Type = "simple";
|
|
Slice = "session.slice";
|
|
ExecStart = "${getExe perSystem.hyprsunset.hyprsunset} -t 6500";
|
|
};
|
|
};
|
|
walker = mkGraphicalService {};
|
|
};
|
|
};
|
|
};
|
|
}
|