doc: format and polish Nix code according to our formatter (#1025)

Link: https://github.com/danth/stylix/pull/1025

Reviewed-by: Daniel Thwaites <danth@danth.me>
This commit is contained in:
NAHO 2025-03-26 14:58:03 +01:00 committed by GitHub
parent 61a5f77f22
commit daef51e920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 100 additions and 58 deletions

View file

@ -8,12 +8,11 @@ Here's an example Nix expression that takes an input image, applies a brightness
```nix
{ pkgs, ... }:
let
inputImage = ./path/to/image.jpg;
brightness = -30;
contrast = 0;
fillColor = "black"
fillColor = "black";
in
{
stylix.image = pkgs.runCommand "dimmed-background.png" { } ''
@ -29,14 +28,14 @@ Similarly, you can use a template image and repaint it for the current theme.
```nix
{ pkgs, ... }:
let
theme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml";
wallpaper = pkgs.runCommand "image.png" {} ''
COLOR=$(${pkgs.yq}/bin/yq -r .palette.base00 ${theme})
${pkgs.imagemagick}/bin/magick -size 1920x1080 xc:$COLOR $out
wallpaper = pkgs.runCommand "image.png" { } ''
COLOR=$(${pkgs.yq}/bin/yq -r .palette.base00 ${theme})
${pkgs.imagemagick}/bin/magick -size 1920x1080 xc:$COLOR $out
'';
in {
in
{
stylix = {
image = wallpaper;
base16Scheme = theme;
@ -48,7 +47,6 @@ Which is neatly implemented as a single function in `lib.stylix.pixel`:
```nix
{ pkgs, config, ... }:
{
stylix = {
image = config.lib.stylix.pixel "base0A";