Created
May 19, 2023 15:35
-
-
Save calops/3b154f4b291ba05e8807c23e6c232313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
config, | |
lib, | |
pkgs, | |
... | |
}: let | |
cfg = config.my.roles.graphical; | |
nixGlPkg = | |
if cfg.nvidia.enable | |
then pkgs.nixgl.auto.nixGLNvidia | |
else pkgs.nixgl.nixGLIntel; | |
include = prg: import prg {inherit config lib pkgs;}; | |
in | |
with lib; { | |
options = { | |
my.roles.graphical = { | |
enable = mkEnableOption "Graphical environment"; | |
nvidia.enable = mkEnableOption "Nvidia tweaks"; | |
font = { | |
name = mkOption { | |
type = types.str; | |
default = "Iosevka Comfy"; | |
description = "Font name"; | |
}; | |
size = mkOption { | |
type = types.int; | |
default = 10; | |
description = "Font size"; | |
}; | |
pkg = mkOption { | |
type = types.package; | |
default = pkgs.iosevka-comfy.comfy; | |
description = "Font package"; | |
}; | |
}; | |
terminal = mkOption { | |
type = types.enum ["kitty" "wezterm"]; | |
default = "wezterm"; | |
description = "Terminal emulator"; | |
}; | |
}; | |
}; | |
imports = [ | |
]; | |
config = | |
mkIf cfg.enable | |
{ | |
programs.kitty = mkIf (cfg.terminal == "kitty") (include ./kitty.nix); | |
programs.wezterm = mkIf (cfg.terminal == "wezterm") (include ./wezterm.nix); | |
fonts.fontconfig.enable = true; | |
home.packages = [ | |
cfg.font.pkg | |
nixGlPkg | |
]; | |
} | |
// (include ./element.nix); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment