From f6bb56780dcaac12756dc47a752cda5c41c8aed7 Mon Sep 17 00:00:00 2001 From: Vitaliy Volynskiy Date: Thu, 19 Dec 2024 13:21:59 +0500 Subject: [PATCH] they weren't cross-platform. fixed --- modules/apps/chrome.nix | 18 +++++++++++------- modules/apps/firefox.nix | 18 +++++++++++------- modules/apps/messaging.nix | 28 +++++++++++++++------------- modules/apps/minecraft.nix | 13 ++++++++----- modules/apps/streaming.nix | 13 ++++++++----- modules/apps/vlc.nix | 14 ++++++++------ 6 files changed, 61 insertions(+), 43 deletions(-) diff --git a/modules/apps/chrome.nix b/modules/apps/chrome.nix index e8aa687..0121a94 100644 --- a/modules/apps/chrome.nix +++ b/modules/apps/chrome.nix @@ -1,10 +1,14 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, options, ... }: with lib; { - home-manager.users.vitalya.programs.chromium = mkIf (!pkgs.stdenv.isDarwin) { - enable = true; - package = pkgs.google-chrome; - }; - - homebrew.casks = mkIf pkgs.stdenv.isDarwin [ "google-chrome" ]; + config = mkMerge [ + (if (builtins.hasAttr "homebrew" options) then { + homebrew.casks = [ "google-chrome" ]; + } else { + home-manager.users.vitalya.programs.chromium = { + enable = true; + package = pkgs.google-chrome; + }; + }) + ]; } diff --git a/modules/apps/firefox.nix b/modules/apps/firefox.nix index 51a5ec4..fb26d1f 100644 --- a/modules/apps/firefox.nix +++ b/modules/apps/firefox.nix @@ -1,10 +1,14 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, options, ... }: with lib; { - home-manager.users.vitalya.programs.firefox = mkIf (!pkgs.stdenv.isDarwin) { - enable = true; - package = pkgs.firefox; - }; - - homebrew.casks = mkIf pkgs.stdenv.isDarwin [ "firefox" ]; + config = mkMerge [ + (if (builtins.hasAttr "homebrew" options) then { + homebrew.casks = [ "firefox" ]; + } else { + home-manager.users.vitalya.programs.firefox = { + enable = true; + package = pkgs.firefox; + }; + }) + ]; } diff --git a/modules/apps/messaging.nix b/modules/apps/messaging.nix index 67f553e..03b5bda 100644 --- a/modules/apps/messaging.nix +++ b/modules/apps/messaging.nix @@ -1,17 +1,19 @@ -{ pkgs, lib, ... }: - +{ pkgs, lib, options, ... }: with lib; { - home-manager.users.vitalya.home.packages = mkIf (!pkgs.stdenv.isDarwin) - (with pkgs; [ - (discord.override { - withOpenASAR = true; - }) - tdesktop - ]); - - homebrew.casks = mkIf pkgs.stdenv.isDarwin [ - "discord" - "telegram" + config = mkMerge [ + (if (builtins.hasAttr "homebrew" options) then { + homebrew.casks = [ + "discord" + "telegram" + ]; + } else { + home-manager.users.vitalya.home.packages = with pkgs; [ + (discord.override { + withOpenASAR = true; + }) + tdesktop + ]; + }) ]; } diff --git a/modules/apps/minecraft.nix b/modules/apps/minecraft.nix index 1d760b8..b203a6e 100644 --- a/modules/apps/minecraft.nix +++ b/modules/apps/minecraft.nix @@ -1,8 +1,11 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, options, ... }: with lib; { - home-manager.users.vitalya.home.packages = mkIf (!pkgs.stdenv.isDarwin) - (with pkgs; [ prismlauncher ]); - - homebrew.casks = mkIf pkgs.stdenv.isDarwin [ "prismlauncher" ]; + config = mkMerge [ + (if (builtins.hasAttr "homebrew" options) then { + homebrew.casks = [ "prismlauncher" ]; + } else { + home-manager.users.vitalya.home.packages = with pkgs; [ prismlauncher ]; + }) + ]; } diff --git a/modules/apps/streaming.nix b/modules/apps/streaming.nix index 9d4c53b..da2ca38 100644 --- a/modules/apps/streaming.nix +++ b/modules/apps/streaming.nix @@ -1,8 +1,11 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, options, ... }: with lib; { - home-manager.users.vitalya.home.packages = mkIf (!pkgs.stdenv.isDarwin) - (with pkgs; [ obs-studio ]); - - homebrew.casks = mkIf pkgs.stdenv.isDarwin [ "obs" ]; + config = mkMerge [ + (if (builtins.hasAttr "homebrew" options) then { + homebrew.casks = [ "obs" ]; + } else { + home-manager.users.vitalya.home.packages = with pkgs; [ obs-studio ]; + }) + ]; } diff --git a/modules/apps/vlc.nix b/modules/apps/vlc.nix index 24794c2..c64fa6b 100644 --- a/modules/apps/vlc.nix +++ b/modules/apps/vlc.nix @@ -1,9 +1,11 @@ -{ pkgs, lib, ... }: - +{ pkgs, lib, options, ... }: with lib; { - home-manager.users.vitalya.home.packages = mkIf (!pkgs.stdenv.isDarwin) - (with pkgs; [ vlc ]); - - homebrew.casks = mkIf pkgs.stdenv.isDarwin [ "vlc" ]; + config = mkMerge [ + (if (builtins.hasAttr "homebrew" options) then { + homebrew.casks = [ "vlc" ]; + } else { + home-manager.users.vitalya.home.packages = with pkgs; [ vlc ]; + }) + ]; }