From 708556372c058bdcf66aa8fdf65ee1e18b4e3bc0 Mon Sep 17 00:00:00 2001 From: = Date: Thu, 9 Jan 2025 17:44:49 -0600 Subject: [PATCH 1/8] nixcord: init module --- modules/nixcord/hm.nix | 18 ++++++++++ modules/nixcord/template.mustache | 58 +++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 modules/nixcord/hm.nix create mode 100644 modules/nixcord/template.mustache diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix new file mode 100644 index 000000000..f9b678dab --- /dev/null +++ b/modules/nixcord/hm.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: +let + themeFile = config.lib.stylix.colors { + template = ../vesktop/template.mustache; # Uses the same template as vesktop + extension = ".css"; + }; +in +{ + options.stylix.targets.nixcord.enable = + config.lib.stylix.mkEnableTarget "Nixcord" true; + + config = + lib.mkIf (config.stylix.enable && config.stylix.targets.nixcord.enable) + { + xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; + programs.nixcord.config.enabledThemes = [ "stylix.theme.css" ]; + }; +} diff --git a/modules/nixcord/template.mustache b/modules/nixcord/template.mustache new file mode 100644 index 000000000..2a068cf13 --- /dev/null +++ b/modules/nixcord/template.mustache @@ -0,0 +1,58 @@ +/** +* @name Stylix +* @author Stylix +* @version 0.0.0 +* @description Theme configured via NixOS or Home Manager. +**/ + +:root { + --base00: #{{base00-hex}}; /* Black */ + --base01: #{{base01-hex}}; /* Bright Black */ + --base02: #{{base02-hex}}; /* Grey */ + --base03: #{{base03-hex}}; /* Brighter Grey */ + --base04: #{{base04-hex}}; /* Bright Grey */ + --base05: #{{base05-hex}}; /* White */ + --base06: #{{base06-hex}}; /* Brighter White */ + --base07: #{{base07-hex}}; /* Bright White */ + --base08: #{{base08-hex}}; /* Red */ + --base09: #{{base09-hex}}; /* Orange */ + --base0A: #{{base0A-hex}}; /* Yellow */ + --base0B: #{{base0B-hex}}; /* Green */ + --base0C: #{{base0C-hex}}; /* Cyan */ + --base0D: #{{base0D-hex}}; /* Blue */ + --base0E: #{{base0E-hex}}; /* Purple */ + --base0F: #{{base0F-hex}}; /* Magenta */ + + --primary-630: var(--base00); /* Autocomplete background */ + --primary-660: var(--base00); /* Search input background */ +} + +.theme-light, .theme-dark { + --search-popout-option-fade: none; /* Disable fade for search popout */ + --bg-overlay-2: var(--base00); /* These 2 are needed for proper threads coloring */ + --home-background: var(--base00); + --bg-overlay-chat : var(--base00); /* Recolor forum channels */ + --background-primary: var(--base00); + --background-secondary: var(--base01); + --background-secondary-alt: var(--base01); + --channeltextarea-background: var(--base01); + --background-tertiary: var(--base00); + --background-accent: var(--base0E); + --background-floating: var(--base01); + --background-modifier-hover: #{{base00-hex}}4c; /* 30% of base00 */ + --background-modifier-selected: var(--base00); + --text-normal: var(--base05); + --text-secondary: var(--base03); + --text-muted: var(--base04); + --text-link: var(--base0C); + --interactive-normal: var(--base05); + --interactive-hover: var(--base05); + --interactive-active: var(--base07); + --interactive-muted: var(--base03); + --channels-default: var(--base04); + --channel-icon: var(--base04); + --header-primary: var(--base06); + --header-secondary: var(--base04); + --scrollbar-thin-track: transparent; + --scrollbar-auto-track: transparent; +} From 401af2f1dafea3a27957dcf4346691347932c7fd Mon Sep 17 00:00:00 2001 From: = Date: Thu, 9 Jan 2025 17:48:59 -0600 Subject: [PATCH 2/8] removed unused template --- modules/nixcord/template.mustache | 58 ------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 modules/nixcord/template.mustache diff --git a/modules/nixcord/template.mustache b/modules/nixcord/template.mustache deleted file mode 100644 index 2a068cf13..000000000 --- a/modules/nixcord/template.mustache +++ /dev/null @@ -1,58 +0,0 @@ -/** -* @name Stylix -* @author Stylix -* @version 0.0.0 -* @description Theme configured via NixOS or Home Manager. -**/ - -:root { - --base00: #{{base00-hex}}; /* Black */ - --base01: #{{base01-hex}}; /* Bright Black */ - --base02: #{{base02-hex}}; /* Grey */ - --base03: #{{base03-hex}}; /* Brighter Grey */ - --base04: #{{base04-hex}}; /* Bright Grey */ - --base05: #{{base05-hex}}; /* White */ - --base06: #{{base06-hex}}; /* Brighter White */ - --base07: #{{base07-hex}}; /* Bright White */ - --base08: #{{base08-hex}}; /* Red */ - --base09: #{{base09-hex}}; /* Orange */ - --base0A: #{{base0A-hex}}; /* Yellow */ - --base0B: #{{base0B-hex}}; /* Green */ - --base0C: #{{base0C-hex}}; /* Cyan */ - --base0D: #{{base0D-hex}}; /* Blue */ - --base0E: #{{base0E-hex}}; /* Purple */ - --base0F: #{{base0F-hex}}; /* Magenta */ - - --primary-630: var(--base00); /* Autocomplete background */ - --primary-660: var(--base00); /* Search input background */ -} - -.theme-light, .theme-dark { - --search-popout-option-fade: none; /* Disable fade for search popout */ - --bg-overlay-2: var(--base00); /* These 2 are needed for proper threads coloring */ - --home-background: var(--base00); - --bg-overlay-chat : var(--base00); /* Recolor forum channels */ - --background-primary: var(--base00); - --background-secondary: var(--base01); - --background-secondary-alt: var(--base01); - --channeltextarea-background: var(--base01); - --background-tertiary: var(--base00); - --background-accent: var(--base0E); - --background-floating: var(--base01); - --background-modifier-hover: #{{base00-hex}}4c; /* 30% of base00 */ - --background-modifier-selected: var(--base00); - --text-normal: var(--base05); - --text-secondary: var(--base03); - --text-muted: var(--base04); - --text-link: var(--base0C); - --interactive-normal: var(--base05); - --interactive-hover: var(--base05); - --interactive-active: var(--base07); - --interactive-muted: var(--base03); - --channels-default: var(--base04); - --channel-icon: var(--base04); - --header-primary: var(--base06); - --header-secondary: var(--base04); - --scrollbar-thin-track: transparent; - --scrollbar-auto-track: transparent; -} From a611658fb732387533f5183cf79f8b84c5b4e91a Mon Sep 17 00:00:00 2001 From: Ari <54780610+ari-rs@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:48:57 -0600 Subject: [PATCH 3/8] remoted redundant comment Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/nixcord/hm.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix index f9b678dab..5ebe96b14 100644 --- a/modules/nixcord/hm.nix +++ b/modules/nixcord/hm.nix @@ -1,7 +1,7 @@ { config, lib, ... }: let themeFile = config.lib.stylix.colors { - template = ../vesktop/template.mustache; # Uses the same template as vesktop + template = ../vesktop/template.mustache; extension = ".css"; }; in From e892bb0b5620ed0c2fac23545efd24711e73c223 Mon Sep 17 00:00:00 2001 From: = Date: Fri, 10 Jan 2025 18:59:05 -0600 Subject: [PATCH 4/8] add nixcord to inputs --- flake.lock | 104 ++++++++++++++++++++++++++++++++++++++++- flake.nix | 1 + modules/nixcord/hm.nix | 3 +- stylix/hm/default.nix | 1 + 4 files changed, 106 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 10aa2fac8..31f62e90e 100644 --- a/flake.lock +++ b/flake.lock @@ -98,6 +98,20 @@ "type": "github" } }, + "flake-compat_2": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, "flake-utils": { "inputs": { "systems": [ @@ -220,7 +234,60 @@ "type": "github" } }, + "nixcord": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": "nixpkgs", + "systems": "systems", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1736490502, + "narHash": "sha256-EXW9eZdh/QN3MmkffCuLI24lLq1TBviNsm7JN9wAuQg=", + "owner": "kaylorben", + "repo": "nixcord", + "rev": "1a8fb00c2b05e29992ea0cee41890cb4491fe923", + "type": "github" + }, + "original": { + "owner": "kaylorben", + "repo": "nixcord", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1731816655, + "narHash": "sha256-55e1JMAuYvHZs9EICprWgJ4RmaWwDuSjzJ5K7S7zb6w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0a14706530dcb90acecb81ce0da219d88baaae75", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1726871744, + "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1735648875, "narHash": "sha256-fQ4k/hyQiH9RRPznztsA9kbcDajvwV1sRm01el6Sr3c=", @@ -248,8 +315,9 @@ "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager", - "nixpkgs": "nixpkgs", - "systems": "systems", + "nixcord": "nixcord", + "nixpkgs": "nixpkgs_3", + "systems": "systems_2", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-tmux": "tinted-tmux", @@ -257,6 +325,20 @@ } }, "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -336,6 +418,24 @@ "repo": "base16-zed", "type": "github" } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1730321837, + "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 4463dad91..c24d78ebe 100644 --- a/flake.nix +++ b/flake.nix @@ -51,6 +51,7 @@ inputs.nixpkgs.follows = "nixpkgs"; url = "github:nix-community/home-manager"; }; + nixcord.url = "github:kaylorben/nixcord"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix index 5ebe96b14..88cee855d 100644 --- a/modules/nixcord/hm.nix +++ b/modules/nixcord/hm.nix @@ -4,6 +4,7 @@ let template = ../vesktop/template.mustache; extension = ".css"; }; + themeFileName = "stylix.theme.css"; in { options.stylix.targets.nixcord.enable = @@ -13,6 +14,6 @@ in lib.mkIf (config.stylix.enable && config.stylix.targets.nixcord.enable) { xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; - programs.nixcord.config.enabledThemes = [ "stylix.theme.css" ]; + programs.nixcord.config.enabledThemes = [ themeFileName ]; }; } diff --git a/stylix/hm/default.nix b/stylix/hm/default.nix index d160a0327..eebf91d78 100644 --- a/stylix/hm/default.nix +++ b/stylix/hm/default.nix @@ -13,6 +13,7 @@ in ./cursor.nix ./fonts.nix ./icon.nix + inputs.nixcord.homeManagerModules.nixcord (import ./palette.nix { inherit palette-generator base16; }) (import ../templates.nix inputs) ] ++ autoload; From a4f43cf6ec61365ba862ae64d4d57a1be9fd692b Mon Sep 17 00:00:00 2001 From: = Date: Mon, 13 Jan 2025 18:31:56 -0600 Subject: [PATCH 5/8] nixcord no longer installs & fix template rename --- flake.lock | 105 ++--------------------------------------- flake.nix | 1 - modules/nixcord/hm.nix | 5 +- stylix/hm/default.nix | 1 - 4 files changed, 6 insertions(+), 106 deletions(-) diff --git a/flake.lock b/flake.lock index 31f62e90e..8d7f3a07f 100644 --- a/flake.lock +++ b/flake.lock @@ -98,20 +98,6 @@ "type": "github" } }, - "flake-compat_2": { - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "revCount": 57, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" - } - }, "flake-utils": { "inputs": { "systems": [ @@ -234,60 +220,7 @@ "type": "github" } }, - "nixcord": { - "inputs": { - "flake-compat": "flake-compat_2", - "nixpkgs": "nixpkgs", - "systems": "systems", - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1736490502, - "narHash": "sha256-EXW9eZdh/QN3MmkffCuLI24lLq1TBviNsm7JN9wAuQg=", - "owner": "kaylorben", - "repo": "nixcord", - "rev": "1a8fb00c2b05e29992ea0cee41890cb4491fe923", - "type": "github" - }, - "original": { - "owner": "kaylorben", - "repo": "nixcord", - "type": "github" - } - }, "nixpkgs": { - "locked": { - "lastModified": 1731816655, - "narHash": "sha256-55e1JMAuYvHZs9EICprWgJ4RmaWwDuSjzJ5K7S7zb6w=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0a14706530dcb90acecb81ce0da219d88baaae75", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1726871744, - "narHash": "sha256-V5LpfdHyQkUF7RfOaDPrZDP+oqz88lTJrMT1+stXNwo=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "a1d92660c6b3b7c26fb883500a80ea9d33321be2", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1735648875, "narHash": "sha256-fQ4k/hyQiH9RRPznztsA9kbcDajvwV1sRm01el6Sr3c=", @@ -315,9 +248,8 @@ "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager", - "nixcord": "nixcord", - "nixpkgs": "nixpkgs_3", - "systems": "systems_2", + "nixpkgs": "nixpkgs", + "systems": "systems", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-tmux": "tinted-tmux", @@ -325,20 +257,6 @@ } }, "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "id": "systems", - "type": "indirect" - } - }, - "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -418,26 +336,9 @@ "repo": "base16-zed", "type": "github" } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1730321837, - "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } } }, "root": "root", "version": 7 } + diff --git a/flake.nix b/flake.nix index c24d78ebe..4463dad91 100644 --- a/flake.nix +++ b/flake.nix @@ -51,7 +51,6 @@ inputs.nixpkgs.follows = "nixpkgs"; url = "github:nix-community/home-manager"; }; - nixcord.url = "github:kaylorben/nixcord"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix index 88cee855d..7d041a122 100644 --- a/modules/nixcord/hm.nix +++ b/modules/nixcord/hm.nix @@ -1,17 +1,18 @@ { config, lib, ... }: let themeFile = config.lib.stylix.colors { - template = ../vesktop/template.mustache; + template = ../vencord/template.mustache; extension = ".css"; }; themeFileName = "stylix.theme.css"; + cfg = config.stylix.targets.nixcord; in { options.stylix.targets.nixcord.enable = config.lib.stylix.mkEnableTarget "Nixcord" true; config = - lib.mkIf (config.stylix.enable && config.stylix.targets.nixcord.enable) + lib.mkIf (config.stylix.enable && cfg.enable && (config.programs ? nixcord)) { xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; programs.nixcord.config.enabledThemes = [ themeFileName ]; diff --git a/stylix/hm/default.nix b/stylix/hm/default.nix index eebf91d78..d160a0327 100644 --- a/stylix/hm/default.nix +++ b/stylix/hm/default.nix @@ -13,7 +13,6 @@ in ./cursor.nix ./fonts.nix ./icon.nix - inputs.nixcord.homeManagerModules.nixcord (import ./palette.nix { inherit palette-generator base16; }) (import ../templates.nix inputs) ] ++ autoload; From 3ea942a67f53a5759bbfc04612f8675bd708d757 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 14 Jan 2025 21:54:38 -0600 Subject: [PATCH 6/8] use optionalAttrs to fix build --- modules/nixcord/hm.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix index 7d041a122..6ddb631a2 100644 --- a/modules/nixcord/hm.nix +++ b/modules/nixcord/hm.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, lib, options, ... }: let themeFile = config.lib.stylix.colors { template = ../vencord/template.mustache; @@ -13,8 +13,12 @@ in config = lib.mkIf (config.stylix.enable && cfg.enable && (config.programs ? nixcord)) - { - xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; - programs.nixcord.config.enabledThemes = [ themeFileName ]; - }; + ( + lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) ( + { + xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; + programs.nixcord.config.enabledThemes = [ themeFileName ]; + } + ) + ); } From 8402051a56a4f8bcaabc6a863bfc697c3c2b6caf Mon Sep 17 00:00:00 2001 From: Ari <54780610+ari-rs@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:49:06 -0600 Subject: [PATCH 7/8] Nit: random new line added has been removed --- flake.lock | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 6e6be1848..595b3a97d 100644 --- a/flake.lock +++ b/flake.lock @@ -336,5 +336,4 @@ }, "root": "root", "version": 7 -} - +} \ No newline at end of file From 466663a77a4521415aafcc5c00c2a2bcf370fc74 Mon Sep 17 00:00:00 2001 From: ari Date: Sat, 18 Jan 2025 10:41:40 -0600 Subject: [PATCH 8/8] NAHO patches --- flake.lock | 2 +- modules/nixcord/hm.nix | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 595b3a97d..47dd77e99 100644 --- a/flake.lock +++ b/flake.lock @@ -336,4 +336,4 @@ }, "root": "root", "version": 7 -} \ No newline at end of file +} diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix index 6ddb631a2..0a1ccb05c 100644 --- a/modules/nixcord/hm.nix +++ b/modules/nixcord/hm.nix @@ -1,4 +1,9 @@ -{ config, lib, options, ... }: +{ + config, + lib, + options, + ... +}: let themeFile = config.lib.stylix.colors { template = ../vencord/template.mustache; @@ -13,12 +18,10 @@ in config = lib.mkIf (config.stylix.enable && cfg.enable && (config.programs ? nixcord)) - ( - lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) ( - { + ( + lib.optionalAttrs (builtins.hasAttr "nixcord" options.programs) { xdg.configFile."Vencord/themes/stylix.theme.css".source = themeFile; programs.nixcord.config.enabledThemes = [ themeFileName ]; } - ) - ); + ); }