-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixcord: init module #767
base: master
Are you sure you want to change the base?
nixcord: init module #767
Conversation
This will resolve #684 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error: The option `virtualisation.vmVariant.home-manager.users.guest.programs.nixcord' does not exist. Definition values: - In `/nix/store/5ylf1lb92hkw0zq103cli5l86hd7lnnw-source/modules/nixcord/hm.nix':
I assume the Home Manager input needs to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Nixcord is not a regular part of Home Manager, the Stylix module should check whether the programs.nixcord
option exists, rather than installing Nixcord itself.
This avoids Nixcord being installed for all Stylix users, as some may not want it.
See the Nixvim module for an example:
stylix/modules/nixvim/nixvim.nix
Line 67 in 934e2bf
lib.mkIf (config.stylix.enable && cfg.enable && (config.programs ? nixvim)) |
The build failure is because the template was renamed in 934e2bf |
Not exactly sure what the build issue is but im lookin |
Oops, I should have made the example longer - the part which actually prevents this issue is just below the line I linked to: stylix/modules/nixvim/nixvim.nix Line 69 in 934e2bf
Basically, the definition needs to be wrapped in something which uses a hard
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ari-rs, since I am unable to push the following commits to your master branch, please apply them in order for the CI to pass:
-
From a02d66430bb24cc9e14fd3e351d2aac5cd39d3df Mon Sep 17 00:00:00 2001 From: NAHO <[email protected]> Date: Sat, 18 Jan 2025 13:27:56 +0100 Subject: [PATCH 1/2] nixcord: apply nixfmt-rfc-style --- modules/nixcord/hm.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix index 6ddb631..325d20e 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 ]; - } - ) - ); + }) + ); } --
-
From e1b92ee220b3ac336c3103c79f6476090ce75b0d Mon Sep 17 00:00:00 2001 From: NAHO <[email protected]> Date: Sat, 18 Jan 2025 13:28:24 +0100 Subject: [PATCH 2/2] nixcord: satisfy statix --- modules/nixcord/hm.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nixcord/hm.nix b/modules/nixcord/hm.nix index 325d20e..0a1ccb0 100644 --- a/modules/nixcord/hm.nix +++ b/modules/nixcord/hm.nix @@ -19,9 +19,9 @@ 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 ]; - }) + } ); } --
Nixcord is a way to do "Declarative Vencord plugins + options " for vesktop (vencord) https://github.com/KaylorBen/nixcord
This references the same template as vesktop