From c3776d318aea1d127c44aceb67bd0a38eefbfc5f Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 29 Jun 2024 21:35:07 -0400 Subject: [PATCH] home/defaultApps: create xdg desktop entries for default apps so the user doesn't have to specify them --- homeManagerModules/apps/fuzzel/default.nix | 2 +- homeManagerModules/apps/vsCodium/default.nix | 2 +- homeManagerModules/apps/waybar/default.nix | 2 +- homeManagerModules/default.nix | 1 - homeManagerModules/defaultApps.nix | 107 +++++--- .../desktop/cinnamon/default.nix | 2 +- .../desktop/hyprland/default.nix | 8 +- homeManagerModules/desktop/sway/default.nix | 8 +- homeManagerModules/options.nix | 252 +++++++----------- homeManagerModules/scripts/default.nix | 10 - .../scripts/pp-adjuster/default.nix | 25 -- homes/aly/windowManagers/default.nix | 4 +- 12 files changed, 184 insertions(+), 239 deletions(-) delete mode 100644 homeManagerModules/scripts/default.nix delete mode 100644 homeManagerModules/scripts/pp-adjuster/default.nix diff --git a/homeManagerModules/apps/fuzzel/default.nix b/homeManagerModules/apps/fuzzel/default.nix index 90004df7..0178e127 100644 --- a/homeManagerModules/apps/fuzzel/default.nix +++ b/homeManagerModules/apps/fuzzel/default.nix @@ -13,7 +13,7 @@ icon-theme = "${config.ar.home.theme.iconTheme.name}"; layer = "overlay"; lines = 3; - terminal = config.ar.home.defaultApps.terminal.exe; + terminal = lib.getExe config.ar.home.defaultApps.terminal; width = 36; }; border = { diff --git a/homeManagerModules/apps/vsCodium/default.nix b/homeManagerModules/apps/vsCodium/default.nix index 20d06323..b25e8cf1 100644 --- a/homeManagerModules/apps/vsCodium/default.nix +++ b/homeManagerModules/apps/vsCodium/default.nix @@ -20,7 +20,7 @@ "git.autofetch" = true; "git.confirmSync" = false; "nix.formatterPath" = lib.getExe pkgs.alejandra; - "terminal.external.linuxExec" = config.ar.home.defaultApps.terminal.exe; + "terminal.external.linuxExec" = lib.getExe config.ar.home.defaultApps.terminal; "terminal.integrated.fontSize" = lib.mkDefault 14; "update.mode" = "none"; "window.menuBarVisibility" = "hidden"; diff --git a/homeManagerModules/apps/waybar/default.nix b/homeManagerModules/apps/waybar/default.nix index fc41b99f..3cf2db4f 100644 --- a/homeManagerModules/apps/waybar/default.nix +++ b/homeManagerModules/apps/waybar/default.nix @@ -138,7 +138,7 @@ "tooltip-format-wifi" = "{essid} ({signalStrength}%) {icon}"; "tooltip-format-ethernet" = "{ifname} "; "tooltip-format-disconnected" = "Disconnected"; - "on-click" = "${config.ar.home.defaultApps.terminalEditor.exe} --class nmtui -e ${pkgs.networkmanager}/bin/nmtui"; + "on-click" = "${lib.getExe config.ar.home.defaultApps.terminalEditor} --class nmtui -e ${pkgs.networkmanager}/bin/nmtui"; }; "tray" = {"spacing" = 15;}; "custom/logout" = { diff --git a/homeManagerModules/default.nix b/homeManagerModules/default.nix index acfc821c..97a21bea 100644 --- a/homeManagerModules/default.nix +++ b/homeManagerModules/default.nix @@ -9,7 +9,6 @@ inputs: self: { ./defaultApps.nix ./desktop ./options.nix - ./scripts ./services ./theme.nix ]; diff --git a/homeManagerModules/defaultApps.nix b/homeManagerModules/defaultApps.nix index 9a46de5b..5e00f20d 100644 --- a/homeManagerModules/defaultApps.nix +++ b/homeManagerModules/defaultApps.nix @@ -6,56 +6,91 @@ }: { config = lib.mkIf config.ar.home.defaultApps.enable { home.packages = with config.ar.home.defaultApps; [ - audioPlayer.package - editor.package - fileManager.package - imageViewer.package - pdfViewer.package - terminal.package - terminalEditor.package - videoPlayer.package - webBrowser.package + audioPlayer + editor + fileManager + imageViewer + pdfViewer + terminal + terminalEditor + videoPlayer + webBrowser ]; dconf = { enable = true; settings = { - "org/cinnamon/desktop/applications/terminal".exec = "${config.ar.home.defaultApps.terminal.exe}"; - "org/cinnamon/desktop/default-applications/terminal".exec = "${config.ar.home.defaultApps.terminal.exe}"; + "org/cinnamon/desktop/applications/terminal".exec = "${lib.getExe config.ar.home.defaultApps.terminal}"; + "org/cinnamon/desktop/default-applications/terminal".exec = "${lib.getExe config.ar.home.defaultApps.terminal}"; }; }; + xdg.desktopEntries = let + mkDefaultEntry = name: package: { + name = "Default ${name}"; + exec = "${lib.getExe package} %U"; + terminal = false; + settings = { + NoDisplay = "true"; + }; + }; + in { + defaultAudioPlayer = mkDefaultEntry "Audio Player" config.ar.home.defaultApps.audioPlayer; + defaultEditor = mkDefaultEntry "Editor" config.ar.home.defaultApps.editor; + defaultFileManager = mkDefaultEntry "File Manager" config.ar.home.defaultApps.fileManager; + defaultImageViewer = mkDefaultEntry "Image Viewer" config.ar.home.defaultApps.imageViewer; + defaultPdfViewer = mkDefaultEntry "PDF Viewer" config.ar.home.defaultApps.pdfViewer; + defaultVideoPlayer = mkDefaultEntry "Video Player" config.ar.home.defaultApps.videoPlayer; + defaultWebBrowser = mkDefaultEntry "Web Browser" config.ar.home.defaultApps.webBrowser; + }; + xdg.mimeApps = { enable = true; defaultApplications = { - "application/json" = config.ar.home.defaultApps.editor.desktop; - "application/pdf" = config.ar.home.defaultApps.pdfViewer.desktop; - "application/x-extension-htm" = config.ar.home.defaultApps.webBrowser.desktop; - "application/x-extension-html" = config.ar.home.defaultApps.webBrowser.desktop; - "application/x-extension-shtml" = config.ar.home.defaultApps.webBrowser.desktop; - "application/x-extension-xht" = config.ar.home.defaultApps.webBrowser.desktop; - "application/x-extension-xhtml" = config.ar.home.defaultApps.webBrowser.desktop; - "application/x-shellscript" = config.ar.home.defaultApps.editor.desktop; - "application/xhtml+xml" = config.ar.home.defaultApps.webBrowser.desktop; - "audio/*" = config.ar.home.defaultApps.audioPlayer.desktop; - "image/*" = config.ar.home.defaultApps.imageViewer.desktop; - "inode/directory" = config.ar.home.defaultApps.fileManager.desktop; - "text/html" = config.ar.home.defaultApps.webBrowser.desktop; - "text/markdown" = config.ar.home.defaultApps.editor.desktop; - "text/plain" = config.ar.home.defaultApps.editor.desktop; - "text/x-python" = config.ar.home.defaultApps.editor.desktop; - "text/xml" = config.ar.home.defaultApps.webBrowser.desktop; - "video/*" = config.ar.home.defaultApps.videoPlayer.desktop; - "x-scheme-handler/chrome" = config.ar.home.defaultApps.webBrowser.desktop; - "x-scheme-handler/ftp" = config.ar.home.defaultApps.webBrowser.desktop; - "x-scheme-handler/http" = config.ar.home.defaultApps.webBrowser.desktop; - "x-scheme-handler/https" = config.ar.home.defaultApps.webBrowser.desktop; + "application/json" = "defaultEditor.desktop"; + "application/pdf" = "defaultPdfViewer.desktop"; + "application/x-extension-htm" = "defaultWebBrowser.desktop"; + "application/x-extension-html" = "defaultWebBrowser.desktop"; + "application/x-extension-shtml" = "defaultWebBrowser.desktop"; + "application/x-extension-xht" = "defaultWebBrowser.desktop"; + "application/x-extension-xhtml" = "defaultWebBrowser.desktop"; + "application/x-shellscript" = "defaultEditor.desktop"; + "application/xhtml+xml" = "defaultWebBrowser.desktop"; + "audio/aac" = "defaultAudioPlayer.desktop"; + "audio/flac" = "defaultAudioPlayer.desktop"; + "audio/mpeg" = "defaultAudioPlayer.desktop"; + "audio/ogg" = "defaultAudioPlayer.desktop"; + "audio/opus" = "defaultAudioPlayer.desktop"; + "audio/wav" = "defaultAudioPlayer.desktop"; + "audio/webm" = "defaultAudioPlayer.desktop"; + "image/gif" = "defaultImageViewer.desktop"; + "image/jpeg" = "defaultImageViewer.desktop"; + "image/png" = "defaultImageViewer.desktop"; + "image/svg+xml" = "defaultImageViewer.desktop"; + "image/tiff" = "defaultImageViewer.desktop"; + "image/webp" = "defaultImageViewer.desktop"; + "inode/directory" = "defaultFileManager.desktop"; + "text/html" = "defaultWebBrowser.desktop"; + "text/markdown" = "defaultEditor.desktop"; + "text/plain" = "defaultEditor.desktop"; + "text/x-python" = "defaultEditor.desktop"; + "text/xml" = "defaultWebBrowser.desktop"; + "video/mp2t" = "defaultVideoPlayer.desktop"; + "video/mp4" = "defaultVideoPlayer.desktop"; + "video/mpeg" = "defaultVideoPlayer.desktop"; + "video/ogg" = "defaultVideoPlayer.desktop"; + "video/webm" = "defaultVideoPlayer.desktop"; + "video/x-msvideo" = "defaultVideoPlayer.desktop"; + "x-scheme-handler/chrome" = "defaultWebBrowser.desktop"; + "x-scheme-handler/ftp" = "defaultWebBrowser.desktop"; + "x-scheme-handler/http" = "defaultWebBrowser.desktop"; + "x-scheme-handler/https" = "defaultWebBrowser.desktop"; }; }; home.sessionVariables = { - BROWSER = "${config.ar.home.defaultApps.webBrowser.exe}"; - EDITOR = "${config.ar.home.defaultApps.terminalEditor.exe}"; - TERMINAL = "${config.ar.home.defaultApps.terminal.exe}"; + BROWSER = "${lib.getExe config.ar.home.defaultApps.webBrowser}"; + EDITOR = "${lib.getExe config.ar.home.defaultApps.terminalEditor}"; + TERMINAL = "${lib.getExe config.ar.home.defaultApps.terminal}"; }; }; } diff --git a/homeManagerModules/desktop/cinnamon/default.nix b/homeManagerModules/desktop/cinnamon/default.nix index c5406859..57343ad5 100644 --- a/homeManagerModules/desktop/cinnamon/default.nix +++ b/homeManagerModules/desktop/cinnamon/default.nix @@ -64,7 +64,7 @@ "org/cinnamon/desktop/keybindings/custom-keybindings/custom0" = { binding = ["e"]; name = "Open Editor"; - command = "${config.ar.home.defaultApps.editor.exe}"; + command = "${lib.getExe config.ar.home.defaultApps.editor}"; }; }; }; diff --git a/homeManagerModules/desktop/hyprland/default.nix b/homeManagerModules/desktop/hyprland/default.nix index 8e5d7e20..47f1b378 100644 --- a/homeManagerModules/desktop/hyprland/default.nix +++ b/homeManagerModules/desktop/hyprland/default.nix @@ -16,14 +16,14 @@ # Default apps defaultApps = { - browser = config.ar.home.defaultApps.webBrowser.exe; - editor = config.ar.home.defaultApps.editor.exe; - fileManager = config.ar.home.defaultApps.fileManager.exe; + browser = lib.getExe config.ar.home.defaultApps.webBrowser; + editor = lib.getExe config.ar.home.defaultApps.editor; + fileManager = lib.getExe config.ar.home.defaultApps.fileManager; launcher = lib.getExe pkgs.fuzzel; lock = lib.getExe pkgs.swaylock; logout = lib.getExe pkgs.wlogout; passwordManager = lib.getExe' pkgs.keepassxc "keepassxc"; - terminal = config.ar.home.defaultApps.terminal.exe; + terminal = lib.getExe config.ar.home.defaultApps.terminal; virtKeyboard = lib.getExe' pkgs.squeekboard "squeekboard"; }; diff --git a/homeManagerModules/desktop/sway/default.nix b/homeManagerModules/desktop/sway/default.nix index 2e2043ca..611873fc 100644 --- a/homeManagerModules/desktop/sway/default.nix +++ b/homeManagerModules/desktop/sway/default.nix @@ -23,10 +23,10 @@ swaymsg = lib.getExe' config.wayland.windowManager.sway.package "swaymsg"; # Default apps - browser = config.ar.home.defaultApps.webBrowser.exe; - fileManager = config.ar.home.defaultApps.fileManager.exe; - editor = config.ar.home.defaultApps.editor.exe; - terminal = config.ar.home.defaultApps.terminal.exe; + browser = lib.getExe config.ar.home.defaultApps.webBrowser; + fileManager = lib.getExe config.ar.home.defaultApps.fileManager; + editor = lib.getExe config.ar.home.defaultApps.editor; + terminal = lib.getExe config.ar.home.defaultApps.terminal; brightness = lib.getExe' pkgs.swayosd "swayosd-client"; brightness_up = "${brightness} --brightness=raise"; diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index d5d24f5d..6b901abc 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -9,246 +9,166 @@ apps = { alacritty.enable = lib.mkEnableOption "Alacritty terminal."; bash.enable = lib.mkEnableOption "Bash defaults."; + chromium = { enable = lib.mkEnableOption "Chromium-based browser with default extensions."; + package = lib.mkOption { description = "Package for Chromium."; default = pkgs.brave; type = lib.types.package; }; }; + emacs.enable = lib.mkEnableOption "Emacs text editor."; fastfetch.enable = lib.mkEnableOption "Fastfetch."; firefox.enable = lib.mkEnableOption "Firefox web browser."; fuzzel.enable = lib.mkEnableOption "Fuzzel app launcher."; + keepassxc = { enable = lib.mkEnableOption "KeePassXC password manager."; + settings = lib.mkOption { description = "KeePassXC settings."; default = {}; type = lib.types.attrs; }; }; + librewolf.enable = lib.mkEnableOption "Librewolf web browser."; mako.enable = lib.mkEnableOption "Mako notification daemon."; + nemo.enable = lib.mkOption { description = "Cinnamon Nemo file manager."; - default = config.ar.home.defaultApps.fileManager.package == pkgs.cinnamon.nemo; + default = config.ar.home.defaultApps.fileManager == pkgs.cinnamon.nemo; type = lib.types.bool; }; + neovim.enable = lib.mkEnableOption "Neovim text editor."; swaylock.enable = lib.mkEnableOption "Swaylock screen locker."; thunar.enable = lib.mkOption { description = "Thunar file manager."; - default = config.ar.home.defaultApps.fileManager.package == pkgs.xfce.thunar; + default = config.ar.home.defaultApps.fileManager == pkgs.xfce.thunar; type = lib.types.bool; }; + tmux.enable = lib.mkEnableOption "Tmux shell session manager."; vsCodium.enable = lib.mkEnableOption "VSCodium text editor."; waybar.enable = lib.mkEnableOption "Waybar wayland panel."; wlogout.enable = lib.mkEnableOption "Wlogout session prompt."; }; + defaultApps = { enable = lib.mkEnableOption "Declaratively set default apps and file associations."; - audioPlayer = { - exe = lib.mkOption { - description = "Default audio player executable."; - default = lib.getExe config.ar.home.defaultApps.audioPlayer.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default audio player desktop file."; - default = config.ar.home.defaultApps.videoPlayer.desktop; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default audio player package."; - default = config.ar.home.defaultApps.videoPlayer.package; - type = lib.types.package; - }; + audioPlayer = lib.mkOption { + description = "Default audio player package."; + default = config.ar.home.defaultApps.videoPlayer; + type = lib.types.package; }; - editor = { - exe = lib.mkOption { - description = "Default editor executable."; - default = lib.getExe config.ar.home.defaultApps.editor.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default editor desktop file."; - default = "codium.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default editor package."; - default = config.programs.vscode.package; - type = lib.types.package; - }; + + editor = lib.mkOption { + description = "Default editor package."; + default = config.programs.vscode.package; + type = lib.types.package; }; - fileManager = { - exe = lib.mkOption { - description = "Default file manager executable."; - default = lib.getExe config.ar.home.defaultApps.fileManager.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default file manager desktop file."; - default = "nemo.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default file manager package."; - default = pkgs.cinnamon.nemo; - type = lib.types.package; - }; + + fileManager = lib.mkOption { + description = "Default file manager package."; + default = pkgs.cinnamon.nemo; + type = lib.types.package; }; - imageViewer = { - exe = lib.mkOption { - description = "Default image viewer executable."; - default = lib.getExe config.ar.home.defaultApps.imageViewer.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default image viewer desktop file name."; - default = "org.gnome.eog.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default image viewer package."; - default = pkgs.gnome.eog; - type = lib.types.package; - }; + + imageViewer = lib.mkOption { + description = "Default image viewer package."; + default = pkgs.gnome.eog; + type = lib.types.package; }; - pdfViewer = { - exe = lib.mkOption { - description = "Default PDF viewer executable."; - default = lib.getExe config.ar.home.defaultApps.pdfEditor.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default PDF viewer desktop file."; - default = "org.gnome.Evince.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default PDF viewer package."; - default = pkgs.evince; - type = lib.types.package; - }; + + pdfViewer = lib.mkOption { + description = "Default PDF viewer package."; + default = pkgs.evince; + type = lib.types.package; }; - terminal = { - exe = lib.mkOption { - description = "Default terminal executable."; - default = lib.getExe config.ar.home.defaultApps.terminal.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default terminal desktop file."; - default = "alacritty.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default terminal package."; - default = config.programs.alacritty.package; - type = lib.types.package; - }; + + terminal = lib.mkOption { + description = "Default terminal package."; + default = config.programs.alacritty.package; + type = lib.types.package; }; - terminalEditor = { - exe = lib.mkOption { - description = "Default terminal editor executable."; - default = lib.getExe config.ar.home.defaultApps.terminalEditor.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default terminal editor desktop file."; - default = "nvim.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default terminal editor package."; - default = config.programs.nixvim.package; - type = lib.types.package; - }; + + terminalEditor = lib.mkOption { + description = "Default terminal editor package."; + default = config.programs.nixvim.package; + type = lib.types.package; }; - videoPlayer = { - exe = lib.mkOption { - description = "Default video player executable."; - default = lib.getExe config.ar.home.defaultApps.videoPlayer.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default video player desktop file."; - default = "io.github.celluloid_player.Celluloid.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default video player package."; - default = pkgs.celluloid; - type = lib.types.package; - }; + + videoPlayer = lib.mkOption { + description = "Default video player package."; + default = pkgs.celluloid; + type = lib.types.package; }; - webBrowser = { - exe = lib.mkOption { - description = "Default web browser executable."; - default = lib.getExe config.ar.home.defaultApps.webBrowser.package; - type = lib.types.str; - }; - desktop = lib.mkOption { - description = "Default web browser desktop file."; - default = "firefox.desktop"; - type = lib.types.str; - }; - package = lib.mkOption { - description = "Default web browser package."; - default = config.programs.firefox.package; - type = lib.types.package; - }; + + webBrowser = lib.mkOption { + description = "Default web browser package."; + default = config.programs.firefox.package; + type = lib.types.package; }; }; + desktop = { cinnamon.enable = lib.mkOption { description = "Cinnamon with sane defaults"; default = osConfig.ar.desktop.cinnamon.enable; type = lib.types.bool; }; + gnome.enable = lib.mkOption { description = "GNOME with sane defaults."; default = osConfig.ar.desktop.gnome.enable; type = lib.types.bool; }; + hyprland = { enable = lib.mkOption { description = "Hyprland with full desktop session components."; default = osConfig.ar.desktop.hyprland.enable; type = lib.types.bool; }; + autoSuspend = lib.mkOption { description = "Whether to autosuspend on idle."; default = config.ar.home.desktop.hyprland.enable; type = lib.types.bool; }; + randomWallpaper = lib.mkOption { description = "Whether to enable random wallpaper script."; default = config.ar.home.desktop.hyprland.enable; type = lib.types.bool; }; + redShift = lib.mkOption { description = "Whether to redshift display colors at night."; default = config.ar.home.desktop.hyprland.enable; type = lib.types.bool; }; + tabletMode = { enable = lib.mkEnableOption "Tablet mode for hyprland."; + autoRotate = lib.mkOption { description = "Whether to autorotate screen."; default = config.ar.home.desktop.hyprland.tabletMode.enable; type = lib.types.bool; }; + menuButton = lib.mkOption { description = "Whether to add menu button for waybar."; default = config.ar.home.desktop.hyprland.tabletMode.enable; type = lib.types.bool; }; + virtKeyboard = lib.mkOption { description = "Whether to enable dynamic virtual keyboard."; default = config.ar.home.desktop.hyprland.tabletMode.enable; @@ -256,50 +176,54 @@ }; }; }; + sway = { enable = lib.mkOption { description = "Sway with full desktop session components."; default = osConfig.ar.desktop.sway.enable; type = lib.types.bool; }; + autoSuspend = lib.mkOption { description = "Whether to autosuspend on idle."; default = config.ar.home.desktop.sway.enable; type = lib.types.bool; }; + randomWallpaper = lib.mkOption { description = "Whether to enable random wallpaper script."; default = config.ar.home.desktop.sway.enable; type = lib.types.bool; }; + redShift = lib.mkOption { description = "Whether to redshift display colors at night."; default = config.ar.home.desktop.sway.enable; type = lib.types.bool; }; }; + startupApps = lib.mkOption { description = "Apps to launch at startup"; default = []; type = lib.types.listOf (lib.types.str); }; }; - scripts = { - pp-adjuster.enable = lib.mkEnableOption "pp-adjuster script."; - }; + services = { mpd = { - enable = - lib.mkEnableOption "MPD user service."; + enable = lib.mkEnableOption "MPD user service."; + musicDirectory = lib.mkOption { description = "Name of music directory"; default = config.xdg.userDirs.music; type = lib.types.str; }; }; + easyeffects = { - enable = - lib.mkEnableOption "EasyEffects user service."; + enable = lib.mkEnableOption "EasyEffects user service."; + preset = lib.mkOption { description = "Name of preset to start with."; default = ""; @@ -317,23 +241,27 @@ default = "catppuccin-frappe-mauve-compact+normal"; type = lib.types.str; }; + package = lib.mkOption { description = "GTK theme package."; default = pkgs.catppuccin-gtk; type = lib.types.package; }; + hideTitleBar = lib.mkOption { description = "Whether to hide GTK3/4 titlebars (useful for some window managers)."; default = false; type = lib.types.bool; }; }; + qt = { name = lib.mkOption { description = "Qt Kvantum theme name."; default = "Catppuccin-Frappe-Mauve"; type = lib.types.str; }; + package = lib.mkOption { description = "Qt Kvantum theme package."; default = pkgs.catppuccin-kvantum; @@ -346,100 +274,118 @@ default = "Papirus-Dark"; type = lib.types.str; }; + package = lib.mkOption { description = "Icon theme package."; default = pkgs.catppuccin-papirus-folders; type = lib.types.package; }; }; + cursorTheme = { name = lib.mkOption { description = "Cursor theme name."; default = "Catppuccin-Frappe-Dark-Cursors"; type = lib.types.str; }; + size = lib.mkOption { description = "Cursor size."; default = 24; type = lib.types.int; }; + package = lib.mkOption { description = "Cursor theme package."; default = pkgs.catppuccin-cursors.frappeDark; type = lib.types.package; }; }; + font = { name = lib.mkOption { description = "Font name."; default = "NotoSans Nerd Font"; type = lib.types.str; }; + size = lib.mkOption { description = "Font size."; default = 11; type = lib.types.int; }; + package = lib.mkOption { description = "Font package."; default = pkgs.nerdfonts; type = lib.types.package; }; }; + terminalFont = { name = lib.mkOption { description = "Font name."; default = "NotoSansM Nerd Font"; type = lib.types.str; }; + size = lib.mkOption { description = "Font size."; default = 11; type = lib.types.int; }; + package = lib.mkOption { description = "Font package."; default = pkgs.nerdfonts; type = lib.types.package; }; }; + colors = { preferDark = lib.mkOption { description = "Whether to prefer dark mode apps or not."; default = config.ar.home.theme.enable; type = lib.types.bool; }; + text = lib.mkOption { description = "Text color."; default = "#FAFAFA"; type = lib.types.str; }; + background = lib.mkOption { description = "Background color."; default = "#232634"; type = lib.types.str; }; + primary = lib.mkOption { description = "Primary color."; default = "#CA9EE6"; type = lib.types.str; }; + secondary = lib.mkOption { description = "Secondary color."; default = "#99D1DB"; type = lib.types.str; }; + inactive = lib.mkOption { description = "Inactive color."; default = "#626880"; type = lib.types.str; }; + shadow = lib.mkOption { description = "Drop shadow color."; default = "#1A1A1A"; type = lib.types.str; }; }; + wallpaper = lib.mkOption { description = "Default wallpaper."; default = "${config.xdg.dataHome}/backgrounds/jr-korpa-9XngoIpxcEo-unsplash.jpg"; diff --git a/homeManagerModules/scripts/default.nix b/homeManagerModules/scripts/default.nix deleted file mode 100644 index 34a3a7d0..00000000 --- a/homeManagerModules/scripts/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - imports = [ - ./pp-adjuster - ]; -} diff --git a/homeManagerModules/scripts/pp-adjuster/default.nix b/homeManagerModules/scripts/pp-adjuster/default.nix deleted file mode 100644 index 232ebe9f..00000000 --- a/homeManagerModules/scripts/pp-adjuster/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: let - pp-adjuster = pkgs.writeShellScriptBin "pp-adjuster" '' - current_profile=$(${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} get | tr -d '[:space:]') - - if [ "$current_profile" == "power-saver" ]; then - ${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set balanced - elif [ "$current_profile" == "balanced" ]; then - ${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set performance - elif [ "$current_profile" == "performance" ]; then - ${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} set power-saver - fi - - new_profile=$(${lib.getExe' pkgs.power-profiles-daemon "powerprofilesctl"} get | tr -d '[:space:]') - ${lib.getExe pkgs.libnotify} "Power profile set to $new_profile." - ''; -in { - config = lib.mkIf config.ar.home.scripts.pp-adjuster.enable { - home.packages = [pp-adjuster]; - }; -} diff --git a/homes/aly/windowManagers/default.nix b/homes/aly/windowManagers/default.nix index 7115b373..150e809c 100644 --- a/homes/aly/windowManagers/default.nix +++ b/homes/aly/windowManagers/default.nix @@ -21,12 +21,12 @@ hyprland.extraConfig = '' # Workspace - Browser - workspace = 1, defaultName:web, on-created-empty:${config.ar.home.defaultApps.webBrowser.exe} + workspace = 1, defaultName:web, on-created-empty:${lib.getExe config.ar.home.defaultApps.webBrowser} windowrulev2 = workspace 1,class:(firefox) windowrulev2 = workspace 1,class:(brave-browser) # Workspace - Coding - workspace = 2, defaultName:code, on-created-empty:${config.ar.home.defaultApps.editor.exe} + workspace = 2, defaultName:code, on-created-empty:${lib.getExe config.ar.home.defaultApps.editor} windowrulev2 = workspace 2,class:(codium-url-handler) # Workspace - Work