### Example: Set Monitor for Hyprpaper Wallpaper Source: https://nix-community.github.io/stylix/print.html An example showing how to specify a monitor (e.g., 'DP-1') to apply the wallpaper to in Hyprpaper. An empty string matches all monitors. ```nix __"DP-1" ``` -------------------------------- ### Set Wallpaper from URL Source: https://nix-community.github.io/stylix/print.html You can also set a wallpaper by providing a URL to an image. This example fetches an image using `pkgs.fetchurl` and specifies a SHA256 hash for integrity. ```nix { pkgs, ... }: { stylix.image = pkgs.fetchurl { url = "https://getwallpapers.com/wallpaper/full/1/4/3/523784.jpg"; hash = "sha256-S/6kgloXiIYI0NblT6YVXfqELApbdHGsuYe6S4JoQwQ="; }; } ``` -------------------------------- ### Start a Stylix Testbed Source: https://nix-community.github.io/stylix/print.html Use this command to launch a specific testbed. Replace «module» and «testcase» with the desired values from the testbed list. ```bash __ user@host:~$ nix run .#testbed:«module»:«testcase» ``` -------------------------------- ### Enable i3bar-river Color Theming Source: https://nix-community.github.io/stylix/print.html Example of enabling `config.lib.stylix.colors` for i3bar-river. ```nix true ``` -------------------------------- ### Build and Serve Documentation Locally Source: https://nix-community.github.io/stylix/development_environment.html Run this command to build the project's documentation, start a local web server, and open the documentation in your browser. This allows you to preview changes before publishing. ```bash nix run .#doc ``` -------------------------------- ### Run a Stylix Testbed Source: https://nix-community.github.io/stylix/testbeds.html Execute this command to start a specific testbed. Replace `«module»` and `«testcase»` with the actual module and test case names. ```bash user@host:~$ nix run .#testbed:«module»:«testcase» ``` -------------------------------- ### Import Stylix Home Manager Module without Flakes Source: https://nix-community.github.io/stylix/print.html This example demonstrates how to import the Stylix Home Manager module using `fetchFromGitHub` when not using flakes. It sets up Stylix with a local wallpaper. ```nix { pkgs, ... }: let stylix = pkgs.fetchFromGitHub { owner = "nix-community"; repo = "stylix"; rev = "..."; sha256 = "..."; }; in { imports = [ (import stylix).homeModules.stylix ]; stylix = { enable = true; image = ./wallpaper.jpg; }; } ``` -------------------------------- ### Module General Documentation Source: https://nix-community.github.io/stylix/modules.html Add a general description to a module's meta.nix file to provide context about its functionality, installation requirements, supported theming items, and any caveats. ```nix description = '' Consider describing which applications are themed by this module (if it's not obvious from the module name), how the applications need to be installed for the module to work correctly, which theming items are supported (colors, fonts, wallpaper, ...), and any caveats the user should be aware of. ''; ``` -------------------------------- ### Home Manager Module without Flakes Source: https://nix-community.github.io/stylix/installation.html This example demonstrates how to use the Stylix Home Manager module when not using flakes. It fetches Stylix from GitHub and imports its home module. ```nix { pkgs, ... }: let stylix = pkgs.fetchFromGitHub { owner = "nix-community"; repo = "stylix"; rev = "..."; sha256 = "..."; }; in { imports = [ (import stylix).homeModules.stylix ]; stylix = { enable = true; image = ./wallpaper.jpg; }; } ``` -------------------------------- ### Install Stylix on NixOS with Flakes Source: https://nix-community.github.io/stylix/installation.html Integrate Stylix into your NixOS configuration to theme system-level programs. This example uses the unstable branch of nixpkgs and the latest Stylix. ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { nixpkgs, stylix, ... }: { nixosConfigurations."«hostname»" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ stylix.nixosModules.stylix ./configuration.nix ]; }; }; } ``` -------------------------------- ### Disable Bat Color Configuration Example Source: https://nix-community.github.io/stylix/options/modules/bat.html An example showing how to disable `config.lib.stylix.colors` for bat. ```nix false ``` -------------------------------- ### Dynamic Wallpaper Generation Source: https://nix-community.github.io/stylix/print.html Generates a solid color wallpaper based on a specific color from a Base16 theme. This example uses `yq` to extract the color and `imagemagick` to create the image. ```nix { pkgs, lib, ... }: let theme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml"; wallpaper = pkgs.runCommand "image.png" { } '' COLOR=$(${lib.getExe pkgs.yq} -r .palette.base00 ${theme}) ${lib.getExe pkgs.imagemagick} -size 1920x1080 xc:$COLOR $out ''; in { stylix = { image = wallpaper; base16Scheme = theme; }; } ``` -------------------------------- ### Commit Message Examples Source: https://nix-community.github.io/stylix/commit_convention.html Illustrative examples of valid Stylix commit messages for various subsystems and changes. ```text ci: add workflow to label merge conflicts ``` ```text flake: infer default.nix import path ``` ```text fontconfig: align Home Manager with NixOS and enhance docs ``` ```text kde: replace systemd unit with AutostartScript for theme application ``` ```text stylix/droid: fix import droid modules ``` ```text stylix: do not check lambda pattern names with deadnix ``` ```text stylix: rename homeManagerModules to homeModules ``` ```text treewide: adjust notification colors to represent urgency ``` ```text treewide: use mkEnableTargetWith for dynamic autoEnable conditions ``` ```text wayfire: mixup between wayfire and wf-shell settings ``` -------------------------------- ### Default Font Packages List Source: https://nix-community.github.io/stylix/print.html An empty list representing the default for all font packages to be installed. ```nix __[ ] ``` -------------------------------- ### Matching Stylix Release with Stable Home Manager Source: https://nix-community.github.io/stylix/installation.html When using a stable release of Home Manager, ensure you use the matching Stylix release. This example shows how to specify stable release versions for nixpkgs, home-manager, and stylix. ```nix { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; home-manager.url = "github:nix-community/home-manager/release-25.11"; stylix.url = "github:nix-community/stylix/release-25.11"; } ``` -------------------------------- ### Customize i3 Bar Configuration Source: https://nix-community.github.io/stylix/options/modules/i3.html This example shows how to define a custom i3 bar configuration that can be merged with Stylix's exported bar configuration. Ensure your configuration is placed before the Stylix configuration. ```nix xsession.windowManager.i3.config.bars = [ ( { # your configuration } // config.stylix.targets.i3.exportedBarConfig ) ]; ``` -------------------------------- ### Enable Spicetify Theming (Home Manager) Source: https://nix-community.github.io/stylix/options/modules/spicetify.html Set to `false` to disable Spicetify theming. This option respects the global `config.stylix.autoEnable` setting. Ensure Spicetify is installed and configured on the same platform. ```nix config.stylix.autoEnable ``` ```nix false ``` -------------------------------- ### Dynamically Generate Wallpapers with ImageMagick and Themes Source: https://nix-community.github.io/stylix/tricks.html Generate wallpapers dynamically based on a selected theme. This example uses ImageMagick to create a solid color wallpaper using a color from a Base16 theme file. ```nix { pkgs, lib, ... }: let theme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml"; wallpaper = pkgs.runCommand "image.png" { } '' COLOR=$(${lib.getExe pkgs.yq} -r .palette.base00 ${theme}) ${lib.getExe pkgs.imagemagick} -size 1920x1080 xc:$COLOR $out ''; in { stylix = { image = wallpaper; base16Scheme = theme; }; } ``` -------------------------------- ### Home Manager Configuration with Flakes Source: https://nix-community.github.io/stylix/installation.html Use this snippet to install Stylix directly into your Home Manager configuration when using flakes. Ensure that the nixpkgs and home-manager inputs are correctly configured. ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { nixpkgs, home-manager, stylix, ... }: { homeConfigurations."«username»" = home-manager.lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; modules = [ stylix.homeModules.stylix ./home.nix ]; }; }; } ``` -------------------------------- ### Install Stylix on nix-darwin with Flakes Source: https://nix-community.github.io/stylix/installation.html Integrate Stylix into your nix-darwin configuration. This setup automatically enables Home Manager modules if Home Manager is available. ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; darwin = { url = "github:nix-darwin/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { darwin, stylix, ... }: { darwinConfigurations."«hostname»" = darwin.lib.darwinSystem { system = "aarch64-darwin"; modules = [ stylix.darwinModules.stylix ./configuration.nix ]; }; }; } ``` -------------------------------- ### Install Stylix on Nix-on-Droid with Flakes Source: https://nix-community.github.io/stylix/print.html Configure Stylix for your Nix-on-Droid setup using Flakes. This applies the color scheme and monospace font to the terminal and integrates with Home Manager if used. ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nix-on-droid = { url = "github:nix-community/nix-on-droid"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { nix-on-droid, nixpkgs, stylix, ... }: { nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { pkgs = nixpkgs.legacyPackages."aarch64-linux"; modules = [ stylix.nixOnDroidModules.stylix ./nix-on-droid.nix ]; }; }; } ``` -------------------------------- ### List Available Testbeds Source: https://nix-community.github.io/stylix/testbeds.html Run this command from anywhere within the repository to see a list of all available testbeds and their corresponding packages. ```bash user@host:~$ nix flake show ``` -------------------------------- ### Disable i3 Font Theming Source: https://nix-community.github.io/stylix/print.html Example of disabling `config.stylix.fonts` for i3. ```nix false ``` -------------------------------- ### Run Live Demo of Dark Theme Source: https://nix-community.github.io/stylix/index.html Use this command to try a live demo of the dark theme. This command fetches and runs the testbed environment for the gnome dark theme. ```bash nix run github:nix-community/stylix#testbed:gnome:dark ``` -------------------------------- ### Disable Colors for Avizo Source: https://nix-community.github.io/stylix/options/modules/avizo.html Example of setting `config.lib.stylix.colors` to false for Avizo. ```nix __false ``` -------------------------------- ### Enable Qt Theming (Home Manager) Source: https://nix-community.github.io/stylix/options/modules/qt.html Configure whether to enable theming for Qt applications using the Home Manager module. This is a boolean option. ```nix __config.stylix.autoEnable ``` ```nix __true ``` -------------------------------- ### List Available Testbeds Source: https://nix-community.github.io/stylix/print.html Run this command to see all available testbeds within the Stylix repository. The output lists packages categorized by architecture. ```bash __ user@host:~$ nix flake show github:nix-community/stylix └───packages └───x86_64-linux ├───doc: package 'stylix-book' ├───palette-generator: package 'palette-generator' ├───"testbed:gnome:cursorless": package 'testbed-gnome-cursorless' ├───"testbed:gnome:dark": package 'testbed-gnome-dark' ├───"testbed:gnome:imageless": package 'testbed-gnome-imageless' ├───"testbed:gnome:light": package 'testbed-gnome-light' ├───"testbed:gnome:schemeless": package 'testbed-gnome-schemeless' ├───"testbed:kde:cursorless": package 'testbed-kde-cursorless' ├───"testbed:kde:dark": package 'testbed-kde-dark' ├───"testbed:kde:imageless": package 'testbed-kde-imageless' ├───"testbed:kde:light": package 'testbed-kde-light' └───"testbed:kde:schemeless": package 'testbed-kde-schemeless' ``` -------------------------------- ### Custom GTK CSS Source: https://nix-community.github.io/stylix/options/modules/gtk.html Add extra CSS rules to `gtk-3.0/gtk.css` and `gtk-4.0/gtk.css`. An example shows how to remove rounded corners. ```css '' // Remove rounded corners window.background { border-radius: 0; } '' ``` -------------------------------- ### Set Wallpaper from Local Path Source: https://nix-community.github.io/stylix/configuration.html Set the wallpaper by providing a local file path to `stylix.image`. ```nix { stylix.image = ./wallpaper.png; } ``` -------------------------------- ### Prioritizing Configuration with lib.mkAfter Source: https://nix-community.github.io/stylix/print.html When extending options of type `lines`, such as `style` options in Home Manager, use `lib.mkAfter` to ensure your custom configuration is applied last and takes precedence over existing definitions. This prevents unexpected conflicts. ```nix __ { programs.waybar = { enable = true; style = lib.mkAfter '' #workspaces button { background: @base01; } ''; }; } ``` -------------------------------- ### Set Base16 Color Scheme Source: https://nix-community.github.io/stylix/print.html Declare `stylix.base16Scheme` with a path to a Base16 color scheme file. This example uses the `gruvbox-dark-hard` scheme from `base16-schemes`. ```nix { pkgs, ... }: { stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; } ``` -------------------------------- ### Install Stylix on nix-darwin with Flakes Source: https://nix-community.github.io/stylix/print.html Set up Stylix for your nix-darwin configuration using Flakes. This configuration automatically enables Home Manager modules. ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; darwin = { url = "github:nix-darwin/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { darwin, stylix, ... }: { darwinConfigurations."«hostname»" = darwin.lib.darwinSystem { system = "aarch64-darwin"; modules = [ stylix.darwinModules.stylix ./configuration.nix ]; }; }; } ``` -------------------------------- ### Install Stylix on Nix-on-Droid with Flakes Source: https://nix-community.github.io/stylix/installation.html Integrate Stylix into your Nix-on-Droid configuration. This applies your configured color scheme and monospace font to the nix-on-droid terminal. ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nix-on-droid = { url = "github:nix-community/nix-on-droid"; inputs.nixpkgs.follows = "nixpkgs"; }; stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { nix-on-droid, nixpkgs, stylix, ... }: { nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { pkgs = nixpkgs.legacyPackages."aarch64-linux"; modules = [ stylix.nixOnDroidModules.stylix ./nix-on-droid.nix ]; }; }; } ``` -------------------------------- ### Module General Documentation Source: https://nix-community.github.io/stylix/print.html Add a general description to `meta.nix` for modules needing more context than option documentation provides. This can include supported theming items and caveats. ```nix description = '' Consider describing which applications are themed by this module (if it's not obvious from the module name), how the applications need to be installed for the module to work correctly, which theming items are supported (colors, fonts, wallpaper, ...), and any caveats the user should be aware of. ''; ``` -------------------------------- ### Add Extra CSS to ReGreet Source: https://nix-community.github.io/stylix/options/modules/regreet.html Provides a way to add extra CSS to ReGreet. Strings are concatenated with newline characters. Example shows how to remove window borders. ```nix "window.background { border-radius: 0; }" ``` -------------------------------- ### Enable QT Theming (HomeManager) Source: https://nix-community.github.io/stylix/print.html Set to `true` to enable theming for QT applications managed by Home Manager. This option depends on `config.stylix.autoEnable` and `nixosConfig` not being null. Defaults to `true`. ```nix __config.stylix.autoEnable && nixosConfig != null ``` ```nix __true ``` -------------------------------- ### Set Wallpaper from URL Source: https://nix-community.github.io/stylix/configuration.html Set the wallpaper using a URL by providing a derivation to `stylix.image`. Ensure the URL is valid and the hash is correct. ```nix { pkgs, ... }: { stylix.image = pkgs.fetchurl { url = "https://getwallpapers.com/wallpaper/full/1/4/3/523784.jpg"; hash = "sha256-S/6kgloXiIYI0NblT6YVXfqELApbdHGsuYe6S4JoQwQ="; }; } ``` -------------------------------- ### Creating Configuration Files with Color Templates Source: https://nix-community.github.io/stylix/modules.html Generate a configuration file using a Mustache template and Stylix colors. This returns a derivation that builds the template with the specified color scheme. ```nix { config, ... }: { environment.variables.MY_APPLICATION_CONFIG_FILE = let configFile = config.lib.stylix.colors { template = ./config.toml.mustache; extension = ".toml"; }; in "${configFile}"; } ``` -------------------------------- ### Access Stylix Colors Source: https://nix-community.github.io/stylix/print.html You can access configured color scheme values via `config.lib.stylix.colors`. This example shows how to access `base08` and its variants, as well as a `red` alias and a `withHashtag` helper. ```nix config.lib.stylix.colors = { base08 = "ff0000"; base08-hex-r = "ff"; base08-dec-r = "0.996094"; # ... red = "ff0000"; # ... withHashtag = { base08 = "#ff0000"; # ... }; }; ``` -------------------------------- ### Enter Developer Shell Source: https://nix-community.github.io/stylix/development_environment.html Run this command to enter the developer shell for the project. This environment provides necessary tools and configurations for development. ```bash nix develop ``` -------------------------------- ### Select Qt Platform Theme (NixOS) Source: https://nix-community.github.io/stylix/options/modules/qt.html Choose the platform theme for Qt applications. Defaults to 'qtct'. This option is available in the NixOS module. ```nix __"qtct" ``` -------------------------------- ### Install Stylix on NixOS with Flakes Source: https://nix-community.github.io/stylix/print.html Integrate Stylix into your NixOS configuration using Flakes for system-level theming. Ensure to follow Stylix release versions if not using the unstable branch. ```nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; stylix = { url = "github:nix-community/stylix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { nixpkgs, stylix, ... }: { nixosConfigurations."«hostname»" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ stylix.nixosModules.stylix ./configuration.nix ]; }; }; } ``` ```nix { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; stylix.url = "github:nix-community/stylix/release-25.11"; } ``` -------------------------------- ### Extend NixVim with Stylix Configuration Source: https://nix-community.github.io/stylix/options/modules/neovim.html This snippet shows how to extend a NixVim package with Stylix's exported module for standalone configurations. Ensure NixVim is properly installed and imported. ```nix { inputs, config, pkgs, ...}: let inherit (pkgs.stdenv.hostPlatform) system; nixvim-package = inputs.nixvim-config.packages.${system}.default; extended-nixvim = nixvim-package.extend config.stylix.targets.nixvim.exportedModule; in { environment.systemPackages = [ extended-nixvim ]; } ``` -------------------------------- ### Enable Blender Theming Source: https://nix-community.github.io/stylix/options/modules/blender.html Set to false to disable general theming for Blender. Defaults to config.stylix.autoEnable. ```nix __false ``` -------------------------------- ### Enable Bat Theming Source: https://nix-community.github.io/stylix/options/modules/bat.html Set to `true` to enable theming for bat. Defaults to `config.stylix.autoEnable`. ```nix config.stylix.autoEnable ``` -------------------------------- ### KDE Executable Package Source: https://nix-community.github.io/stylix/options/modules/kde.html Specifies the package containing KDE executables like 'plasma-apply-lookandfeel'. If null, Stylix searches common paths. Example uses '__"pkgs.plasma-workspace"'. ```nix __"pkgs.plasma-workspace" ``` -------------------------------- ### Generate Wallpaper using lib.stylix.pixel Source: https://nix-community.github.io/stylix/tricks.html A concise way to generate a wallpaper using the `lib.stylix.pixel` function, specifying a color from a Base16 theme. ```nix { pkgs, config, ... }: { stylix = { image = config.lib.stylix.pixel "base0A"; base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml"; }; } ``` -------------------------------- ### Prioritize CSS Styles with lib.mkAfter Source: https://nix-community.github.io/stylix/tricks.html Ensure custom CSS styles are applied last by using `lib.mkAfter` for options with the `lines` type, such as Home Manager's `style` options. This prevents conflicting declarations from being overridden unintentionally. ```nix { lib, ... }: { programs.waybar = { enable = true; style = lib.mkAfter '' #workspaces button { background: @base01; } ''; }; } ``` -------------------------------- ### Enable GNOME Theming Source: https://nix-community.github.io/stylix/options/modules/gnome.html Set to `true` to enable theming for GNOME. This option depends on `config.stylix.autoEnable` and whether the host platform is Linux. ```nix __config.stylix.autoEnable && pkgs.stdenv.hostPlatform.isLinux ``` ```nix __true ``` -------------------------------- ### Stylix NixOS Flake Configuration for Stable Releases Source: https://nix-community.github.io/stylix/installation.html When using a stable NixOS release, ensure you use the matching Stylix release for compatibility. This example shows how to pin to nixos-25.11 and release-25.11 of Stylix. ```nix { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; stylix.url = "github:nix-community/stylix/release-25.11"; } ``` -------------------------------- ### Select Qt Dialogs Theme Source: https://nix-community.github.io/stylix/options/modules/qt.html Choose the theme for standard Qt dialogs. Options include 'default', 'gtk2', 'gtk3', 'kde', and 'xdgdesktopportal'. Using 'xdgdesktopportal' integrates with the native desktop portal. This is configured in the Home Manager module. ```nix __"default" ```