Style : Move font cfg etc to Style from Stylix.
This commit is contained in:
parent
40e51ace25
commit
505eccdd4a
|
@ -1,10 +1,11 @@
|
||||||
{ lib, config, ... }: with lib; let
|
{ lib, config, pkgs, __findFile, ... }: with lib; let
|
||||||
cfg = config.style;
|
cfg = config.style;
|
||||||
|
|
||||||
mkTypeOption = default: type: mkOption { inherit default type; };
|
mkTypeOption = default: type: mkOption { inherit default type; };
|
||||||
mkStrOption = default: mkTypeOption default types.str;
|
mkStrOption = default: mkTypeOption default types.str;
|
||||||
mkIntOption = default: mkTypeOption default types.int;
|
mkIntOption = default: mkTypeOption default types.int;
|
||||||
mkFloatOption = default: mkTypeOption default types.float;
|
mkFloatOption = default: mkTypeOption default types.float;
|
||||||
|
mkPkgOption = default: mkTypeOption default types.package;
|
||||||
in {
|
in {
|
||||||
options.style = {
|
options.style = {
|
||||||
color = {
|
color = {
|
||||||
|
@ -61,26 +62,44 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
font = {
|
font = {
|
||||||
emoji.name = mkStrOption config.stylix.fonts.emoji.name;
|
|
||||||
monospace.name = mkStrOption config.stylix.fonts.monospace.name;
|
|
||||||
sansSerif.name = mkStrOption config.stylix.fonts.sansSerif.name;
|
|
||||||
serif.name = mkStrOption config.stylix.fonts.serif.name;
|
|
||||||
size = {
|
size = {
|
||||||
terminal = mkIntOption config.stylix.fonts.sizes.terminal;
|
application = mkIntOption 12;
|
||||||
popup = mkIntOption config.stylix.fonts.sizes.popups;
|
terminal = mkIntOption 14;
|
||||||
application = mkIntOption config.stylix.fonts.sizes.applications;
|
popup = mkIntOption 12;
|
||||||
desktop = mkIntOption config.stylix.fonts.sizes.desktop;
|
desktop = mkIntOption 14;
|
||||||
|
};
|
||||||
|
serif = {
|
||||||
|
package = mkPkgOption (pkgs.callPackage <package/applefont> {});
|
||||||
|
name = mkStrOption "SF Pro Display";
|
||||||
|
};
|
||||||
|
sansSerif = {
|
||||||
|
package = mkPkgOption (pkgs.callPackage <package/applefont> {});
|
||||||
|
name = mkStrOption "SF Pro Display";
|
||||||
|
};
|
||||||
|
monospace = {
|
||||||
|
package = mkPkgOption (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; });
|
||||||
|
name = mkStrOption "Terminess Nerd Font Mono";
|
||||||
|
};
|
||||||
|
emoji = {
|
||||||
|
package = mkPkgOption pkgs.noto-fonts-emoji;
|
||||||
|
name = mkStrOption "Noto Color Emoji";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
opacity = {
|
opacity = {
|
||||||
application = mkFloatOption config.stylix.opacity.applications;
|
application = mkFloatOption 0.85;
|
||||||
desktop = mkFloatOption config.stylix.opacity.desktop;
|
desktop = mkFloatOption 0.85;
|
||||||
popup = mkFloatOption config.stylix.opacity.popups;
|
popup = mkFloatOption 0.85;
|
||||||
terminal = mkFloatOption config.stylix.opacity.terminal;
|
terminal = mkFloatOption 0.85;
|
||||||
hex = mkStrOption "D9";
|
hex = mkStrOption "D9";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cursor = {
|
||||||
|
name = mkStrOption "Adwaita";
|
||||||
|
package = mkPkgOption pkgs.gnome3.adwaita-icon-theme;
|
||||||
|
size = mkIntOption 14;
|
||||||
|
};
|
||||||
|
|
||||||
window = {
|
window = {
|
||||||
gap = mkIntOption 8;
|
gap = mkIntOption 8;
|
||||||
border = mkIntOption 4;
|
border = mkIntOption 4;
|
||||||
|
|
|
@ -4,40 +4,20 @@
|
||||||
image = config.module.wallpaper.path;
|
image = config.module.wallpaper.path;
|
||||||
autoEnable = true;
|
autoEnable = true;
|
||||||
polarity = "dark";
|
polarity = "dark";
|
||||||
opacity = {
|
fonts = {
|
||||||
applications = 0.85;
|
inherit (config.style.font) serif sansSerif monospace emoji;
|
||||||
terminal = 0.85;
|
|
||||||
popups = 0.85;
|
|
||||||
desktop = 0.85;
|
|
||||||
};
|
|
||||||
cursor = {
|
|
||||||
name = "Adwaita";
|
|
||||||
package = pkgs.gnome3.adwaita-icon-theme;
|
|
||||||
size = 14;
|
|
||||||
};
|
|
||||||
fonts = let
|
|
||||||
serif = {
|
|
||||||
package = (pkgs.callPackage <package/applefont> {});
|
|
||||||
name = "SF Pro Display";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
inherit serif;
|
|
||||||
sizes = {
|
sizes = {
|
||||||
applications = 12;
|
inherit (config.style.font.size) terminal desktop;
|
||||||
terminal = 14;
|
popups = config.style.font.size.popup;
|
||||||
popups = 12;
|
applications = config.style.font.size.application;
|
||||||
desktop = 14;
|
|
||||||
};
|
|
||||||
sansSerif = serif;
|
|
||||||
monospace = {
|
|
||||||
package = (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; });
|
|
||||||
name = "Terminess Nerd Font Mono";
|
|
||||||
};
|
|
||||||
emoji = {
|
|
||||||
package = pkgs.noto-fonts-emoji;
|
|
||||||
name = "Noto Color Emoji";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
opacity = {
|
||||||
|
inherit (config.style.opacity) desktop terminal;
|
||||||
|
applications = config.style.opacity.application;
|
||||||
|
popups = config.style.opacity.popups;
|
||||||
|
};
|
||||||
|
inherit (config.style) cursor;
|
||||||
override = if config.module.wallpaper.forceContrastText then {
|
override = if config.module.wallpaper.forceContrastText then {
|
||||||
base04 = "000000";
|
base04 = "000000";
|
||||||
base05 = "ffffff";
|
base05 = "ffffff";
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -298,11 +298,12 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
# Android.
|
# Android.
|
||||||
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
|
nixOnDroidConfigurations.default = let
|
||||||
modules = let
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
config = self.nixOnDroidConfigurations.default.config;
|
config = self.nixOnDroidConfigurations.default.config;
|
||||||
in [
|
lib = nixpkgs.lib;
|
||||||
|
pkgs = nixpkgs.legacyPackages."aarch64-linux".pkgs;
|
||||||
|
in nix-on-droid.lib.nixOnDroidConfiguration {
|
||||||
|
modules = [
|
||||||
# Android release version.
|
# Android release version.
|
||||||
{ system.stateVersion = self.const.droidStateVersion; }
|
{ system.stateVersion = self.const.droidStateVersion; }
|
||||||
|
|
||||||
|
@ -318,15 +319,15 @@
|
||||||
# Some common modules.
|
# Some common modules.
|
||||||
./config/Setting.nix
|
./config/Setting.nix
|
||||||
./config/Wallpaper.nix
|
./config/Wallpaper.nix
|
||||||
(import ./config/Style.nix { inherit lib; inherit (config.home-manager) config; })
|
(import ./config/Style.nix {
|
||||||
|
inherit (config.home-manager) config;
|
||||||
|
inherit (self) __findFile;
|
||||||
|
inherit lib pkgs;
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
# SpecialArgs allows you to pass objects down to other configuration.
|
# SpecialArgs allows you to pass objects down to other configuration.
|
||||||
extraSpecialArgs = let
|
extraSpecialArgs = {
|
||||||
# We want arm64 packages for Android.
|
|
||||||
pkgs = nixpkgs.legacyPackages."aarch64-linux".pkgs;
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
in {
|
|
||||||
inherit inputs self;
|
inherit inputs self;
|
||||||
inherit (self) const __findFile;
|
inherit (self) const __findFile;
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,7 @@ in {
|
||||||
".termux/_colors.properties".text = android.colors;
|
".termux/_colors.properties".text = android.colors;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# ISSUE: Firefox causes inf rec for some reason.
|
programs = import ./program args;
|
||||||
# programs = import ./program args;
|
|
||||||
programs = (import ./program args) // { firefox = {}; };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# This is a systemd service that pulls updates every hour.
|
# This is a systemd service that pulls updates every hour.
|
||||||
# Unlike system.autoUpgrade, this script also verifies my git signature
|
# Unlike system.autoUpgrade, this script also verifies my git signature
|
||||||
# to prevent unathorized changes to hosts.
|
# to prevent unathorized changes to hosts.
|
||||||
{ const, pkgs, lib, util, config, ... }: with lib; let
|
{ const, pkgs, lib, util, config, secret, ... }: with lib; let
|
||||||
cfg = config.module.autoupdate;
|
cfg = config.module.autoupdate;
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
|
@ -12,6 +12,13 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
gpg.ssh.allowedSignersFile = toString secret.crypto.sign.git.allowed;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.autoupdate = util.mkStaticSystemdService {
|
systemd.services.autoupdate = util.mkStaticSystemdService {
|
||||||
enable = true;
|
enable = true;
|
||||||
description = "Signed system auto-update.";
|
description = "Signed system auto-update.";
|
||||||
|
|
Loading…
Reference in a new issue