mirror of
https://github.com/librephoenix/nixos-config
synced 2025-10-19 01:54:02 +05:30
Major config overhaul: use custom modules, setup for multi-host config, and less boilerplate
This commit is contained in:
parent
1fa8b17b07
commit
0453901d17
303 changed files with 3560 additions and 5566 deletions
56
modules/system/stylix/default.nix
Normal file
56
modules/system/stylix/default.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{ lib, config, pkgs, inputs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemSettings.stylix;
|
||||
theme = import (./. + "../../../themes"+("/"+config.systemSettings.stylix.theme));
|
||||
in
|
||||
{
|
||||
options = {
|
||||
systemSettings.stylix = {
|
||||
enable = lib.mkEnableOption "Enable stylix theming";
|
||||
};
|
||||
systemSettings.stylix.theme = lib.mkOption {
|
||||
default = "io";
|
||||
type = lib.types.enum (builtins.attrNames (lib.filterAttrs (name: type: type == "directory") (builtins.readDir ../../themes)));
|
||||
description = "Theme for stylix to use system wide. A list of themes can be found in the `themes` directory.";
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ inputs.stylix.nixosModules.stylix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
stylix.enable = true;
|
||||
stylix.autoEnable = false;
|
||||
stylix.polarity = theme.polarity;
|
||||
stylix.image = pkgs.fetchurl {
|
||||
url = theme.backgroundUrl;
|
||||
sha256 = theme.backgroundSha256;
|
||||
};
|
||||
stylix.base16Scheme = theme;
|
||||
stylix.fonts = {
|
||||
# TODO abstract fonts into an option
|
||||
monospace = {
|
||||
name = "FiraCode Nerd Font";
|
||||
package = pkgs.nerd-fonts.fira-code;
|
||||
};
|
||||
serif = {
|
||||
name = "FiraCode Nerd Font";
|
||||
package = pkgs.nerd-fonts.fira-code;
|
||||
};
|
||||
sansSerif = {
|
||||
name = "FiraCode Nerd Font";
|
||||
package = pkgs.nerd-fonts.fira-code;
|
||||
};
|
||||
emoji = {
|
||||
name = "Noto Color Emoji";
|
||||
package = pkgs.noto-fonts-emoji-blob-bin;
|
||||
};
|
||||
};
|
||||
|
||||
stylix.targets.console.enable = true;
|
||||
|
||||
environment.sessionVariables = {
|
||||
QT_QPA_PLATFORMTHEME = "qt5ct";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue