This commit is contained in:
commit
95a533c876
451 changed files with 18255 additions and 0 deletions
91
modules/home/stylix/default.nix
Normal file
91
modules/home/stylix/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.stylix;
|
||||
|
||||
# all valid options for `cfg.scheme`
|
||||
validSchemes = [
|
||||
"ayu"
|
||||
"dracula"
|
||||
"gruvbox"
|
||||
"moonfly"
|
||||
"nord"
|
||||
"oxocarbon"
|
||||
];
|
||||
# schemes names in `pkgs.base16-schemes` that need a suffix
|
||||
needsSuffix = [
|
||||
"ayu"
|
||||
"gruvbox"
|
||||
];
|
||||
# schemes in ./schemes
|
||||
customSchemes = [
|
||||
"moonfly"
|
||||
"oxocarbon"
|
||||
];
|
||||
schemeName =
|
||||
if builtins.elem cfg.scheme needsSuffix then "${cfg.scheme}-${cfg.polarity}" else cfg.scheme;
|
||||
scheme =
|
||||
if builtins.elem cfg.scheme customSchemes then
|
||||
./schemes/${schemeName}.yaml
|
||||
else
|
||||
"${pkgs.base16-schemes}/share/themes/${schemeName}.yaml";
|
||||
|
||||
inherit (lib)
|
||||
mkDefault
|
||||
mkIf
|
||||
types
|
||||
;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.stylix.homeModules.stylix
|
||||
|
||||
./targets
|
||||
];
|
||||
|
||||
options.stylix = {
|
||||
scheme = lib.mkOption {
|
||||
type = types.str;
|
||||
default = "dracula";
|
||||
description = ''
|
||||
Base16 color scheme name. Available options are:
|
||||
${toString validSchemes}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = builtins.elem cfg.scheme validSchemes;
|
||||
message = "Stylix: Invalid colorscheme '${cfg.scheme}'. Available options: ${toString validSchemes}";
|
||||
}
|
||||
];
|
||||
|
||||
stylix = {
|
||||
autoEnable = mkDefault true;
|
||||
base16Scheme = scheme;
|
||||
fonts = {
|
||||
monospace = mkDefault {
|
||||
package = pkgs.hack-font;
|
||||
name = "Hack";
|
||||
};
|
||||
};
|
||||
polarity = mkDefault "dark";
|
||||
|
||||
targets = {
|
||||
librewolf.profileNames = [ "default" ];
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
(pkgs.callPackage ./print-colors { })
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue