Split modules to option and config.

This commit is contained in:
Dmitry Voronin 2024-11-16 04:43:59 +03:00
parent d1095f4252
commit ee98cdf6f0
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
74 changed files with 429 additions and 325 deletions

View file

@ -6,8 +6,6 @@
}: let
cfg = config.module.amd.compute;
in {
options.module.amd.compute.enable = lib.mkEnableOption "the AMD Rocm support i.e. for Blender.";
config = lib.mkIf cfg.enable {
nixpkgs.config.rocmSupport = true;
systemd.tmpfiles.rules = [ "L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}" ];

View file

@ -1,7 +1,6 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.module.amd.cpu;
@ -10,11 +9,6 @@
disableCmd = "1";
enableCmd = "0";
in {
options.module.amd.cpu = {
enable = lib.mkEnableOption "the AMD Cpu support.";
powersave = lib.mkEnableOption "the AMD Cpu powersave.";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
boot.kernelModules = [ "kvm-amd" ];

View file

@ -1,13 +1,10 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.module.amd.gpu;
in {
options.module.amd.gpu.enable = lib.mkEnableOption "the AMD Gpu support.";
config = lib.mkIf cfg.enable {
environment.variables.AMD_VULKAN_ICD = "RADV";
boot.initrd.kernelModules = [

View file

@ -13,10 +13,6 @@
}: let
cfg = config.module.autoupdate;
in {
options.module.autoupdate = {
enable = lib.mkEnableOption "the system auto-updates.";
};
config = lib.mkIf cfg.enable {
programs.git = {
enable = true;

View file

@ -5,8 +5,6 @@
}: let
cfg = config.module.bluetooth;
in {
options.module.bluetooth.enable = lib.mkEnableOption "the bluetooth support.";
config = lib.mkIf cfg.enable {
services.blueman.enable = true;
hardware.bluetooth = {

View file

@ -5,8 +5,6 @@
}: let
cfg = config.module.brightness;
in {
options.module.brightness.enable = lib.mkEnableOption "the brightness control.";
config = lib.mkIf cfg.enable {
programs.light.enable = true;
};

View file

@ -5,8 +5,6 @@
}: let
cfg = config.module.dm;
in {
options.module.dm.enable = lib.mkEnableOption "the display manager.";
config = lib.mkIf cfg.enable {
services.xserver = {
enable = true;

View file

@ -6,10 +6,6 @@
}: let
cfg = config.module.distrobox;
in {
options.module.distrobox = {
enable = lib.mkEnableOption "the distrobox.";
};
config = lib.mkIf cfg.enable {
# Distrobox works best with Podman, so enable it here.
module.podman.enable = true;

View file

@ -5,18 +5,6 @@
}: let
cfg = config.module.docker;
in {
options.module.docker = {
enable = lib.mkEnableOption "the docker.";
rootless = lib.mkOption {
default = false;
type = lib.types.bool;
};
autostart = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
virtualisation.docker.enable = true;

View file

@ -1,21 +1,11 @@
{
config,
lib,
pkgs,
util,
...
}: let
cfg = config.module.ftpd;
in
{
options.module.ftpd = {
enable = lib.mkEnableOption "the FTP server";
storage = lib.mkOption {
default = null;
type = lib.types.str;
};
};
in {
config = lib.mkIf cfg.enable {
services.vsftpd = {
enable = true;

View file

@ -7,8 +7,6 @@
}: let
cfg = config.module.gnome;
in {
options.module.gnome.enable = lib.mkEnableOption "the Gnome DE.";
config = lib.mkIf cfg.enable {
module = {
dm.enable = true;

View file

@ -2,7 +2,6 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.module.intel.cpu;
@ -11,11 +10,6 @@
disableCmd = "0";
enableCmd = "1";
in {
options.module.intel.cpu = {
enable = lib.mkEnableOption "the support for Intel CPUs";
powersave = lib.mkEnableOption "the Intel CPU powersave.";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
boot.kernelModules = [

View file

@ -1,28 +1,11 @@
{
config,
lib,
pkgs,
pkgsUnstable,
...
}: let
cfg = config.module.kernel;
in {
options.module.kernel = {
enable = lib.mkEnableOption "the kernel tweaks.";
hardening = lib.mkOption {
default = false;
type = lib.types.bool;
};
hotspotTtlBypass = lib.mkOption {
default = false;
type = lib.types.bool;
};
latest = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{
boot.kernel.sysctl = {

View file

@ -6,10 +6,6 @@
}: let
cfg = config.module.keyd;
in {
options.module.keyd = {
enable = lib.mkEnableOption "the keyboard remaps.";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
keyd

View file

@ -8,18 +8,6 @@
}: let
cfg = config.module.ollama;
in {
options.module.ollama = {
enable = lib.mkEnableOption "the local LLM server.";
models = lib.mkOption {
default = [ cfg.primaryModel ];
type = with lib.types; listOf str;
};
primaryModel = lib.mkOption {
default = "llama3.2";
type = lib.types.str;
};
};
config = lib.mkIf cfg.enable {
# Specify default model.
environment.variables.OLLAMA_MODEL = cfg.primaryModel;

View file

@ -8,16 +8,6 @@
cfg = config.module.package;
package = import <package> args;
in {
options.module.package = {
common.enable = lib.mkEnableOption "Common Apps.";
core.enable = lib.mkEnableOption "Core apps.";
creative.enable = lib.mkEnableOption "Creative Apps.";
desktop.enable = lib.mkEnableOption "Desktop Apps.";
dev.enable = lib.mkEnableOption "Dev Apps.";
extra.enable = lib.mkEnableOption "Extra Apps.";
gaming.enable = lib.mkEnableOption "Gaming Apps.";
};
config = lib.mkMerge [
# Core apps.
(lib.mkIf cfg.core.enable {

View file

@ -5,10 +5,6 @@
}: let
cfg = config.module.podman;
in {
options.module.podman = {
enable = lib.mkEnableOption "the OCI Podman.";
};
config = lib.mkIf cfg.enable {
virtualisation.podman = {
enable = true;

View file

@ -7,8 +7,6 @@
}: let
cfg = config.module.polkit;
in {
options.module.polkit.enable = lib.mkEnableOption "the polkit.";
config = lib.mkIf cfg.enable {
security.polkit.enable = true;
systemd = {

View file

@ -7,8 +7,6 @@
}: let
cfg = config.module.portal;
in {
options.module.portal.enable = lib.mkEnableOption "the portals.";
config = lib.mkIf cfg.enable {
xdg.portal = {
enable = true;

View file

@ -39,26 +39,6 @@
''${@}
'');
in {
options.module.powerlimit.thinkpad = {
enable = lib.mkEnableOption "the powerlimit service";
onMin = lib.mkOption {
default = 40;
type = lib.types.int;
};
onMax = lib.mkOption {
default = 80;
type = lib.types.int;
};
offMin = lib.mkOption {
default = 90;
type = lib.types.int;
};
offMax = lib.mkOption {
default = 95;
type = lib.types.int;
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
script

View file

@ -33,24 +33,6 @@
''${@}
'');
in {
options.module.powersave = {
enable = lib.mkEnableOption "the powersave";
cpu.boost = {
disableCmd = lib.mkOption {
default = null;
type = lib.types.str;
};
enableCmd = lib.mkOption {
default = null;
type = lib.types.str;
};
controlFile = lib.mkOption {
default = null;
type = lib.types.str;
};
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [
script

View file

@ -1,14 +1,11 @@
{
config,
lib,
pkgs,
util,
...
}: let
cfg = config.module.print;
in {
options.module.print.enable = lib.mkEnableOption "the support for printers.";
config = lib.mkIf cfg.enable {
services.printing = {
enable = true;

View file

@ -6,8 +6,6 @@
}: let
cfg = config.module.realtime;
in {
options.module.realtime.enable = lib.mkEnableOption "the realtime access.";
config = lib.mkIf cfg.enable {
security.pam.loginLimits = [{
domain = "@users";

View file

@ -9,11 +9,6 @@
serverKeyPath = "/root/.nixbuilder";
serverSshPublicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFqr7zKGOy/2bbAQCD85Ol+NoGGtvdMbSy3jGb98jM+f"; # Use ssh-keyscan.
in {
options.module.builder = {
server.enable = lib.mkEnableOption "the builder server.";
client.enable = lib.mkEnableOption "the builder client.";
};
config = lib.mkMerge [
(lib.mkIf cfg.server.enable {
# Service that generates new key on boot if not present.

View file

@ -5,8 +5,6 @@
}: let
cfg = config.module.sound;
in {
options.module.sound.enable = lib.mkEnableOption "the sound.";
config = lib.mkIf cfg.enable {
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;

View file

@ -6,14 +6,6 @@
}: let
cfg = config.module.sway;
in {
options.module.sway = {
enable = lib.mkEnableOption "the Sway WM.";
extraConfig = lib.mkOption {
default = "";
type = lib.types.str;
};
};
config = lib.mkIf cfg.enable {
services.gnome.gnome-keyring.enable = lib.mkForce false;
environment.variables.XDG_CURRENT_DESKTOP = "sway";

View file

@ -5,8 +5,6 @@
}: let
cfg = config.module.tablet;
in {
options.module.tablet.enable = lib.mkEnableOption "the support for tables.";
config = lib.mkIf cfg.enable {
hardware.opentabletdriver.enable = true;
systemd.user.services.opentabletdriver.wantedBy = [

View file

@ -6,8 +6,6 @@
}: let
cfg = config.module.virtmanager;
in {
options.module.virtmanager.enable = lib.mkEnableOption "the VM support.";
config = lib.mkIf cfg.enable {
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;

View file

@ -6,8 +6,6 @@
}: let
cfg = config.module.waybar;
in {
options.module.waybar.enable = lib.mkEnableOption "the Waybar.";
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
waybar

View file

@ -1,13 +1,10 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.module.wayland;
in {
options.module.wayland.enable = lib.mkEnableOption "the wayland.";
config = {
programs.xwayland.enable = true;
environment = {

View file

@ -70,7 +70,7 @@
);
devShells = let
lib = nixpkgs.lib;
# lib = nixpkgs.lib;
pkgs = nixpkgs.legacyPackages.${system};
system = "x86_64-linux";
in {
@ -106,7 +106,8 @@
]
++ (self.findFiles ./container)
++ (self.findFiles ./host/${system}/${hostname})
++ (self.findFiles ./module)
++ (self.findFiles ./option)
++ (self.findFiles ./config)
++ (self.findFiles ./overlay)
++ (self.findFiles ./system)
;
@ -134,7 +135,7 @@
);
nixOnDroidConfigurations.default = let
config = self.nixOnDroidConfigurations.default.config;
# config = self.nixOnDroidConfigurations.default.config;
lib = nixpkgs.lib;
pkgs = nixpkgs.legacyPackages.${system}.pkgs;
pkgsMaster = nixpkgsMaster.legacyPackages.${system}.pkgs;
@ -143,12 +144,13 @@
in nix-on-droid.lib.nixOnDroidConfiguration {
inherit pkgs;
modules = [
(import ./module/Style.nix { inherit (config.home-manager) config; inherit (self) __findFile; inherit lib pkgs; })
{ home.android.enable = true; }
{ home-manager.config.stylix.autoEnable = lib.mkForce false; }
./home/Android.nix
./module/Wallpaper.nix
];
]
++ (self.findFiles ./option)
++ (self.findFiles ./overlay)
;
extraSpecialArgs = {
inherit inputs self pkgsMaster pkgsUnstable;
inherit (self) const __findFile;

View file

@ -4,7 +4,7 @@
...
}: let
borderSize = toString config.module.style.window.border;
dpiAware = if (config.module.dpi.aware or false) then "yes" else "no";
dpiAware = if config.module.dpi.aware then "yes" else "no";
fontStep = 1;
in {
file = (pkgs.formats.iniWithGlobalSection { }).generate "FootConfig" {

View file

@ -3,7 +3,7 @@
config,
...
}: let
dpiAware = if (config.module.dpi.aware or false) then "yes" else "no";
dpiAware = if config.module.dpi.aware then "yes" else "no";
in {
file = (pkgs.formats.ini { }).generate "FuzzelConfig" {
main = {

View file

@ -4,7 +4,7 @@
}: {
text = ''
require("gen").setup {
model = "${config.module.ollama.primaryModel or ""}"
model = "${config.module.ollama.primaryModel}"
}
'';
}

View file

@ -32,6 +32,6 @@ in {
include /etc/sway/config.d/*
'')
+ swayRc
+ config.module.sway.extraConfig or ""
+ config.module.sway.extraConfig
;
}

View file

@ -36,8 +36,8 @@
}
input type:keyboard {
xkb_layout ${config.module.keyboard.layouts or ""}
xkb_options ${config.module.keyboard.options or ""}
xkb_layout ${config.module.keyboard.layouts}
xkb_options ${config.module.keyboard.options}
}
# Hide mouse cursor after a period of inactivity.

View file

@ -146,8 +146,8 @@ in {
temperature = {
critical-threshold = 80;
format = "{temperatureC}°C";
hwmon-path-abs = "${config.module.hwmon.path or ""}";
input-filename = "${config.module.hwmon.file or ""}";
hwmon-path-abs = "${config.module.hwmon.path}";
input-filename = "${config.module.hwmon.file}";
interval = refreshInterval;
on-click = "foot -e bash -c btop";
on-click-right = "powersave toggle";

View file

@ -1,14 +0,0 @@
{
config,
lib,
...
}: let
cfg = config.module.dpi;
in {
options.module.dpi = {
aware = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
}

View file

@ -1,115 +0,0 @@
{
__findFile,
config,
lib,
pkgs,
...
}: let
cfg = config.module.style;
mkTypeOption = default: type: lib.mkOption { inherit default type; };
mkFloatOption = default: mkTypeOption default lib.types.float;
mkIntOption = default: mkTypeOption default lib.types.int;
mkPkgOption = default: mkTypeOption default lib.types.package;
mkStrOption = default: mkTypeOption default lib.types.str;
in {
options.module.style = {
color = {
accent = mkStrOption config.lib.stylix.colors.base0A;
heading = mkStrOption config.lib.stylix.colors.base0D;
hl = mkStrOption config.lib.stylix.colors.base03;
keyword = mkStrOption config.lib.stylix.colors.base0E;
link = mkStrOption config.lib.stylix.colors.base09;
misc = mkStrOption config.lib.stylix.colors.base0F;
negative = mkStrOption config.lib.stylix.colors.base08;
neutral = mkStrOption config.lib.stylix.colors.base0C;
positive = mkStrOption config.lib.stylix.colors.base0B;
selection = mkStrOption config.lib.stylix.colors.base02;
bg = {
dark = mkStrOption config.lib.stylix.colors.base00;
light = mkStrOption config.lib.stylix.colors.base07;
regular = mkStrOption config.lib.stylix.colors.base01;
};
fg = {
dark = mkStrOption config.lib.stylix.colors.base04;
light = mkStrOption config.lib.stylix.colors.base06;
regular = mkStrOption config.lib.stylix.colors.base05;
};
accent-r = mkStrOption config.lib.stylix.colors.base0A-rgb-r;
accent-g = mkStrOption config.lib.stylix.colors.base0A-rgb-g;
accent-b = mkStrOption config.lib.stylix.colors.base0A-rgb-b;
bg-r = mkStrOption config.lib.stylix.colors.base00-rgb-r;
bg-g = mkStrOption config.lib.stylix.colors.base00-rgb-g;
bg-b = mkStrOption config.lib.stylix.colors.base00-rgb-b;
border = mkStrOption config.lib.stylix.colors.base01;
border-r = mkStrOption config.lib.stylix.colors.base01-rgb-r;
border-g = mkStrOption config.lib.stylix.colors.base01-rgb-g;
border-b = mkStrOption config.lib.stylix.colors.base01-rgb-b;
fg-r = mkStrOption config.lib.stylix.colors.base06-rgb-r;
fg-g = mkStrOption config.lib.stylix.colors.base06-rgb-g;
fg-b = mkStrOption config.lib.stylix.colors.base06-rgb-b;
negative-r = mkStrOption config.lib.stylix.colors.base08-rgb-r;
negative-g = mkStrOption config.lib.stylix.colors.base08-rgb-g;
negative-b = mkStrOption config.lib.stylix.colors.base08-rgb-b;
neutral-r = mkStrOption config.lib.stylix.colors.base0C-rgb-r;
neutral-g = mkStrOption config.lib.stylix.colors.base0C-rgb-g;
neutral-b = mkStrOption config.lib.stylix.colors.base0C-rgb-b;
positive-r = mkStrOption config.lib.stylix.colors.base0B-rgb-r;
positive-g = mkStrOption config.lib.stylix.colors.base0B-rgb-g;
positive-b = mkStrOption config.lib.stylix.colors.base0B-rgb-b;
transparent = mkStrOption "ffffff00";
};
cursor = {
name = mkStrOption "phinger-cursors-light";
package = mkPkgOption pkgs.phinger-cursors;
size = mkIntOption 24;
};
font = {
emoji = {
name = mkStrOption "Noto Color Emoji";
package = mkPkgOption pkgs.noto-fonts-emoji;
};
monospace = {
name = mkStrOption "Terminess Nerd Font Mono";
package = mkPkgOption (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; });
};
sansSerif = {
name = mkStrOption "SF Pro Display";
package = mkPkgOption (pkgs.callPackage <package/applefont> { });
};
serif = {
name = mkStrOption "SF Pro Display";
package = mkPkgOption (pkgs.callPackage <package/applefont> { });
};
size = {
application = mkIntOption 12;
desktop = mkIntOption 14;
popup = mkIntOption 12;
terminal = mkIntOption 14;
};
};
opacity = {
application = mkFloatOption 0.85;
desktop = mkFloatOption 0.85;
hex = mkStrOption "D9";
popup = mkFloatOption 0.85;
terminal = mkFloatOption 0.85;
};
window = {
border = mkIntOption 4;
gap = mkIntOption 8;
};
};
}

6
option/AmdCompute.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.amd.compute.enable = lib.mkEnableOption "the AMD Rocm support i.e. for Blender.";
}

9
option/AmdCpu.nix Normal file
View file

@ -0,0 +1,9 @@
{
lib,
...
}: {
options.module.amd.cpu = {
enable = lib.mkEnableOption "the AMD Cpu support.";
powersave = lib.mkEnableOption "the AMD Cpu powersave.";
};
}

6
option/AmdGpu.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.amd.gpu.enable = lib.mkEnableOption "the AMD Gpu support.";
}

View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.autoupdate.enable = lib.mkEnableOption "the system auto-updates.";
}

6
option/Bluetooth.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.bluetooth.enable = lib.mkEnableOption "the bluetooth support.";
}

6
option/Brightness.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.brightness.enable = lib.mkEnableOption "the brightness control.";
}

View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.dm.enable = lib.mkEnableOption "the display manager.";
}

6
option/Distrobox.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.distrobox.enable = lib.mkEnableOption "the distrobox.";
}

16
option/Docker.nix Normal file
View file

@ -0,0 +1,16 @@
{
lib,
...
}: {
options.module.docker = {
enable = lib.mkEnableOption "the docker.";
rootless = lib.mkOption {
default = false;
type = lib.types.bool;
};
autostart = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
}

10
option/Dpi.nix Normal file
View file

@ -0,0 +1,10 @@
# Screen density configuration.
{
lib,
...
}: {
options.module.dpi.aware = lib.mkOption {
default = false;
type = lib.types.bool;
};
}

12
option/Ftpd.nix Normal file
View file

@ -0,0 +1,12 @@
{
lib,
...
}: {
options.module.ftpd = {
enable = lib.mkEnableOption "the FTP server";
storage = lib.mkOption {
default = null;
type = lib.types.str;
};
};
}

6
option/Gnome.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.gnome.enable = lib.mkEnableOption "the Gnome DE.";
}

View file

@ -1,10 +1,8 @@
# Hardware monitor configuration.
{
config,
lib,
...
}: let
cfg = config.module.hwmon;
in {
}: {
options.module.hwmon = {
path = lib.mkOption {
default = "";

9
option/IntelCpu.nix Normal file
View file

@ -0,0 +1,9 @@
{
lib,
...
}: {
options.module.intel.cpu = {
enable = lib.mkEnableOption "the support for Intel CPUs.";
powersave = lib.mkEnableOption "the Intel CPU powersave.";
};
}

20
option/Kernel.nix Normal file
View file

@ -0,0 +1,20 @@
{
lib,
...
}: {
options.module.kernel = {
enable = lib.mkEnableOption "the kernel tweaks.";
hardening = lib.mkOption {
default = false;
type = lib.types.bool;
};
hotspotTtlBypass = lib.mkOption {
default = false;
type = lib.types.bool;
};
latest = lib.mkOption {
default = false;
type = lib.types.bool;
};
};
}

View file

@ -1,10 +1,8 @@
# Keyboard configuration.
{
config,
lib,
...
}: let
cfg = config.module.keyboard;
in {
}: {
options.module.keyboard = {
layouts = lib.mkOption {
default = "us,ru";

6
option/Keyd.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.keyd.enable = lib.mkEnableOption "the keyboard remaps.";
}

19
option/Ollama.nix Normal file
View file

@ -0,0 +1,19 @@
{
config,
lib,
...
}: let
cfg = config.module.ollama;
in {
options.module.ollama = {
enable = lib.mkEnableOption "the local LLM server.";
models = lib.mkOption {
default = [ cfg.primaryModel ];
type = with lib.types; listOf str;
};
primaryModel = lib.mkOption {
default = "llama3.2";
type = lib.types.str;
};
};
}

14
option/Package.nix Normal file
View file

@ -0,0 +1,14 @@
{
lib,
...
}: {
options.module.package = {
common.enable = lib.mkEnableOption "Common Apps.";
core.enable = lib.mkEnableOption "Core apps.";
creative.enable = lib.mkEnableOption "Creative Apps.";
desktop.enable = lib.mkEnableOption "Desktop Apps.";
dev.enable = lib.mkEnableOption "Dev Apps.";
extra.enable = lib.mkEnableOption "Extra Apps.";
gaming.enable = lib.mkEnableOption "Gaming Apps.";
};
}

6
option/Podman.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.podman.enable = lib.mkEnableOption "the OCI Podman.";
}

6
option/Polkit.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.polkit.enable = lib.mkEnableOption "the polkit.";
}

6
option/Portal.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.portal.enable = lib.mkEnableOption "the portals.";
}

View file

@ -0,0 +1,24 @@
{
lib,
...
}: {
options.module.powerlimit.thinkpad = {
enable = lib.mkEnableOption "the powerlimit service";
onMin = lib.mkOption {
default = 40;
type = lib.types.int;
};
onMax = lib.mkOption {
default = 80;
type = lib.types.int;
};
offMin = lib.mkOption {
default = 90;
type = lib.types.int;
};
offMax = lib.mkOption {
default = 95;
type = lib.types.int;
};
};
}

22
option/Powersave.nix Normal file
View file

@ -0,0 +1,22 @@
{
lib,
...
}: {
options.module.powersave = {
enable = lib.mkEnableOption "the powersave";
cpu.boost = {
disableCmd = lib.mkOption {
default = null;
type = lib.types.str;
};
enableCmd = lib.mkOption {
default = null;
type = lib.types.str;
};
controlFile = lib.mkOption {
default = null;
type = lib.types.str;
};
};
};
}

6
option/Print.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.print.enable = lib.mkEnableOption "the support for printers.";
}

6
option/Realtime.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.realtime.enable = lib.mkEnableOption "the realtime access.";
}

9
option/RemoteBuild.nix Normal file
View file

@ -0,0 +1,9 @@
{
lib,
...
}: {
options.module.builder = {
server.enable = lib.mkEnableOption "the builder server.";
client.enable = lib.mkEnableOption "the builder client.";
};
}

6
option/Sound.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.sound.enable = lib.mkEnableOption "the sound.";
}

117
option/Style.nix Normal file
View file

@ -0,0 +1,117 @@
# Styling like colors, fonts, cursor etc.
{
__findFile,
config,
lib,
pkgs,
...
}: let
cfg = config.module.style;
stylix = config.lib.stylix or config.home-manager.config.lib.stylix;
mkTypeOption = default: type: lib.mkOption { inherit default type; };
mkFloatOption = default: mkTypeOption default lib.types.float;
mkIntOption = default: mkTypeOption default lib.types.int;
mkPkgOption = default: mkTypeOption default lib.types.package;
mkStrOption = default: mkTypeOption default lib.types.str;
in {
options.module.style = {
color = {
accent = mkStrOption stylix.colors.base0A;
heading = mkStrOption stylix.colors.base0D;
hl = mkStrOption stylix.colors.base03;
keyword = mkStrOption stylix.colors.base0E;
link = mkStrOption stylix.colors.base09;
misc = mkStrOption stylix.colors.base0F;
negative = mkStrOption stylix.colors.base08;
neutral = mkStrOption stylix.colors.base0C;
positive = mkStrOption stylix.colors.base0B;
selection = mkStrOption stylix.colors.base02;
bg = {
dark = mkStrOption stylix.colors.base00;
light = mkStrOption stylix.colors.base07;
regular = mkStrOption stylix.colors.base01;
};
fg = {
dark = mkStrOption stylix.colors.base04;
light = mkStrOption stylix.colors.base06;
regular = mkStrOption stylix.colors.base05;
};
accent-r = mkStrOption stylix.colors.base0A-rgb-r;
accent-g = mkStrOption stylix.colors.base0A-rgb-g;
accent-b = mkStrOption stylix.colors.base0A-rgb-b;
bg-r = mkStrOption stylix.colors.base00-rgb-r;
bg-g = mkStrOption stylix.colors.base00-rgb-g;
bg-b = mkStrOption stylix.colors.base00-rgb-b;
border = mkStrOption stylix.colors.base01;
border-r = mkStrOption stylix.colors.base01-rgb-r;
border-g = mkStrOption stylix.colors.base01-rgb-g;
border-b = mkStrOption stylix.colors.base01-rgb-b;
fg-r = mkStrOption stylix.colors.base06-rgb-r;
fg-g = mkStrOption stylix.colors.base06-rgb-g;
fg-b = mkStrOption stylix.colors.base06-rgb-b;
negative-r = mkStrOption stylix.colors.base08-rgb-r;
negative-g = mkStrOption stylix.colors.base08-rgb-g;
negative-b = mkStrOption stylix.colors.base08-rgb-b;
neutral-r = mkStrOption stylix.colors.base0C-rgb-r;
neutral-g = mkStrOption stylix.colors.base0C-rgb-g;
neutral-b = mkStrOption stylix.colors.base0C-rgb-b;
positive-r = mkStrOption stylix.colors.base0B-rgb-r;
positive-g = mkStrOption stylix.colors.base0B-rgb-g;
positive-b = mkStrOption stylix.colors.base0B-rgb-b;
transparent = mkStrOption "ffffff00";
};
cursor = {
name = mkStrOption "phinger-cursors-light";
package = mkPkgOption pkgs.phinger-cursors;
size = mkIntOption 24;
};
font = {
emoji = {
name = mkStrOption "Noto Color Emoji";
package = mkPkgOption pkgs.noto-fonts-emoji;
};
monospace = {
name = mkStrOption "Terminess Nerd Font Mono";
package = mkPkgOption (pkgs.nerdfonts.override { fonts = [ "Terminus" ]; });
};
sansSerif = {
name = mkStrOption "SF Pro Display";
package = mkPkgOption (pkgs.callPackage <package/applefont> { });
};
serif = {
name = mkStrOption "SF Pro Display";
package = mkPkgOption (pkgs.callPackage <package/applefont> { });
};
size = {
application = mkIntOption 12;
desktop = mkIntOption 14;
popup = mkIntOption 12;
terminal = mkIntOption 14;
};
};
opacity = {
application = mkFloatOption 0.85;
desktop = mkFloatOption 0.85;
hex = mkStrOption "D9";
popup = mkFloatOption 0.85;
terminal = mkFloatOption 0.85;
};
window = {
border = mkIntOption 4;
gap = mkIntOption 8;
};
};
}

12
option/Sway.nix Normal file
View file

@ -0,0 +1,12 @@
{
lib,
...
}: {
options.module.sway = {
enable = lib.mkEnableOption "the Sway WM.";
extraConfig = lib.mkOption {
default = "";
type = lib.types.str;
};
};
}

6
option/Tablet.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.tablet.enable = lib.mkEnableOption "the support for tables.";
}

6
option/VirtManager.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.virtmanager.enable = lib.mkEnableOption "the VM support.";
}

View file

@ -1,3 +1,4 @@
# Download the wallpaper here.
{
pkgs,
lib,

6
option/Waybar.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.waybar.enable = lib.mkEnableOption "the Waybar.";
}

6
option/Wayland.nix Normal file
View file

@ -0,0 +1,6 @@
{
lib,
...
}: {
options.module.wayland.enable = lib.mkEnableOption "the wayland.";
}