From 729d9f7cac078730056b1cb10ecc4f384cba2b94 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Wed, 1 Jan 2025 23:04:05 +0100 Subject: [PATCH] Add supersonic --- home/themes/oxiced.nix | 1 - modules/programs/default.nix | 1 + modules/programs/supersonic.nix | 72 +++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 modules/programs/supersonic.nix diff --git a/home/themes/oxiced.nix b/home/themes/oxiced.nix index fbb79de..4440b22 100644 --- a/home/themes/oxiced.nix +++ b/home/themes/oxiced.nix @@ -5,7 +5,6 @@ ... }: let - username = config.conf.username; # at time of using this here, stylix might not be evaluated yet # hence ensure it is by using base16 mkSchemeAttrs base16 = pkgs.callPackage inputs.base16.lib { }; diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 294f2f1..8bcb775 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -35,6 +35,7 @@ ./sops.nix ./starship.nix ./stylix.nix + ./supersonic.nix ./teams.nix ./virtmanager.nix ./xkb.nix diff --git a/modules/programs/supersonic.nix b/modules/programs/supersonic.nix new file mode 100644 index 0000000..b4074bf --- /dev/null +++ b/modules/programs/supersonic.nix @@ -0,0 +1,72 @@ +{ + lib, + config, + options, + pkgs, + inputs, + ... +}: +let + base16 = pkgs.callPackage inputs.base16.lib { }; + scheme = base16.mkSchemeAttrs config.stylix.base16Scheme; +in +{ + options.mods.supersonic = { + enable = lib.mkOption { + default = false; + example = true; + type = lib.types.bool; + description = "Enables and configures supersonic"; + }; + variant = lib.mkOption { + default = "wayland"; + example = "x11"; + type = lib.types.enum [ + "wayland" + "x11" + ]; + description = "The variant of supersonic"; + }; + }; + config = lib.mkIf config.mods.supersonic.enable ( + lib.optionalAttrs (options ? home.packages) { + home.packages = with pkgs; [ + (if config.mods.supersonic.variant == "wayland" then supersonic-wayland else supersonic) + ]; + xdg.configFile."supersonic/themes/custom.toml".source = + (pkgs.formats.toml { }).generate "customTheme" + { + SupersonicTheme = { + Name = "Custom"; + Version = "0.2"; + SupportsDark = true; + SupportsLight = true; + }; + + DarkColors = { + PageBackground = "#${scheme.base00}"; + ListHeader = "#${scheme.base02}"; + PageHeader = "#${scheme.base02}"; + Background = "#${scheme.base01}"; + ScrollBar = "#${scheme.base02}"; + Button = "#${scheme.base02}"; + Foreground = "#${scheme.base04}"; + InputBackground = "#${scheme.base02}"; + }; + + # just define the same as base 16 doesn't define if it is light or not + LightColors = { + PageBackground = "#${scheme.base00}"; + ListHeader = "#${scheme.base02}"; + PageHeader = "#${scheme.base02}"; + Background = "#${scheme.base01}"; + ScrollBar = "#${scheme.base02}"; + Button = "#${scheme.base02}"; + Foreground = "#${scheme.base04}"; + InputBackground = "#${scheme.base02}"; + }; + }; + } + + ); +}