From 0eea8bcb0f9c3c7638e7ee64f98ed9b4ec716830 Mon Sep 17 00:00:00 2001 From: bricked Date: Sun, 29 Sep 2024 18:36:58 +0000 Subject: [PATCH] spicetify: init (#574) Creates a theme for Spotify, when used in combination with https://github.com/Gerg-L/spicetify-nix --- modules/spicetify/hm.nix | 1 + modules/spicetify/nixos.nix | 1 + modules/spicetify/spicetify.nix | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 modules/spicetify/hm.nix create mode 100644 modules/spicetify/nixos.nix create mode 100644 modules/spicetify/spicetify.nix diff --git a/modules/spicetify/hm.nix b/modules/spicetify/hm.nix new file mode 100644 index 000000000..0b3c9d456 --- /dev/null +++ b/modules/spicetify/hm.nix @@ -0,0 +1 @@ +import ./spicetify.nix diff --git a/modules/spicetify/nixos.nix b/modules/spicetify/nixos.nix new file mode 100644 index 000000000..0b3c9d456 --- /dev/null +++ b/modules/spicetify/nixos.nix @@ -0,0 +1 @@ +import ./spicetify.nix diff --git a/modules/spicetify/spicetify.nix b/modules/spicetify/spicetify.nix new file mode 100644 index 000000000..aa0110dbc --- /dev/null +++ b/modules/spicetify/spicetify.nix @@ -0,0 +1,43 @@ +{ config, options, lib, pkgs, ... }: + +{ + options.stylix.targets.spicetify.enable = + config.lib.stylix.mkEnableTarget "Spicetify" true; + + config = lib.mkIf (config.stylix.enable && config.stylix.targets.spicetify.enable && (config.programs?spicetify)) ( + lib.optionalAttrs (builtins.hasAttr "spicetify" options.programs) { + programs.spicetify = { + theme = { + name = "stylix"; + src = pkgs.writeTextFile { + name = "color.ini"; + destination = "/color.ini"; + text = with config.lib.stylix.colors; '' + [base] + text = ${base05} + subtext = ${base05} + main = ${base00} + main-elevated = ${base02} + highlight = ${base02} + highlight-elevated = ${base03} + sidebar = ${base01} + player = ${base05} + card = ${base04} + shadow = ${base00} + selected-row = ${base05} + button = ${base05} + button-active = ${base05} + button-disabled = ${base04} + tab-active = ${base02} + notification = ${base02} + notification-error = ${base08} + equalizer = ${base0B} + misc = ${base02} + ''; + }; + }; + colorScheme = "base"; + }; + } + ); +}