treewide: add and apply nixfmt pre-commit hook

Link: https://github.com/danth/stylix/pull/519
This commit is contained in:
NAHO 2024-11-15 15:14:30 +01:00
parent 807c81894e
commit ad64260a75
No known key found for this signature in database
GPG key ID: 229CB671D09B95F5
108 changed files with 3143 additions and 2371 deletions

View file

@ -1,35 +1,44 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
{
options.stylix.targets.feh.enable =
config.lib.stylix.mkEnableTarget
"the desktop background using Feh"
true;
config.lib.stylix.mkEnableTarget "the desktop background using Feh" true;
config.xsession.initExtra =
lib.mkIf (
config.stylix.enable
&& config.stylix.targets.feh.enable
&& (
with config.xsession.windowManager;
bspwm.enable
|| herbstluftwm.enable
|| i3.enable
|| spectrwm.enable
|| xmonad.enable
lib.mkIf
(
config.stylix.enable
&& config.stylix.targets.feh.enable
&& (
with config.xsession.windowManager;
bspwm.enable
|| herbstluftwm.enable
|| i3.enable
|| spectrwm.enable
|| xmonad.enable
)
)
) (let
inherit (config.stylix) imageScalingMode;
bg-arg =
if imageScalingMode == "fill"
then "--bg-fill"
else if imageScalingMode == "center"
then "--bg-center"
else if imageScalingMode == "tile"
then "--bg-tile"
else if imageScalingMode == "stretch"
then "--bg-scale"
# Fit
else "--bg-max";
in "${pkgs.feh}/bin/feh --no-fehbg ${bg-arg} ${config.stylix.image}");
(
let
inherit (config.stylix) imageScalingMode;
bg-arg =
if imageScalingMode == "fill" then
"--bg-fill"
else if imageScalingMode == "center" then
"--bg-center"
else if imageScalingMode == "tile" then
"--bg-tile"
else if imageScalingMode == "stretch" then
"--bg-scale"
# Fit
else
"--bg-max";
in
"${pkgs.feh}/bin/feh --no-fehbg ${bg-arg} ${config.stylix.image}"
);
}