From 4064bced4a69a2592e07fe07ed681f6cd191df87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Thu, 31 Oct 2024 18:05:31 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(discord):=20Using=20`nixcord`=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/customization.md | 41 ++++ docs/docs/features.md | 30 +++ docs/docs/getting-started.md | 51 +++++ docs/docs/index.md | 148 --------------- docs/docs/resources.md | 7 + docs/docs/tasks.md | 3 +- docs/mkdocs.yml | 7 +- flake.lock | 74 ++++++-- flake.nix | 3 + modules/home/messages/discord/custom.css | 217 ++++++++++++++++++++++ modules/home/messages/discord/default.nix | 42 ++++- 11 files changed, 455 insertions(+), 168 deletions(-) create mode 100644 docs/docs/customization.md create mode 100644 docs/docs/features.md create mode 100644 docs/docs/getting-started.md delete mode 100644 docs/docs/index.md create mode 100644 docs/docs/resources.md create mode 100644 modules/home/messages/discord/custom.css diff --git a/docs/docs/customization.md b/docs/docs/customization.md new file mode 100644 index 0000000..b62695e --- /dev/null +++ b/docs/docs/customization.md @@ -0,0 +1,41 @@ +# Customization + +My Nix configuration, based on the [SnowfallOrg lib](https://github.com/snowfallorg/lib) structure, provides a +flexible and organized approach to managing your Nix environment. Here's how it +works: + +- **Custom Library**: An optional custom library in the `lib/` directory + contains a Nix function called with `inputs`, `snowfall-inputs`, and `lib`. + The function should return an attribute set to merge with `lib`. + +- **Modular Directory Structure**: You can create any (nestable) directory + structure within `lib/`, `packages/`, `modules/`, `overlays/`, `systems/`, and + `homes/`. Each directory should contain a Nix function that returns an + attribute set to merge with the corresponding section. + +- **Package Overlays**: The `packages/` directory includes an optional set of + packages to export. Each package is instantiated with `callPackage`, and the + files should contain functions that take an attribute set of packages and the + required `lib` to return a derivation. + +- **Modules for Configuration**: In the `modules/` directory, you can define + NixOS modules for various platforms, such as `nixos`, `darwin`, and `home`. + This modular approach simplifies system configuration management. + +- **Custom Overlays**: The `overlays/` directory is for optional custom + overlays. Each overlay file should contain a function that takes three + arguments: an attribute set of your flake's inputs and a `channels` attribute + containing all available channels, the final set of `pkgs`, and the previous + set of `pkgs`. This allows you to customize package sets effectively. + +- **System Configurations**: The `systems/` directory organizes system + configurations based on architecture and format. You can create configurations + for different architectures and formats, such as `x86_64-linux`, + `aarch64-darwin`, and more. + +- **Home Configurations**: Similar to system configurations, the `homes/` + directory organizes home configurations based on architecture and format. This + is especially useful if you want to manage home environments with Nix. + +This structured approach to Nix configuration makes it easier to manage and +customize your Nix environment while maintaining flexibility and modularity. \ No newline at end of file diff --git a/docs/docs/features.md b/docs/docs/features.md new file mode 100644 index 0000000..d2a37b5 --- /dev/null +++ b/docs/docs/features.md @@ -0,0 +1,30 @@ +# Features + +Here's an overview of what my Nix configuration offers: + +- **External Dependency Integrations**: + - Access the Nix User Repository (NUR) for additional packages and + enhancements. + +- **macOS Support**: Seamlessly configure and manage Nix on macOS using the + power of [Nix-darwin](https://github.com/LnL7/nix-darwin), also leveraging homebrew for GUI applications. + +- **Home Manager**: Manage your dotfiles, home environment, and user-specific + configurations with [Home Manager](https://github.com/nix-community/home-manager). + +- **DevShell Support**: The flake provides a development shell (`devShell`) to + support maintaining this flake. You can use the devShell for convenient + development and maintenance of your Nix environment. + +- **CI with Cachix**: The configuration includes continuous integration (CI) + that pushes built artifacts to [Cachix](https://github.com/cachix/cachix). This ensures efficient builds and + reduces the need to build dependencies on your local machine. + +- **Utilize sops-nix**: Secret management with [sops-nix](https://github.com/Mic92/sops-nix) for secure and encrypted + handling of sensitive information. + +- **Theming with stylix**: Management of system and application colorscheme, + fonts and wallpaper with [stylix](https://stylix.danth.me). + +- **Declarative disk partitioning**: Use [disko](https://github.com/nix-community/disko) to declare your disk and format it + using the Nix language. \ No newline at end of file diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md new file mode 100644 index 0000000..69adfe3 --- /dev/null +++ b/docs/docs/getting-started.md @@ -0,0 +1,51 @@ +# Getting Started + +Before diving in, ensure that you have Nix installed on your system. If not, you +can download and install it from the official +[Nix website](https://nixos.org/download.html) or from the +[Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer). +If running on macOS, you need to have Nix-Darwin installed, as well. You can follow the +installation instruction on [GitHub](https://github.com/LnL7/nix-darwin?tab=readme-ov-file#flakes). + +### Clone this repository to your local machine + +```bash +git clone https://github.com/theobori/nixos-configuration.git +cd nixos-configuration + +# linux +sudo nixos-rebuild switch --flake . + + # macos +darwin-rebuild switch --flake . + + # with direnv +flake switch +``` + +### Deploy on a remote machine + +Feel free to use my minimal bootable disk image [x86_64-install-iso/minimal](/systems/x86_64-install-iso/minimal/default.nix). The aim is to load this bootable iso on a target machine to have a usable OpenSSH server to deploy our NixOS configuration. + +You can build it with the following command. + +```bash +nix build .#install-isoConfigurations.minimal +``` + +Once built, you'll find an iso file in the `iso` folder of the build result. Below, part of the result of the `tree result` command shows us that we have built an image for a `x86_64-linux` system. + +```bash +result/ +├── iso +│   └── nixos-24.11.20241028.bb50fc7-x86_64-linux.iso +... +``` + +Once loaded on the target machine, you can use a deployment tool such as [nixos-anywhere](https://numtide.com/projects/nixos-anywhere/) to deploy NixOS over SSH. + +Here's an example. + +```bash +nix run github:nix-community/nixos-anywhere -- --generate-hardware-config nixos-generate-config systems/x86_64-linux/vm/hardware-configuration.nix nixos@ --flake .# +``` \ No newline at end of file diff --git a/docs/docs/index.md b/docs/docs/index.md deleted file mode 100644 index ec1ecdf..0000000 --- a/docs/docs/index.md +++ /dev/null @@ -1,148 +0,0 @@ -# ❄️ My NixOS Configuration - -[![check](https://github.com/theobori/nixos-configuration/actions/workflows/check.yml/badge.svg)](https://github.com/theobori/nixos-configuration/actions/workflows/check.yml) [![pages](https://github.com/theobori/nixos-configuration/actions/workflows/pages.yml/badge.svg)](https://github.com/theobori/nixos-configuration/actions/workflows/pages.yml) - -[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org) - -This repository contains all the Nix declarations I use to build my systems. - -## Table of Contents - -1. [Getting Started](#getting-started) -2. [Features](#features) -3. [Customization](#customization) -4. [Resources](#resources) - -## Getting Started - -Before diving in, ensure that you have Nix installed on your system. If not, you -can download and install it from the official -[Nix website](https://nixos.org/download.html) or from the -[Determinate Systems installer](https://github.com/DeterminateSystems/nix-installer). -If running on macOS, you need to have Nix-Darwin installed, as well. You can follow the -installation instruction on [GitHub](https://github.com/LnL7/nix-darwin?tab=readme-ov-file#flakes). - -### Clone this repository to your local machine - -```bash -git clone https://github.com/theobori/nixos-configuration.git -cd nixos-configuration - -# linux -sudo nixos-rebuild switch --flake . - - # macos -darwin-rebuild switch --flake . - - # with direnv -flake switch -``` - -### Deploy on a remote machine - -Feel free to use my minimal bootable disk image [x86_64-install-iso/minimal](/systems/x86_64-install-iso/minimal/default.nix). The aim is to load this bootable iso on a target machine to have a usable OpenSSH server to deploy our NixOS configuration. - -You can build it with the following command. - -```bash -nix build .#install-isoConfigurations.minimal -``` - -Once built, you'll find an iso file in the `iso` folder of the build result. Below, part of the result of the `tree result` command shows us that we have built an image for a `x86_64-linux` system. - -```bash -result/ -├── iso -│   └── nixos-24.11.20241028.bb50fc7-x86_64-linux.iso -... -``` - -Once loaded on the target machine, you can use a deployment tool such as [nixos-anywhere](https://numtide.com/projects/nixos-anywhere/) to deploy NixOS over SSH. - -Here's an example. - -```bash -nix run github:nix-community/nixos-anywhere -- --generate-hardware-config nixos-generate-config systems/x86_64-linux/vm/hardware-configuration.nix nixos@ --flake .# -``` - -## Features - -Here's an overview of what my Nix configuration offers: - -- **External Dependency Integrations**: - - Access the Nix User Repository (NUR) for additional packages and - enhancements. - -- **macOS Support**: Seamlessly configure and manage Nix on macOS using the - power of [Nix-darwin](https://github.com/LnL7/nix-darwin), also leveraging homebrew for GUI applications. - -- **Home Manager**: Manage your dotfiles, home environment, and user-specific - configurations with [Home Manager](https://github.com/nix-community/home-manager). - -- **DevShell Support**: The flake provides a development shell (`devShell`) to - support maintaining this flake. You can use the devShell for convenient - development and maintenance of your Nix environment. - -- **CI with Cachix**: The configuration includes continuous integration (CI) - that pushes built artifacts to [Cachix](https://github.com/cachix/cachix). This ensures efficient builds and - reduces the need to build dependencies on your local machine. - -- **Utilize sops-nix**: Secret management with [sops-nix](https://github.com/Mic92/sops-nix) for secure and encrypted - handling of sensitive information. - -- **Theming with stylix**: Management of system and application colorscheme, - fonts and wallpaper with [stylix](https://stylix.danth.me). - -- **Declarative disk partitioning**: Use [disko](https://github.com/nix-community/disko) to declare your disk and format it - using the Nix language. - -## Customization - -My Nix configuration, based on the [SnowfallOrg lib](https://github.com/snowfallorg/lib) structure, provides a -flexible and organized approach to managing your Nix environment. Here's how it -works: - -- **Custom Library**: An optional custom library in the `lib/` directory - contains a Nix function called with `inputs`, `snowfall-inputs`, and `lib`. - The function should return an attribute set to merge with `lib`. - -- **Modular Directory Structure**: You can create any (nestable) directory - structure within `lib/`, `packages/`, `modules/`, `overlays/`, `systems/`, and - `homes/`. Each directory should contain a Nix function that returns an - attribute set to merge with the corresponding section. - -- **Package Overlays**: The `packages/` directory includes an optional set of - packages to export. Each package is instantiated with `callPackage`, and the - files should contain functions that take an attribute set of packages and the - required `lib` to return a derivation. - -- **Modules for Configuration**: In the `modules/` directory, you can define - NixOS modules for various platforms, such as `nixos`, `darwin`, and `home`. - This modular approach simplifies system configuration management. - -- **Custom Overlays**: The `overlays/` directory is for optional custom - overlays. Each overlay file should contain a function that takes three - arguments: an attribute set of your flake's inputs and a `channels` attribute - containing all available channels, the final set of `pkgs`, and the previous - set of `pkgs`. This allows you to customize package sets effectively. - -- **System Configurations**: The `systems/` directory organizes system - configurations based on architecture and format. You can create configurations - for different architectures and formats, such as `x86_64-linux`, - `aarch64-darwin`, and more. - -- **Home Configurations**: Similar to system configurations, the `homes/` - directory organizes home configurations based on architecture and format. This - is especially useful if you want to manage home environments with Nix. - -This structured approach to Nix configuration makes it easier to manage and -customize your Nix environment while maintaining flexibility and modularity. - -## Resources - -Other configurations from where I learned and copied: - -- [hmajid2301/nixicle](https://gitlab.com/hmajid2301/nixicle) -- [khaneliman/khanelinix](https://github.com/khaneliman/khanelinix) -- [JakeHamilton/config](https://github.com/jakehamilton/config) - diff --git a/docs/docs/resources.md b/docs/docs/resources.md new file mode 100644 index 0000000..b967ca0 --- /dev/null +++ b/docs/docs/resources.md @@ -0,0 +1,7 @@ +# Resources + +Other configurations from where I learned and copied: + +- [hmajid2301/nixicle](https://gitlab.com/hmajid2301/nixicle) +- [khaneliman/khanelinix](https://github.com/khaneliman/khanelinix) +- [JakeHamilton/config](https://github.com/jakehamilton/config) \ No newline at end of file diff --git a/docs/docs/tasks.md b/docs/docs/tasks.md index 81a7312..ad3bd2a 100644 --- a/docs/docs/tasks.md +++ b/docs/docs/tasks.md @@ -2,4 +2,5 @@ Here are a non-exhaustive list of tasks. -- Better email accounts management +- [x] Use [nixcord](https://github.com/KaylorBen/nixcord) to entirely manage Discord with Nix declarations +- [ ] Better email accounts management \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index f4db409..5355674 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: My NixOS Configuration +site_name: ❄️ My NixOS Configuration site_url: https://github.com/theobori/nixos-configuration repo_url: https://github.com/theobori/nixos-configuration repo_name: theobori/nixos-configuration @@ -6,7 +6,10 @@ edit_uri: edit/main/docs/docs site_author: Théo Bori nav: - - Home: index.md + - Getting Started: getting-started.md + - Features: features.md + - Customization: customization.md + - Resources: resources.md - Tasks: tasks.md plugins: diff --git a/flake.lock b/flake.lock index 5786dff..044dbcd 100644 --- a/flake.lock +++ b/flake.lock @@ -87,6 +87,20 @@ } }, "flake-compat": { + "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-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -102,7 +116,7 @@ "type": "github" } }, - "flake-compat_2": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1650374568, @@ -118,7 +132,7 @@ "type": "github" } }, - "flake-compat_3": { + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1673956053, @@ -422,10 +436,29 @@ "type": "github" } }, + "nixcord": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1730107956, + "narHash": "sha256-Ohwk5/RGhGjDXaD4v0Yc40J/79gHRcD92mKWY+6qHJU=", + "owner": "kaylorben", + "repo": "nixcord", + "rev": "5dcb476b924ad08ffd8521cca812052605cb5974", + "type": "github" + }, + "original": { + "owner": "kaylorben", + "repo": "nixcord", + "type": "github" + } + }, "nixgl": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1713543440, @@ -625,6 +658,22 @@ } }, "nixpkgs_3": { + "locked": { + "lastModified": 1730272153, + "narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { "locked": { "lastModified": 1660551188, "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", @@ -639,7 +688,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1730155734, "narHash": "sha256-bzxn8TTWmpL9Q42bN5Lb53CnrnQk4sydsx3p2O4fR7c=", @@ -654,7 +703,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1719082008, "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", @@ -670,7 +719,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_7": { "locked": { "lastModified": 1725194671, "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", @@ -728,9 +777,9 @@ }, "pre-commit-hooks-nix": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "gitignore": "gitignore", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nixpkgs-stable": "nixpkgs-stable" }, "locked": { @@ -753,11 +802,12 @@ "home-manager": "home-manager", "mkdocs-flake": "mkdocs-flake", "nix-index-database": "nix-index-database", + "nixcord": "nixcord", "nixgl": "nixgl", "nixos-anywhere": "nixos-anywhere", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nur": "nur", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "snowfall-lib": "snowfall-lib", @@ -767,7 +817,7 @@ }, "snowfall-lib": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-utils-plus": "flake-utils-plus", "nixpkgs": [ "nixpkgs" @@ -814,11 +864,11 @@ "base16-fish": "base16-fish", "base16-helix": "base16-helix", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_4", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_7", "systems": "systems_4", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", diff --git a/flake.nix b/flake.nix index b3fd9f9..0935aa3 100644 --- a/flake.nix +++ b/flake.nix @@ -50,6 +50,8 @@ pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; mkdocs-flake.url = "github:applicative-systems/mkdocs-flake"; + + nixcord.url = "github:kaylorben/nixcord"; }; outputs = @@ -83,6 +85,7 @@ nix-index-database.hmModules.nix-index stylix.homeManagerModules.stylix sops-nix.homeManagerModules.sops + nixcord.homeManagerModules.nixcord ]; systems = { diff --git a/modules/home/messages/discord/custom.css b/modules/home/messages/discord/custom.css new file mode 100644 index 0000000..8cb475c --- /dev/null +++ b/modules/home/messages/discord/custom.css @@ -0,0 +1,217 @@ +/** + * @name Dracula + * @author Dracula + * @authorId 971847378011308102 + * @version 1.0.0 + * @description Dark theme for BetterDiscord + * @source https://github.com/Dracula/BetterDiscord +**/ +:root { + --dracula-background: #282a36 !important; + --dracula-current-line: #44475a !important; + --dracula-selection: #44475a !important; + --dracula-foreground: #f8f8f2 !important; + --dracula-comment: #6272a4 !important; + --dracula-cyan: #8be9fd !important; + --dracula-green: #50fa7b !important; + --dracula-orange: #ffb86c !important; + --dracula-pink: #ff79c6 !important; + --dracula-purple: #bd93f9 !important; + --dracula-red: #ff5555 !important; + --dracula-yellow: #f1fa8c !important; + --dracula-line-highlight: #44475a75 !important; + --dracula-non-text: #ffffff1a !important; + --dracula-white: #ffffff !important; + --dracula-tab-drop-background: #44475a70 !important; + --dracula-background-lighter: #424450; + --dracula-background-alt: #343746 !important; + + --activity-card-background: var(--dracula-background) !important; + --background-accent: var(--dracula-current-line) !important; + --background-floating: var(--dracula-background) !important; + --background-mobile-primary: var(--dracula-background) !important; + --background-mobile-secondary: var(--dracula-background-lighter) !important; + --background-modifier-selected: var(--dracula-current-line) !important; + --background-primary: var(--dracula-background) !important; + --home-background: var(--dracula-background-alt) !important; + --background-secondary-alt: var(--dracula-background) !important; + --background-secondary: var(--dracula-background-lighter) !important; + --background-tertiary: var(--dracula-background-alt) !important; + --channeltextarea-background: var(--dracula-selection) !important; + --header-primary: var(--dracula-foreground) !important; + --interactive-muted: var(--dracula-comment) !important; + --interactive-normal: var(--dracula-foreground) !important; + --rs-dnd-color: var(--dracula-red) !important; + --rs-idle-color: var(--dracula-orange) !important; + --rs-invisible-color: var(--dracula-comment) !important; + --rs-offline-color: var(--dracula-selection) !important; + --rs-online-color: var(--dracula-green) !important; + --rs-streaming-color: var(--dracula-purple) !important; + --scrollbar-auto-scrollbar-color-thumb: var(--dracula-comment) !important; + --scrollbar-auto-scrollbar-color-track: var( + --dracula-background-alt + ) !important; + --scrollbar-auto-thumb: var(--dracula-comment) !important; + --scrollbar-auto-track: var(--dracula-background-alt) !important; + --scrollbar-thin-thumb: var(--dracula-comment) !important; + } + + .wrapper-1BJsBx.selected-bZ3Lue .childWrapper-anI2G9, + .wrapper-1BJsBx:hover .childWrapper-anI2G9 { + background-color: var(--dracula-comment) !important; + } + + .container-2cd8Mz { + background-color: var(--dracula-background) !important; + } + + .autocomplete-3NRXG8 { + background-color: var(--dracula-background) !important; + } + + .autocomplete-3jLKbj { + background-color: var(--dracula-background) !important; + } + + .selected-3H3-RC { + background-color: var(--dracula-selection) !important; + } + + .container-ZMc96U.themed-Hp1KC_ { + background-color: var(--dracula-background) !important; + } + + .contentWrapper-3vHNP2, + .container-3u7RcY, + .wrapper-1NNaWG, + .wrapper-1NNaWG, + .inspector-DFKXwB, + .wrapper-22rqw6, + .listWrapper-2nHLP8, + .categoryItem-1sHzUv, + .guildIcon-2SUGiq, + .header-11eigE { + background-color: var(--dracula-background) !important; + } + + .container-1SX9VC, + .container-2oNtJn { + background-color: var(--dracula-selection) !important; + } + + .header-1w9Q93 { + background-color: var(--dracula-background); + } + + .messagesPopout-eVzQcI { + background-color: var(--dracula-background-alt); + } + + .messageGroupWrapper-1jf_7C { + background-color: var(--dracula-background); + } + + .popout-3gby1q { + background-color: var(--dracula-background); + } + + .searchBarComponent-18D6hD { + background-color: var(--dracula-background-alt); + } + + .friendSelected-3cwmD7 { + background-color: var(--dracula-selection); + } + + .anchor-1MIwyf { + background-color: var(--dracula-background); + } + + .header-145e10, + .header-1w9Q93 { + background-color: var(--dracula-background); + } + + .active-1grPyy { + background-color: var(--dracula-background-alt); + } + + .messagesPopout-eVzQcI { + background-color: var(--dracula-background-alt); + } + + .channelHeader-DFRX8q { + background-color: var(--dracula-background-alt); + } + + .container-iA3Qrz { + background-color: var(--dracula-background-alt); + } + + .messageContainer-3VTXBC { + background-color: var(--dracula-background); + } + + .scroller-145h9c { + background-color: var(--dracula-background-alt); + } + + .messages-23can0 { + background-color: var(--dracula-background); + } + + .container-1A0qQO { + background-color: var(--dracula-background-alt); + } + + code { + color: var(--dracula-foreground) !important; + } + + span.hljs-built_in { + color: var(--dracula-purple) !important; + } + + span.hljs-keyword { + color: var(--dracula-pink) !important; + } + + span.hljs-title { + color: var(--dracula-cyan) !important; + } + + span.hljs-attr { + color: var(--dracula-foreground) !important; + } + + span.hljs-string { + color: var(--dracula-yellow) !important; + } + + span.hljs-number { + color: var(--dracula-purple) !important; + } + + span.hljs-symbol { + color: var(--dracula-orange) !important; + } + + span.hljs-meta { + color: var(--dracula-foreground) !important; + } + + span.hljs-meta-keyword { + color: var(--dracula-pink) !important; + } + + span.hljs-meta-string { + color: var(--dracula-orange) !important; + } + + /* Current channel */ + div[class*="modeSelected"] > div > a[data-list-item-id*="channels"]{ + background-color: var(--dracula-comment) !important; + } + div[class*="modeSelected"] > div > a[data-list-item-id*="channels"] svg, div:hover > a[data-list-item-id*="channels"] svg { + color: var(--dracula-white) !important; + } diff --git a/modules/home/messages/discord/default.nix b/modules/home/messages/discord/default.nix index 5261952..cfea0fb 100644 --- a/modules/home/messages/discord/default.nix +++ b/modules/home/messages/discord/default.nix @@ -1,20 +1,52 @@ { config, lib, - pkgs, namespace, ... }: let - inherit (lib) mkIf; - inherit (lib.${namespace}) mkBoolOpt; + inherit (lib) mkIf types; + inherit (lib.${namespace}) + mkBoolOpt + mkOpt + enabled + disabled + ; cfg = config.${namespace}.messages.discord; in { - options.${namespace}.messages.discord = { + options.${namespace}.messages.discord = with types; { enable = mkBoolOpt false "Whether or not to manage discord."; + config = mkOpt attrs { + useQuickCss = true; + plugins = { + betterFolders = enabled; + betterRoleContext = enabled; + crashHandler = enabled; + memberCount = enabled; + mentionAvatars = enabled; + messageLatency = enabled; + showHiddenThings = enabled; + showMeYourName = enabled; + webContextMenus = enabled; + webKeybinds = enabled; + webScreenShareFixes = enabled; + alwaysAnimate = enabled; + }; + } "Manage the nixcord configuration."; }; - config = mkIf cfg.enable { home.packages = with pkgs; [ goofcord ]; }; + config = mkIf cfg.enable { + stylix.targets.vesktop.enable = false; + + programs.nixcord = { + enable = true; + discord = disabled; + vesktop.enable = true; + quickCss = builtins.readFile ./custom.css; + + inherit (cfg) config; + }; + }; }