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;
theme = "vesper";
};
locale = "uk_UA.UTF-8";
misc = {
opentabletdriver.enable = false;
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

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

View File

@ -35,8 +35,7 @@
enable = true;
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;
theme = "vesper";
};
locale = "uk_UA.UTF-8";
};
locale.ukrainian.enable = true;
opentabletdriver.enable = false;
}

View File

@ -47,10 +47,8 @@
enable = true;
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 = [
./common.nix
./locale.nix
./misc
./virtual
./stylix
./virt
];
}

View File

@ -3,16 +3,18 @@
lib,
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.locale.ukrainian;
inherit (lib) types mkOption;
in {
options = {
locale.ukrainian.enable =
mkEnableOption "enables ukrainian locale";
module.locale = mkOption {
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
locale = "uk_UA.UTF-8";
inherit (config.module) locale;
in {
defaultLocale = locale;
extraLocaleSettings = {

View File

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

View File

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

View File

@ -6,10 +6,10 @@
inherit (lib) mkIf mkEnableOption;
in {
options = {
qmk-vial.enable =
module.misc.qmk-vial.enable =
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 = ''
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
'';

View File

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

View File

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

View File

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