All my system configs and packages in one repo
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

new(hm-plus): modules for discord & vesktop

+154 -125
+3 -1
hm-plus/modules/programs/default.nix
··· 1 - { 1 + _: { 2 2 imports = [ 3 3 ./1password.nix 4 + ./discord.nix 4 5 ./git.nix 6 + ./vesktop.nix 5 7 ]; 6 8 }
+66
hm-plus/modules/programs/discord.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: let 7 + inherit (lib) mkEnableOption mkPackageOption mkOption mkIf optionalAttrs types; 8 + cfg = config.programs.discord; 9 + format = pkgs.formats.json {}; 10 + in { 11 + options.programs.discord = { 12 + enable = mkEnableOption "Discord"; 13 + 14 + package = mkPackageOption pkgs "Discord" { 15 + default = ["discord"]; 16 + }; 17 + 18 + settings = mkOption { 19 + inherit (format) type; 20 + description = '' 21 + Configuration written to {file}`$XDG_CONFIG_HOME/discord/settings.json`. 22 + ''; 23 + default = {}; 24 + }; 25 + 26 + openAsar.enable = mkEnableOption "OpenASAR"; 27 + 28 + vencord = { 29 + enable = mkEnableOption "Vencord"; 30 + 31 + settings = mkOption { 32 + inherit (format) type; 33 + description = '' 34 + Configuration written to {file}`$XDG_CONFIG_HOME/Vencord/settings/settings.json`. 35 + ''; 36 + default = {}; 37 + }; 38 + 39 + css = mkOption { 40 + type = types.lines; 41 + description = '' 42 + Style sheet written to {file}`$XDG_CONFIG_HOME/Vencord/settings/quickCss.css`. 43 + ''; 44 + default = ""; 45 + }; 46 + }; 47 + }; 48 + 49 + config = mkIf cfg.enable { 50 + home.packages = [ 51 + (cfg.package.override { 52 + withOpenASAR = cfg.openAsar.enable; 53 + withVencord = cfg.vencord.enable; 54 + }) 55 + ]; 56 + 57 + xdg.configFile = 58 + { 59 + "discord/settings.json".source = format.generate "discord-settings.json" cfg.settings; 60 + } 61 + // optionalAttrs cfg.vencord.enable { 62 + "Vencord/settings/settings.json".source = format.generate "vencord-settings.json" cfg.vencord.settings; 63 + "Vencord/settings/quickCss.css".text = cfg.vencord.css; 64 + }; 65 + }; 66 + }
+63
hm-plus/modules/programs/vesktop.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: let 7 + inherit (lib) mkEnableOption mkPackageOption mkOption mkIf types; 8 + cfg = config.programs.vesktop; 9 + format = pkgs.formats.json {}; 10 + in { 11 + options.programs.vesktop = { 12 + enable = mkEnableOption "Vesktop"; 13 + 14 + package = mkPackageOption pkgs "Vesktop" { 15 + default = ["vesktop"]; 16 + }; 17 + 18 + settings = mkOption { 19 + inherit (format) type; 20 + description = '' 21 + Configuration written to {file}`$XDG_CONFIG_HOME/vesktop/settings.json`. 22 + ''; 23 + default = {}; 24 + }; 25 + 26 + vencord = { 27 + useSystemPackage = mkOption { 28 + type = types.bool; 29 + description = "Use the Vencord package in Nixpkgs, instead of allowing Vesktop to manage its own Vencord install"; 30 + default = true; 31 + }; 32 + 33 + settings = mkOption { 34 + inherit (format) type; 35 + description = '' 36 + Configuration of the bundled client mod, Vencord, written to {file}`$XDG_CONFIG_HOME/vesktop/settings/settings.json`. 37 + ''; 38 + default = {}; 39 + }; 40 + 41 + css = mkOption { 42 + type = types.lines; 43 + description = '' 44 + Style sheet of the bundled client mod, Vencord, written to {file}`$XDG_CONFIG_HOME/vesktop/settings/quickCss.css`. 45 + ''; 46 + default = ""; 47 + }; 48 + }; 49 + }; 50 + 51 + config = mkIf cfg.enable { 52 + home.packages = [ 53 + (cfg.package.override {withSystemVencord = cfg.vencord.useSystemPackage;}) 54 + ]; 55 + 56 + xdg.configFile = { 57 + "vesktop/settings.json".source = format.generate "vesktop-settings.json" cfg.settings; 58 + 59 + "vesktop/settings/settings.json".source = format.generate "vencord-settings.json" cfg.vencord.settings; 60 + "vesktop/settings/quickCss.css".text = cfg.vencord.css; 61 + }; 62 + }; 63 + }
+11 -9
roles/catppuccin/discord.nix
··· 7 7 }: let 8 8 inherit (lib) mkEnableOption mkIf; 9 9 inherit (config.roles.catppuccin) enable flavour accent; 10 - cfg = config.roles.discord.catppuccin; 11 - in { 12 - options.roles.discord.catppuccin.enable = mkEnableOption "Catppuccin theme" // {default = enable;}; 10 + cfg = config.hm.programs.discord.catppuccin; 13 11 14 - config = mkIf (cfg.enable) { 15 - # Reproducible 🔥🚀 tracking of latest theme version 16 - roles.discord.vencord.settings = { 17 - themeLinks = ["https://raw.githubusercontent.com/catppuccin/discord/${ctp-discord-compiled.rev}/dist/catppuccin-${flavour}-${accent}.theme.css"]; 12 + vencord.settings = { 13 + themeLinks = ["https://raw.githubusercontent.com/catppuccin/discord/${ctp-discord-compiled.rev}/dist/catppuccin-${flavour}-${accent}.theme.css"]; 18 14 19 - plugins.ShikiCodeblocks.theme = "https://raw.githubusercontent.com/catppuccin/vscode/${ctp-vscode-compiled.rev}/${flavour}.json"; 20 - }; 15 + plugins.ShikiCodeblocks.theme = "https://raw.githubusercontent.com/catppuccin/vscode/${ctp-vscode-compiled.rev}/${flavour}.json"; 21 16 }; 17 + in { 18 + # TODO: make these "catppuccin-plus" options 19 + #options.hm.programs.discord.catppuccin.enable = mkEnableOption "Catppuccin theme" // {default = enable;}; 20 + 21 + # Reproducible 🔥🚀 tracking of latest theme version 22 + hm.programs.discord = {inherit vencord;}; 23 + hm.programs.vesktop = {inherit vencord;}; 22 24 }
-77
roles/discord/default.nix
··· 1 - { 2 - config, 3 - lib, 4 - pkgs, 5 - ... 6 - }: let 7 - inherit (lib) mkEnableOption mkOption mkIf types; 8 - cfg = config.roles.discord; 9 - in { 10 - options.roles.discord = { 11 - enable = mkEnableOption "Discord"; 12 - 13 - package = mkOption { 14 - type = types.package; 15 - description = "The package to use for Discord. Defaults to Vesktop if it is enabled, or the official client if it is not."; 16 - 17 - default = 18 - if cfg.vesktop.enable 19 - then 20 - pkgs.vesktop.override { 21 - withSystemVencord = cfg.vesktop.useSystemVencord; 22 - } 23 - else 24 - pkgs.discord.override { 25 - withOpenASAR = cfg.openAsar.enable; 26 - withVencord = cfg.vencord.enable; 27 - }; 28 - }; 29 - 30 - openAsar.enable = mkEnableOption "OpenASAR"; 31 - 32 - vencord = { 33 - enable = 34 - mkEnableOption "Vencord" 35 - // { 36 - default = cfg.vesktop.enable; 37 - }; 38 - 39 - settings = mkOption { 40 - type = types.attrsOf types.anything; 41 - default = {}; 42 - }; 43 - css = mkOption { 44 - type = types.lines; 45 - default = ""; 46 - }; 47 - }; 48 - 49 - vesktop = { 50 - enable = mkEnableOption "Vesktop, an alternative Discord client"; 51 - useSystemVencord = 52 - mkEnableOption "the Vencord packaged in Nixpkgs, instead of allowing Vesktop to manage its own Vencord install" 53 - // { 54 - default = true; 55 - }; 56 - settings = mkOption { 57 - type = types.attrsOf types.anything; 58 - default = {}; 59 - }; 60 - }; 61 - }; 62 - 63 - config = mkIf cfg.enable { 64 - assertions = [ 65 - { 66 - assertion = cfg.vesktop.enable -> !cfg.openAsar.enable; 67 - message = "Vesktop is incompatible with OpenASAR"; 68 - } 69 - { 70 - assertion = cfg.vesktop.enable -> cfg.vencord.enable; 71 - message = "Vencord must be enabled when using Vesktop"; 72 - } 73 - ]; 74 - 75 - hm.home.packages = [cfg.package]; 76 - }; 77 - }
-26
roles/discord/nixos.nix
··· 1 - { 2 - config, 3 - lib, 4 - ... 5 - }: let 6 - inherit (lib) mkIf mkMerge; 7 - cfg = config.roles.discord; 8 - in { 9 - config = mkIf cfg.enable { 10 - hm.xdg.configFile = let 11 - vencordRoot = 12 - if cfg.vesktop.enable 13 - then "vesktop" 14 - else "Vencord"; 15 - in 16 - mkMerge [ 17 - (mkIf cfg.vencord.enable { 18 - "${vencordRoot}/settings/settings.json".text = builtins.toJSON cfg.vencord.settings; 19 - "${vencordRoot}/settings/quickCss.css".text = cfg.vencord.css; 20 - }) 21 - (mkIf cfg.vesktop.enable { 22 - "${vencordRoot}/settings.json".text = builtins.toJSON cfg.vesktop.settings; 23 - }) 24 - ]; 25 - }; 26 - }
+11 -12
users/leah/programs/discord/default.nix
··· 1 1 { 2 - roles.discord = { 2 + hm.programs.vesktop = { 3 3 enable = true; 4 4 5 - vesktop = { 6 - enable = true; 7 - useSystemVencord = false; 5 + settings = { 6 + minimizeToTray = "on"; 7 + discordBranch = "stable"; 8 + arRPC = "on"; 9 + splashColor = "rgb(235, 160, 172)"; # maroon 10 + splashBackground = "rgb(30, 30, 46)"; # mantle 11 + }; 8 12 9 - settings = { 10 - minimizeToTray = "on"; 11 - discordBranch = "stable"; 12 - arRPC = "on"; 13 - splashColor = "rgb(235, 160, 172)"; # maroon 14 - splashBackground = "rgb(30, 30, 46)"; # mantle 15 - }; 13 + vencord = { 14 + useSystemPackage = false; 15 + css = builtins.readFile ./vencord.css; 16 16 }; 17 17 18 - vencord.css = builtins.readFile ./vencord.css; 19 18 vencord.settings = { 20 19 notifyAboutUpdates = true; 21 20 autoUpdate = false;