WIP: refactor

This commit is contained in:
2025-05-31 13:45:20 -07:00
parent 5116dd160d
commit f3aaac2f4d
13 changed files with 270 additions and 391 deletions

5
modules/opts/default.nix Normal file
View File

@@ -0,0 +1,5 @@
{ ... }: {
imports = [
./kb-input
];
}

View File

@@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
let
cfg = config.opts.desktop;
in
{
options = {
opts.desktop = {
enable = lib.mkEnableOption "desktop environment";
pipewire.enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable pipewire for audio and screen sharing support";
};
};
};
}

View File

@@ -0,0 +1,52 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.opts.kb-input;
in {
options = {
opts.kb-input = {
enable = lib.mkEnableOption "input method and custom keyboard layout";
enableMinimak = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable Minimak keyboard layout";
};
enableFcitx = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable Fcitx5 input method";
};
};
};
config = lib.mkIf cfg.enable {
services.xserver.xkb.extraLayouts = lib.mkIf cfg.enableMinimak {
minimak-4 = {
description = "English (US, Minimak-4)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
minimak-8 = {
description = "English (US, Minimak-8)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
minimak-12 = {
description = "English (US, Minimak-12)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
};
i18n.inputMethod = lib.mkIf cfg.enableFcitx {
enable = true;
type = "fcitx5";
fcitx5.waylandFrontend = true;
fcitx5.plasma6Support = true;
fcitx5.addons = [ pkgs.fcitx5-mozc ];
};
};
}

View File

@@ -0,0 +1,70 @@
partial default alphanumeric_keys
xkb_symbols "minimak-4" {
// Describes the differences between a basic US keyboard layout and
// Minimak-4
include "us(basic)"
name[Group1]="English (US, Minimak-4)";
key <AD03> { [ d, D ] };
key <AD05> { [ k, K ] };
key <AC03> { [ t, T ] };
key <AC08> { [ e, E ] };
include "level3(ralt_switch_multikey)"
};
partial default alphanumeric_keys
xkb_symbols "minimak-8" {
// Describes the differences between a basic US keyboard layout and
// Minimak-8
include "us(basic)"
name[Group1]="English (US, Minimak-8)";
key <AD03> { [ d, D ] };
key <AD05> { [ k, K ] };
key <AD09> { [ l, L ] };
key <AC03> { [ t, T ] };
key <AC07> { [ n, N ] };
key <AC08> { [ e, E ] };
key <AC09> { [ o, O ] };
key <AB06> { [ j, J ] };
include "level3(ralt_switch_multikey)"
};
partial default alphanumeric_keys
xkb_symbols "minimak-12" {
// Describes the differences between a basic US keyboard layout and
// Minimak-12
include "us(basic)"
name[Group1]="English (US, Minimak-12)";
key <AD03> { [ d, D ] };
key <AD04> { [ f, F ] };
key <AD05> { [ k, K ] };
key <AD09> { [ l, L ] };
key <AD10> { [ semicolon, colon ] };
key <AC03> { [ t, T ] };
key <AC04> { [ r, R ] };
key <AC07> { [ n, N ] };
key <AC08> { [ e, E ] };
key <AC09> { [ o, O ] };
key <AC10> { [ p, P ] };
key <AB06> { [ j, J ] };
include "level3(ralt_switch_multikey)"
};

View File

@@ -0,0 +1,73 @@
{ config, lib, pkgs, ... }:
let
cfg = config.opts.tools;
in
{
options = {
opts.tools = {
enable = lib.mkEnableOption "common tools";
ide.enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "jetbrains and other visual IDEs";
};
dev.enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "programming languages and environments";
};
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs;[
dust
eza
fastfetch
fd
helix
micro
openssl
ripgrep
starship
tealdeer
transcrypt
] ++
lib.optionals cfg.ide.enable [
# jetbrains.rust-rover
# jetbrains.goland
jetbrains.clion
jetbrains.idea-ultimate
jetbrains.pycharm-professional
jetbrains.webstorm
android-studio
zed-editor
] ++
lib.optionals cfg.dev.enable [
# Rust
rustup
# Python
python3
poetry
# Haskell
haskellPackages.ghc
haskellPackages.stack
# Node
nodejs_22
pnpm
bun
# Nix
nil
nixd
nixfmt-rfc-style
# Gleam
gleam
beamMinimal26Packages.erlang
];
};
}