diff --git a/homeManagerModules/defaultApps.nix b/homeManagerModules/defaultApps.nix index e6de28dc..05ef8a37 100644 --- a/homeManagerModules/defaultApps.nix +++ b/homeManagerModules/defaultApps.nix @@ -3,107 +3,106 @@ lib, pkgs, ... -}: { - config = let - cfg = config.ar.home.defaultApps; - inherit - (import ./mimetypes.nix) - audioFiles - browserFiles - documentFiles - editorFiles - imageFiles - videoFiles - ; - in - lib.mkIf cfg.enable { - dconf = { - enable = true; - settings = { - "org/cinnamon/desktop/applications/terminal".exec = "${lib.getExe cfg.terminal}"; - "org/cinnamon/desktop/default-applications/terminal".exec = "${lib.getExe cfg.terminal}"; - }; - }; - - home = { - packages = with cfg; [ - audioPlayer - editor - fileManager - imageViewer - pdfViewer - terminal - terminalEditor - videoPlayer - webBrowser - ]; - - sessionVariables = { - BROWSER = "${lib.getExe cfg.webBrowser}"; - EDITOR = "${lib.getExe cfg.terminalEditor}"; - TERMINAL = "${lib.getExe cfg.terminal}"; - }; - }; - - xdg = { - mimeApps = { - enable = true; - - defaultApplications = let - mkDefaults = files: desktopFile: lib.genAttrs files (_: [desktopFile]); - audioTypes = - mkDefaults audioFiles - "defaultAudioPlayer.desktop"; - - browserTypes = - mkDefaults browserFiles - "defaultWebBrowser.desktop"; - - documentTypes = - mkDefaults documentFiles - "defaultPdfViewer.desktop"; - - editorTypes = - mkDefaults editorFiles - "defaultEditor.desktop"; - - folderTypes = {"inode/directory" = "defaultFileManager.desktop";}; - - imageTypes = - mkDefaults imageFiles - "defaultImageViewer.desktop"; - - videoTypes = - mkDefaults videoFiles - "defaultVideoPlayer.desktop"; - in - audioTypes - // browserTypes - // documentTypes - // editorTypes - // folderTypes - // imageTypes - // videoTypes; - }; - - desktopEntries = let - mkDefaultEntry = name: package: { - name = "Default ${name}"; - exec = "${lib.getExe package} %U"; - terminal = false; - settings = { - NoDisplay = "true"; - }; - }; - in { - defaultAudioPlayer = mkDefaultEntry "Audio Player" cfg.audioPlayer; - defaultEditor = mkDefaultEntry "Editor" cfg.editor; - defaultFileManager = mkDefaultEntry "File Manager" cfg.fileManager; - defaultImageViewer = mkDefaultEntry "Image Viewer" cfg.imageViewer; - defaultPdfViewer = mkDefaultEntry "PDF Viewer" cfg.pdfViewer; - defaultVideoPlayer = mkDefaultEntry "Video Player" cfg.videoPlayer; - defaultWebBrowser = mkDefaultEntry "Web Browser" cfg.webBrowser; - }; +}: let + cfg = config.ar.home.defaultApps; + inherit + (import ./mimetypes.nix) + audioFiles + browserFiles + documentFiles + editorFiles + imageFiles + videoFiles + ; +in { + config = lib.mkIf cfg.enable { + dconf = { + enable = true; + settings = { + "org/cinnamon/desktop/applications/terminal".exec = "${lib.getExe cfg.terminal}"; + "org/cinnamon/desktop/default-applications/terminal".exec = "${lib.getExe cfg.terminal}"; }; }; + + home = { + packages = with cfg; [ + audioPlayer + editor + fileManager + imageViewer + pdfViewer + terminal + terminalEditor + videoPlayer + webBrowser + ]; + + sessionVariables = { + BROWSER = "${lib.getExe cfg.webBrowser}"; + EDITOR = "${lib.getExe cfg.terminalEditor}"; + TERMINAL = "${lib.getExe cfg.terminal}"; + }; + }; + + xdg = { + mimeApps = { + enable = true; + + defaultApplications = let + mkDefaults = files: desktopFile: lib.genAttrs files (_: [desktopFile]); + audioTypes = + mkDefaults audioFiles + "defaultAudioPlayer.desktop"; + + browserTypes = + mkDefaults browserFiles + "defaultWebBrowser.desktop"; + + documentTypes = + mkDefaults documentFiles + "defaultPdfViewer.desktop"; + + editorTypes = + mkDefaults editorFiles + "defaultEditor.desktop"; + + folderTypes = {"inode/directory" = "defaultFileManager.desktop";}; + + imageTypes = + mkDefaults imageFiles + "defaultImageViewer.desktop"; + + videoTypes = + mkDefaults videoFiles + "defaultVideoPlayer.desktop"; + in + audioTypes + // browserTypes + // documentTypes + // editorTypes + // folderTypes + // imageTypes + // videoTypes; + }; + + desktopEntries = let + mkDefaultEntry = name: package: { + name = "Default ${name}"; + exec = "${lib.getExe package} %U"; + terminal = false; + settings = { + NoDisplay = "true"; + }; + }; + in { + defaultAudioPlayer = mkDefaultEntry "Audio Player" cfg.audioPlayer; + defaultEditor = mkDefaultEntry "Editor" cfg.editor; + defaultFileManager = mkDefaultEntry "File Manager" cfg.fileManager; + defaultImageViewer = mkDefaultEntry "Image Viewer" cfg.imageViewer; + defaultPdfViewer = mkDefaultEntry "PDF Viewer" cfg.pdfViewer; + defaultVideoPlayer = mkDefaultEntry "Video Player" cfg.videoPlayer; + defaultWebBrowser = mkDefaultEntry "Web Browser" cfg.webBrowser; + }; + }; + }; } diff --git a/homeManagerModules/desktop/hyprland/default.nix b/homeManagerModules/desktop/hyprland/default.nix index fa6ca80a..4a5b8026 100644 --- a/homeManagerModules/desktop/hyprland/default.nix +++ b/homeManagerModules/desktop/hyprland/default.nix @@ -102,8 +102,6 @@ region = "${bin} -m region -o ${folder}"; }; - gdk_scale = "1.5"; - clamshell = pkgs.writeShellScript "hyprland-clamshell" '' NUM_MONITORS=$(${hyprctl} monitors all | grep Monitor | wc --lines) if [ "$1" == "on" ]; then @@ -194,9 +192,6 @@ force_zero_scaling = true } - # toolkit-specific scale - env = GDK_SCALE,${gdk_scale} - # Some default env vars. env = XCURSOR_SIZE,${toString config.home.pointerCursor.size} env = QT_QPA_PLATFORMTHEME,qt6ct diff --git a/hosts/fallarbor/default.nix b/hosts/fallarbor/default.nix index 8e8b9f2d..6f41a88b 100644 --- a/hosts/fallarbor/default.nix +++ b/hosts/fallarbor/default.nix @@ -18,6 +18,7 @@ systemd-boot.enable = true; }; + environment.variables.GDK_SCALE = "1.5"; networking.hostName = "fallarbor"; system.stateVersion = "24.05"; diff --git a/hosts/lavaridge/default.nix b/hosts/lavaridge/default.nix index ad01336f..adb15265 100644 --- a/hosts/lavaridge/default.nix +++ b/hosts/lavaridge/default.nix @@ -19,8 +19,8 @@ systemd-boot.enable = true; }; + environment.variables.GDK_SCALE = "1.5"; networking.hostName = "lavaridge"; - system.stateVersion = "24.05"; ar = { diff --git a/hosts/mandarin/default.nix b/hosts/mandarin/default.nix index 504c03dc..42ddac12 100644 --- a/hosts/mandarin/default.nix +++ b/hosts/mandarin/default.nix @@ -26,6 +26,7 @@ }; }; + environment.variables.GDK_SCALE = "1.25"; hardware.enableAllFirmware = true; networking.hostName = "mandarin"; diff --git a/hosts/mauville/default.nix b/hosts/mauville/default.nix index 2717201a..f7d5478c 100644 --- a/hosts/mauville/default.nix +++ b/hosts/mauville/default.nix @@ -91,8 +91,8 @@ in { }; }; + environment.variables.GDK_SCALE = "1.25"; system.stateVersion = "23.11"; - zramSwap.memoryPercent = 100; ar = { diff --git a/hosts/petalburg/default.nix b/hosts/petalburg/default.nix index 86c6cf79..2badce09 100644 --- a/hosts/petalburg/default.nix +++ b/hosts/petalburg/default.nix @@ -18,8 +18,8 @@ systemd-boot.enable = true; }; + environment.variables.GDK_SCALE = "2"; networking.hostName = "petalburg"; - system.stateVersion = "24.05"; ar = { diff --git a/hosts/rustboro/default.nix b/hosts/rustboro/default.nix index 944915cd..c2def153 100644 --- a/hosts/rustboro/default.nix +++ b/hosts/rustboro/default.nix @@ -19,6 +19,7 @@ systemd-boot.enable = true; }; + environment.variables.GDK_SCALE = "1.25"; networking.hostName = "rustboro"; system.stateVersion = "24.05"; zramSwap.memoryPercent = 100;