No description
Find a file
2022-04-23 10:36:20 +01:00
modules Use an external library for base16 ♻️ 2022-04-23 10:36:20 +01:00
palette-generator Use an external library for base16 ♻️ 2022-04-23 10:36:20 +01:00
stylix Use an external library for base16 ♻️ 2022-04-23 10:36:20 +01:00
flake.lock Use an external library for base16 ♻️ 2022-04-23 10:36:20 +01:00
flake.nix Use an external library for base16 ♻️ 2022-04-23 10:36:20 +01:00
LICENSE Add MIT license 2020-12-21 13:58:20 +00:00
README.md Remove non-flake installation method from README 📝 2021-12-17 17:11:19 +00:00

Stylix

System-wide colorscheming and typography for NixOS, built upon ideas from Base16.

Installation

Stylix can be installed using the experimental flakes feature:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    stylix.url = "github:danth/stylix";
  };

  outputs = { self, nixpkgs, home-manager, stylix }: {
    nixosConfigurations."<hostname>" = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        home-manager.nixosModules.home-manager
        stylix.nixosModules.stylix
      ];
    };
  };
}

Stylix relies on Home Manager to install a lot of its theming. This requires Home Manager to be installed as a NixOS module; how to do this is shown in the example above. Users must be listed in stylix.homeManagerUsers to enable styles which rely on Home Manager for that user.

Configuration

{ pkgs, ... }:

{
  # A colorscheme will be chosen automatically based on your wallpaper
  stylix.image = ./wallpaper.png;

  # Select your preferred fonts, or use these defaults:
  stylix.fonts = {
    serif = {
      package = pkgs.dejavu_fonts;
      name = "DejaVu Serif";
    };
    sansSerif = {
      package = pkgs.dejavu_fonts;
      name = "DejaVu Sans";
    };
    monospace = {
      package = pkgs.dejavu_fonts;
      name = "DejaVu Sans Mono";
    };
    emoji = {
      package = pkgs.noto-fonts-emoji;
      name = "Noto Color Emoji";
    };
  };

  # Add users to this list to enable Home Manager integration
  stylix.homeManagerUsers = [ "danth" ];
}