From aff6076875edcd4f711edf228d68929913500efc Mon Sep 17 00:00:00 2001 From: materus Date: Wed, 3 Apr 2024 11:08:02 +0200 Subject: [PATCH] os-config: use brave as default browser --- configurations/host/materusPC/tmp.nix | 4 ++-- configurations/profile/home/browser.nix | 2 +- configurations/profile/os/default.nix | 1 + configurations/profile/os/desktop/browser.nix | 24 +++++++++++++++++++ configurations/profile/os/desktop/default.nix | 6 +++++ configurations/profile/os/games/steam.nix | 1 - 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 configurations/profile/os/desktop/browser.nix create mode 100644 configurations/profile/os/desktop/default.nix diff --git a/configurations/host/materusPC/tmp.nix b/configurations/host/materusPC/tmp.nix index 74ac2cd..c44ec93 100644 --- a/configurations/host/materusPC/tmp.nix +++ b/configurations/host/materusPC/tmp.nix @@ -169,7 +169,7 @@ dconf.enable = true; }; - + materus.profile.browser.enable = true; @@ -279,7 +279,7 @@ binutils - config.materus.profile.packages.firefox + ]; diff --git a/configurations/profile/home/browser.nix b/configurations/profile/home/browser.nix index 7908a5e..b26534c 100644 --- a/configurations/profile/home/browser.nix +++ b/configurations/profile/home/browser.nix @@ -17,7 +17,7 @@ in (lib.mkIf cfg.firefox.enable config.materus.profile.packages.firefox) (lib.mkIf cfg.vivaldi.enable pkgs.vivaldi) (lib.mkIf cfg.brave.enable pkgs.brave) - ]; + ] ++ [ (lib.mkIf (osConfig != null && osConfig.materus.profile.browser.enable) osConfig.materus.profile.browser.package)]; } ]; diff --git a/configurations/profile/os/default.nix b/configurations/profile/os/default.nix index 30e0e52..323eea6 100644 --- a/configurations/profile/os/default.nix +++ b/configurations/profile/os/default.nix @@ -6,6 +6,7 @@ ./shell ./games + ./desktop ]; } diff --git a/configurations/profile/os/desktop/browser.nix b/configurations/profile/os/desktop/browser.nix new file mode 100644 index 0000000..cd1af1b --- /dev/null +++ b/configurations/profile/os/desktop/browser.nix @@ -0,0 +1,24 @@ +{ materusArg, config, pkgs, lib, ... }: +let + cfg = config.materus.profile.browser; +in +{ + options.materus.profile.browser.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus default browser config"; + options.materus.profile.browser.default = lib.mkOption { + type = lib.types.enum [ "firefox" "brave" "vivaldi" ]; + example = "vivaldi"; + default = "brave"; + }; + options.materus.profile.browser.package = materusArg.pkgs.lib.mkPrivateVar + (if (cfg.default == "firefox") then config.materus.profile.packages.firefox else + if (cfg.default == "vivaldi") then pkgs.vivaldi else + if (cfg.default == "brave") then pkgs.brave else { }); + config = lib.mkIf cfg.enable { + + environment.systemPackages = [ + config.materus.profile.browser.package + ]; + + }; + +} diff --git a/configurations/profile/os/desktop/default.nix b/configurations/profile/os/desktop/default.nix new file mode 100644 index 0000000..8f16833 --- /dev/null +++ b/configurations/profile/os/desktop/default.nix @@ -0,0 +1,6 @@ +{ + + imports = [ + ./browser.nix + ]; +} \ No newline at end of file diff --git a/configurations/profile/os/games/steam.nix b/configurations/profile/os/games/steam.nix index 4f1711a..a73b059 100644 --- a/configurations/profile/os/games/steam.nix +++ b/configurations/profile/os/games/steam.nix @@ -23,7 +23,6 @@ let steamPkg = pkgs.steam.override { extraPkgs = pkgs: [ - #config.materus.profile.packages.firefox #optHip #for blender pkgs.libdecor pkgs.obs-studio-plugins.obs-vkcapture