2023-12-05 23:11:54 +01:00
{ pkgs , config , lib , . . . }:
2023-10-29 00:49:22 +02:00
let
2023-12-05 20:57:05 +01:00
# Currently last commit in https://github.com/danth/stylix/pull/194
2023-12-05 23:11:54 +01:00
phases = [
{ command = " j o u r " ; polarity = " l i g h t " ; }
{ command = " c r e p u s c u l e " ; polarity = " d a r k " ; }
{ command = " n u i t " ; polarity = " d a r k " ; }
] ;
cfg = config . frogeye . desktop . phasesBrightness ;
2023-10-29 00:49:22 +02:00
in
{
stylix = {
2024-01-06 18:40:20 +01:00
2024-01-07 12:54:43 +01:00
base16Scheme = " ${ pkgs . base16-schemes } / s h a r e / t h e m e s / s o l a r i z e d - ${ config . frogeye . polarity } . y a m l " ;
2023-10-29 00:49:22 +02:00
image = builtins . fetchurl {
url = " h t t p s : / / g e t . w a l l h e r e . c o m / p h o t o / s u n l i g h t - a b s t r a c t - m i n i m a l i s m - g r e e n - s i m p l e - c i r c l e - l i g h t - l e a f - w a v e - m a t e r i a l - l i n e - w i n g - c o m p u t e r - w a l l p a p e r - f o n t - c l o s e - u p - m a c r o - p h o t o g r a p h y - 1 2 4 3 5 0 . p n g " ;
sha256 = " s h a 2 5 6 : 1 z f q 3 f 3 v 3 4 i 4 5 m i 7 2 p k f q p h m 8 k b h c z s g 2 6 0 x j f l 6 d b y d y 9 1 d 7 y 9 3 " ;
} ;
2023-11-26 23:47:15 +01:00
# The background is set on some occasions, autorandr + feh do the rest
2023-10-29 12:15:56 +01:00
2023-11-12 21:53:52 +01:00
fonts = {
monospace = {
2023-11-21 21:01:56 +01:00
package = pkgs . nerdfonts . override {
fonts = [ " D e j a V u S a n s M o n o " ] ; # Choose from https://github.com/NixOS/nixpkgs/blob/6ba3207643fd27ffa25a172911e3d6825814d155/pkgs/data/fonts/nerdfonts/shas.nix
} ;
2023-11-12 21:53:52 +01:00
name = " D e j a V u S a n s M N e r d F o n t " ;
} ;
2023-11-02 21:57:06 +01:00
} ;
2023-10-29 00:49:22 +02:00
} ;
2023-12-05 23:11:54 +01:00
2023-10-29 00:49:22 +02:00
# Fix https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal
2023-11-05 21:36:11 +01:00
# home.packages = [ pkgs.dconf ];
dconf . enable = false ; # Otherwise standalone home-manager complains it can't find /etc/dbus-1/session.conf on Arch.
# Symlinking it to /usr/share/dbus-1/session.conf goes further but not much.
2023-12-05 23:11:54 +01:00
home . packages = map
( phase : ( pkgs . writeShellApplication {
name = " ${ phase . command } " ;
2023-12-16 22:39:11 +01:00
runtimeInputs = [ pkgs . brightnessctl ] ;
2023-12-05 23:11:54 +01:00
text = ( lib . optionalString cfg . enable ''
2023-12-16 22:39:11 +01:00
brightnessctl set $ { builtins . getAttr phase . command cfg }
2023-12-17 12:37:41 +01:00
'' ) + ''
2024-01-07 12:54:43 +01:00
switch = " / n i x / v a r / n i x / p r o f i l e s / s y s t e m / s p e c i a l i s a t i o n / ${ phase . polarity } / b i n / s w i t c h - t o - c o n f i g u r a t i o n "
if [ - x " $ s w i t c h " ]
2023-12-05 23:11:54 +01:00
then
2023-12-17 12:37:41 +01:00
# In two steps to get the visual changes slightly earlier
2024-01-07 12:54:43 +01:00
sudo " $ s w i t c h " test
sudo " $ s w i t c h " boot
2023-12-05 23:11:54 +01:00
fi
'' ;
} )
)
phases ;
2023-10-29 00:49:22 +02:00
}