2020-12-21 15:45:32 +00:00
|
|
|
# Stylix
|
|
|
|
|
|
|
|
System-wide colorscheming and typography for [NixOS](https://nixos.org/),
|
|
|
|
built upon ideas from [Base16](http://chriskempson.com/projects/base16/).
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2021-12-17 17:11:19 +00:00
|
|
|
Stylix can be installed using the experimental
|
2020-12-21 15:45:32 +00:00
|
|
|
[flakes](https://nixos.wiki/wiki/Flakes) feature:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2021-12-17 17:11:19 +00:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2020-12-21 15:45:32 +00:00
|
|
|
stylix.url = "github:danth/stylix";
|
|
|
|
};
|
|
|
|
|
2021-12-17 17:11:19 +00:00
|
|
|
outputs = { self, nixpkgs, home-manager, stylix }: {
|
2020-12-21 15:45:32 +00:00
|
|
|
nixosConfigurations."<hostname>" = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
2021-12-17 17:11:19 +00:00
|
|
|
modules = [
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
stylix.nixosModules.stylix
|
|
|
|
];
|
2020-12-21 15:45:32 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-12-17 17:11:19 +00:00
|
|
|
Stylix relies on [Home Manager](https://github.com/nix-community/home-manager)
|
|
|
|
to install a lot of its theming. This requires Home Manager to be installed as
|
2022-04-24 10:38:24 +00:00
|
|
|
a NixOS module; how to do this is shown in the example above.
|
2021-12-17 17:11:19 +00:00
|
|
|
|
2020-12-21 15:45:32 +00:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{ 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";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|