rework modules

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-06-19 10:22:49 +03:00
parent 422b0551db
commit f3bf120805
15 changed files with 38 additions and 41 deletions

View File

@ -32,10 +32,11 @@
enable = true; enable = true;
theme = "vesper"; theme = "vesper";
}; };
}; locale = "uk_UA.UTF-8";
misc = {
locale.ukrainian.enable = true;
opentabletdriver.enable = false; opentabletdriver.enable = false;
qmk-vial.enable = true; qmk-vial.enable = true;
virtual.libvirt.enable = true; };
virt.libvirt.enable = true;
};
} }

View File

@ -40,12 +40,11 @@
}; };
stylix = { stylix = {
enable = true; enable = true;
theme = "gruvbox-dark-pale"; theme = "vesper";
}; };
}; locale = "uk_UA.UTF-8";
misc = {
locale.ukrainian.enable = true;
opentabletdriver.enable = false;
qmk-vial.enable = true; qmk-vial.enable = true;
virtual.libvirt.enable = false; };
};
} }

View File

@ -35,8 +35,7 @@
enable = true; enable = true;
theme = "gruvbox-dark-pale"; theme = "gruvbox-dark-pale";
}; };
locale = "uk_UA.UTF-8";
virt.libvirt.enable = true;
}; };
locale.ukrainian.enable = true;
virtual.libvirt.enable = true;
} }

View File

@ -42,8 +42,6 @@
enable = true; enable = true;
theme = "vesper"; theme = "vesper";
}; };
locale = "uk_UA.UTF-8";
}; };
locale.ukrainian.enable = true;
opentabletdriver.enable = false;
} }

View File

@ -47,10 +47,8 @@
enable = true; enable = true;
theme = "gruvbox-dark-pale"; theme = "gruvbox-dark-pale";
}; };
locale = "uk_UA.UTF-8";
misc.qmk-vial.enable = true;
virt.libvirt.enable = true;
}; };
locale.ukrainian.enable = true;
opentabletdriver.enable = false;
qmk-vial.enable = true;
virtual.libvirt.enable = true;
} }

View File

@ -1,7 +1,9 @@
{ {
imports = [ imports = [
./common.nix ./common.nix
./locale.nix
./misc ./misc
./virtual ./stylix
./virt
]; ];
} }

View File

@ -3,16 +3,18 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf mkEnableOption; inherit (lib) types mkOption;
cfg = config.locale.ukrainian;
in { in {
options = { options = {
locale.ukrainian.enable = module.locale = mkOption {
mkEnableOption "enables ukrainian locale"; type = types.strMatching "[a-z]{2}_[A-Z]{2}\\.UTF-8";
default = "en_US.UTF-8";
description = "set locale";
}; };
config = mkIf cfg.enable { };
config = {
i18n = let i18n = let
locale = "uk_UA.UTF-8"; inherit (config.module) locale;
in { in {
defaultLocale = locale; defaultLocale = locale;
extraLocaleSettings = { extraLocaleSettings = {

View File

@ -1,8 +1,6 @@
{ {
imports = [ imports = [
./locale.nix
./opentabletdriver.nix ./opentabletdriver.nix
./qmk-vial.nix ./qmk-vial.nix
./stylix
]; ];
} }

View File

@ -6,10 +6,10 @@
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
in { in {
options = { options = {
opentabletdriver.enable = module.misc.opentabletdriver.enable =
mkEnableOption "enables opentabletdriver"; mkEnableOption "enables opentabletdriver";
}; };
config = mkIf config.opentabletdriver.enable { config = mkIf config.module.misc.opentabletdriver.enable {
hardware.opentabletdriver = { hardware.opentabletdriver = {
enable = true; enable = true;
daemon.enable = true; daemon.enable = true;

View File

@ -6,10 +6,10 @@
inherit (lib) mkIf mkEnableOption; inherit (lib) mkIf mkEnableOption;
in { in {
options = { options = {
qmk-vial.enable = module.misc.qmk-vial.enable =
mkEnableOption "adds a udev rule for vial keyboards"; mkEnableOption "adds a udev rule for vial keyboards";
}; };
config = mkIf config.qmk-vial.enable { config = mkIf config.module.misc.qmk-vial.enable {
services.udev.extraRules = '' services.udev.extraRules = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
''; '';

View File

@ -5,10 +5,10 @@
... ...
}: }:
with lib; let with lib; let
cfg = config.virtual.docker; cfg = config.module.virt.docker;
in { in {
options = { options = {
virtual.docker.enable = module.virt.docker.enable =
mkEnableOption "enable docker"; mkEnableOption "enable docker";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View File

@ -5,10 +5,10 @@
... ...
}: }:
with lib; let with lib; let
cfg = config.virtual.libvirt; cfg = config.module.virt.libvirt;
in { in {
options = { options = {
virtual.libvirt.enable = module.virt.libvirt.enable =
mkEnableOption "enables virtualisation"; mkEnableOption "enables virtualisation";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View File

@ -5,10 +5,10 @@
... ...
}: }:
with lib; let with lib; let
cfg = config.virtual.podman; cfg = config.module.virt.podman;
in { in {
options = { options = {
virtual.podman.enable = module.virt.podman.enable =
mkEnableOption "enables podman"; mkEnableOption "enables podman";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {