Android : Use Stylix.
This commit is contained in:
parent
676c5b821e
commit
d564678824
89
android/Style.nix
Normal file
89
android/Style.nix
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
{ lib, config, ... }: with lib; let
|
||||||
|
cfg = config.style;
|
||||||
|
|
||||||
|
mkTypeOption = default: type: mkOption { inherit default type; };
|
||||||
|
mkStrOption = default: mkTypeOption default types.str;
|
||||||
|
mkIntOption = default: mkTypeOption default types.int;
|
||||||
|
mkFloatOption = default: mkTypeOption default types.float;
|
||||||
|
in {
|
||||||
|
options.style = {
|
||||||
|
color = {
|
||||||
|
bg = {
|
||||||
|
dark = mkStrOption config.home-manager.config.lib.stylix.colors.base00;
|
||||||
|
light = mkStrOption config.home-manager.config.lib.stylix.colors.base07;
|
||||||
|
regular = mkStrOption config.home-manager.config.lib.stylix.colors.base01;
|
||||||
|
};
|
||||||
|
fg = {
|
||||||
|
dark = mkStrOption config.home-manager.config.lib.stylix.colors.base04;
|
||||||
|
light = mkStrOption config.home-manager.config.lib.stylix.colors.base06;
|
||||||
|
regular = mkStrOption config.home-manager.config.lib.stylix.colors.base05;
|
||||||
|
};
|
||||||
|
accent = mkStrOption config.home-manager.config.lib.stylix.colors.base0A;
|
||||||
|
heading = mkStrOption config.home-manager.config.lib.stylix.colors.base0D;
|
||||||
|
hl = mkStrOption config.home-manager.config.lib.stylix.colors.base03;
|
||||||
|
keyword = mkStrOption config.home-manager.config.lib.stylix.colors.base0E;
|
||||||
|
link = mkStrOption config.home-manager.config.lib.stylix.colors.base09;
|
||||||
|
misc = mkStrOption config.home-manager.config.lib.stylix.colors.base0F;
|
||||||
|
negative = mkStrOption config.home-manager.config.lib.stylix.colors.base08;
|
||||||
|
neutral = mkStrOption config.home-manager.config.lib.stylix.colors.base0C;
|
||||||
|
positive = mkStrOption config.home-manager.config.lib.stylix.colors.base0B;
|
||||||
|
selection = mkStrOption config.home-manager.config.lib.stylix.colors.base02;
|
||||||
|
transparent = mkStrOption "ffffff00";
|
||||||
|
|
||||||
|
accent-b = mkStrOption config.home-manager.config.lib.stylix.colors.base0A-rgb-b;
|
||||||
|
accent-g = mkStrOption config.home-manager.config.lib.stylix.colors.base0A-rgb-g;
|
||||||
|
accent-r = mkStrOption config.home-manager.config.lib.stylix.colors.base0A-rgb-r;
|
||||||
|
|
||||||
|
negative-b = mkStrOption config.home-manager.config.lib.stylix.colors.base08-rgb-b;
|
||||||
|
negative-g = mkStrOption config.home-manager.config.lib.stylix.colors.base08-rgb-g;
|
||||||
|
negative-r = mkStrOption config.home-manager.config.lib.stylix.colors.base08-rgb-r;
|
||||||
|
|
||||||
|
neutral-b = mkStrOption config.home-manager.config.lib.stylix.colors.base0C-rgb-b;
|
||||||
|
neutral-g = mkStrOption config.home-manager.config.lib.stylix.colors.base0C-rgb-g;
|
||||||
|
neutral-r = mkStrOption config.home-manager.config.lib.stylix.colors.base0C-rgb-r;
|
||||||
|
|
||||||
|
positive-b = mkStrOption config.home-manager.config.lib.stylix.colors.base0B-rgb-b;
|
||||||
|
positive-g = mkStrOption config.home-manager.config.lib.stylix.colors.base0B-rgb-g;
|
||||||
|
positive-r = mkStrOption config.home-manager.config.lib.stylix.colors.base0B-rgb-r;
|
||||||
|
|
||||||
|
bg-b = mkStrOption config.home-manager.config.lib.stylix.colors.base00-rgb-b;
|
||||||
|
bg-g = mkStrOption config.home-manager.config.lib.stylix.colors.base00-rgb-g;
|
||||||
|
bg-r = mkStrOption config.home-manager.config.lib.stylix.colors.base00-rgb-r;
|
||||||
|
|
||||||
|
fg-b = mkStrOption config.home-manager.config.lib.stylix.colors.base06-rgb-b;
|
||||||
|
fg-g = mkStrOption config.home-manager.config.lib.stylix.colors.base06-rgb-g;
|
||||||
|
fg-r = mkStrOption config.home-manager.config.lib.stylix.colors.base06-rgb-r;
|
||||||
|
|
||||||
|
border = mkStrOption config.home-manager.config.lib.stylix.colors.base01;
|
||||||
|
border-b = mkStrOption config.home-manager.config.lib.stylix.colors.base01-rgb-b;
|
||||||
|
border-g = mkStrOption config.home-manager.config.lib.stylix.colors.base01-rgb-g;
|
||||||
|
border-r = mkStrOption config.home-manager.config.lib.stylix.colors.base01-rgb-r;
|
||||||
|
};
|
||||||
|
|
||||||
|
font = {
|
||||||
|
emoji.name = mkStrOption config.home-manager.config.stylix.fonts.emoji.name;
|
||||||
|
monospace.name = mkStrOption config.home-manager.config.stylix.fonts.monospace.name;
|
||||||
|
sansSerif.name = mkStrOption config.home-manager.config.stylix.fonts.sansSerif.name;
|
||||||
|
serif.name = mkStrOption config.home-manager.config.stylix.fonts.serif.name;
|
||||||
|
size = {
|
||||||
|
terminal = mkIntOption config.home-manager.config.stylix.fonts.sizes.terminal;
|
||||||
|
popup = mkIntOption config.home-manager.config.stylix.fonts.sizes.popups;
|
||||||
|
application = mkIntOption config.home-manager.config.stylix.fonts.sizes.applications;
|
||||||
|
desktop = mkIntOption config.home-manager.config.stylix.fonts.sizes.desktop;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
opacity = {
|
||||||
|
application = mkFloatOption config.home-manager.config.stylix.opacity.applications;
|
||||||
|
desktop = mkFloatOption config.home-manager.config.stylix.opacity.desktop;
|
||||||
|
popup = mkFloatOption config.home-manager.config.stylix.opacity.popups;
|
||||||
|
terminal = mkFloatOption config.home-manager.config.stylix.opacity.terminal;
|
||||||
|
hex = mkStrOption "D9";
|
||||||
|
};
|
||||||
|
|
||||||
|
window = {
|
||||||
|
gap = mkIntOption 8;
|
||||||
|
border = mkIntOption 4;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
{ pkgs
|
{ pkgs
|
||||||
, inputs
|
, inputs
|
||||||
, const
|
, const
|
||||||
|
, lib
|
||||||
, util
|
, util
|
||||||
|
, config
|
||||||
, secret
|
, secret
|
||||||
, ... } @args: let
|
, ... } @args: let
|
||||||
# Path where Termux stores user data.
|
# Path where Termux stores user data.
|
||||||
|
@ -23,11 +25,64 @@ in {
|
||||||
# Configure system.
|
# Configure system.
|
||||||
time.timeZone = const.timeZone;
|
time.timeZone = const.timeZone;
|
||||||
nix.extraOptions = "experimental-features = nix-command flakes";
|
nix.extraOptions = "experimental-features = nix-command flakes";
|
||||||
|
# stylix.autoEnable = lib.mkForce false;
|
||||||
|
|
||||||
# Install packages.
|
# Install packages.
|
||||||
environment.packages = package.list;
|
environment.packages = package.list;
|
||||||
|
|
||||||
home-manager.config = {
|
home-manager.config = {
|
||||||
|
imports = [
|
||||||
|
inputs.stylix.homeManagerModules.stylix
|
||||||
|
# ../module/common/Stylix.nix
|
||||||
|
# ../module/common/Wallpaper.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
stylix = {
|
||||||
|
enable = true;
|
||||||
|
image = config.module.common.wallpaper.path;
|
||||||
|
autoEnable = false;
|
||||||
|
polarity = "dark";
|
||||||
|
opacity = {
|
||||||
|
applications = 0.85;
|
||||||
|
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 ../module/common/applefont {});
|
||||||
|
name = "SF Pro Display";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
inherit serif;
|
||||||
|
sizes = {
|
||||||
|
applications = 12;
|
||||||
|
terminal = 14;
|
||||||
|
popups = 12;
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
override = if config.module.common.wallpaper.forceContrastText then {
|
||||||
|
base04 = "000000";
|
||||||
|
base05 = "ffffff";
|
||||||
|
base06 = "ffffff";
|
||||||
|
} else {};
|
||||||
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
# Release version.
|
# Release version.
|
||||||
stateVersion = const.droidStateVersion;
|
stateVersion = const.droidStateVersion;
|
||||||
|
@ -50,6 +105,8 @@ in {
|
||||||
|
|
||||||
# Special app configuration.
|
# Special app configuration.
|
||||||
programs = {
|
programs = {
|
||||||
|
home-manager.enable = true;
|
||||||
|
|
||||||
bash = {
|
bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
bashrcExtra = bash.config + termux.initScript;
|
bashrcExtra = bash.config + termux.initScript;
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -249,18 +249,14 @@
|
||||||
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
|
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
|
||||||
modules = [
|
modules = [
|
||||||
# Android release version.
|
# Android release version.
|
||||||
{ system.stateVersion = inputs.self.const.droidStateVersion; }
|
{ system.stateVersion = self.const.droidStateVersion; }
|
||||||
|
|
||||||
# I put all my Android configuration there.
|
# I put all my Android configuration there.
|
||||||
./android
|
./android
|
||||||
./android/style/Gruvbox.nix
|
./android/Style.nix
|
||||||
|
|
||||||
# Some common modules.
|
|
||||||
./module/common/Setting.nix
|
./module/common/Setting.nix
|
||||||
# ./module/common/Style.nix
|
./module/common/Wallpaper.nix
|
||||||
|
|
||||||
# Stylix.
|
|
||||||
# inputs.stylix.homeManagerModules.stylix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# SpecialArgs allows you to pass objects down to other configuration.
|
# SpecialArgs allows you to pass objects down to other configuration.
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
{ pkgs, config, ... }: {
|
{ pkgs, config, ... }: {
|
||||||
# Add a permanent link for the wallpaper to /etc/wallpaper.
|
config.stylix = {
|
||||||
environment.etc.wallpaper.source = config.module.common.wallpaper.path;
|
|
||||||
|
|
||||||
stylix = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
image = config.module.common.wallpaper.path;
|
image = config.module.common.wallpaper.path;
|
||||||
autoEnable = true;
|
autoEnable = false;
|
||||||
polarity = "dark";
|
polarity = "dark";
|
||||||
opacity = {
|
opacity = {
|
||||||
applications = 0.85;
|
applications = 0.85;
|
||||||
|
@ -18,18 +15,20 @@
|
||||||
package = pkgs.gnome3.adwaita-icon-theme;
|
package = pkgs.gnome3.adwaita-icon-theme;
|
||||||
size = 14;
|
size = 14;
|
||||||
};
|
};
|
||||||
fonts = {
|
fonts = let
|
||||||
|
serif = {
|
||||||
|
package = (pkgs.callPackage ./applefont {});
|
||||||
|
name = "SF Pro Display";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
inherit serif;
|
||||||
sizes = {
|
sizes = {
|
||||||
applications = 12;
|
applications = 12;
|
||||||
terminal = 14;
|
terminal = 14;
|
||||||
popups = 12;
|
popups = 12;
|
||||||
desktop = 14;
|
desktop = 14;
|
||||||
};
|
};
|
||||||
serif = {
|
sansSerif = serif;
|
||||||
package = (pkgs.callPackage ./applefont {});
|
|
||||||
name = "SF Pro Display";
|
|
||||||
};
|
|
||||||
sansSerif = config.stylix.fonts.serif;
|
|
||||||
monospace = {
|
monospace = {
|
||||||
package = (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; });
|
package = (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; });
|
||||||
name = "Terminess Nerd Font Mono";
|
name = "Terminess Nerd Font Mono";
|
||||||
|
|
|
@ -4,22 +4,22 @@
|
||||||
{ lib, stdenv, fetchurl, p7zip }: let
|
{ lib, stdenv, fetchurl, p7zip }: let
|
||||||
pro = fetchurl {
|
pro = fetchurl {
|
||||||
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg";
|
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg";
|
||||||
sha256 = "sha256-Mu0pmx3OWiKBmMEYLNg+u2MxFERK07BQGe3WAhEec5Q=";
|
sha256 = "sha256-B8xljBAqOoRFXvSOkOKDDWeYUebtMmQLJ8lF05iFnXk=";
|
||||||
};
|
};
|
||||||
|
|
||||||
compact = fetchurl {
|
compact = fetchurl {
|
||||||
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg";
|
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg";
|
||||||
sha256 = "sha256-Mkf+GK4iuUhZdUdzMW0VUOmXcXcISejhMeZVm0uaRwY=";
|
sha256 = "sha256-L4oLQ34Epw1/wLehU9sXQwUe/LaeKjHRxQAF6u2pfTo=";
|
||||||
};
|
};
|
||||||
|
|
||||||
mono = fetchurl {
|
mono = fetchurl {
|
||||||
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg";
|
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg";
|
||||||
sha256 = "sha256-tZHV6g427zqYzrNf3wCwiCh5Vjo8PAai9uEvayYPsjM=";
|
sha256 = "sha256-Uarx1TKO7g5yVBXAx6Yki065rz/wRuYiHPzzi6cTTl8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
ny = fetchurl {
|
ny = fetchurl {
|
||||||
url = "https://devimages-cdn.apple.com/design/resources/download/NY.dmg";
|
url = "https://devimages-cdn.apple.com/design/resources/download/NY.dmg";
|
||||||
sha256 = "sha256-tn1QLCSjgo5q4PwE/we80pJavr3nHVgFWrZ8cp29qBk=";
|
sha256 = "sha256-yYyqkox2x9nQ842laXCqA3UwOpUGyIfUuprX975OsLA=";
|
||||||
};
|
};
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "applefont";
|
name = "applefont";
|
||||||
|
|
Loading…
Reference in a new issue