feat: massive refactor

This commit is contained in:
2025-12-20 12:57:47 +08:00
parent f4c1b313ce
commit 454ad5885d
97 changed files with 1023 additions and 960 deletions

View File

@@ -1,13 +1,13 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all coding langs";
optionPath = [
"coding"
"langs"
"all"
];
config' = {
let
cfg = config.my.coding.langs.all;
in
{
options.my.coding.langs.all = {
enable = lib.mkEnableOption "all coding langs";
};
config = lib.mkIf cfg.enable {
my.coding.langs = {
c.enable = true;
go.enable = true;

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "c";
optionPath = [
"coding"
"langs"
"c"
];
config' = {
let
cfg = config.my.coding.langs.c;
in
{
options.my.coding.langs.c = {
enable = lib.mkEnableOption "c";
};
config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [
gcc
(lib.hiPrio clang)

View File

@@ -4,17 +4,17 @@
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "go";
packagePath = [ "go" ];
optionPath = [
"coding"
"langs"
"go"
];
extraConfig = {
let
cfg = config.my.coding.langs.go;
in
{
options.my.coding.langs.go = {
enable = lib.mkEnableOption "go";
};
config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [
go
gotools
gopls
];

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "java";
optionPath = [
"coding"
"langs"
"java"
];
config' = {
let
cfg = config.my.coding.langs.java;
in
{
options.my.coding.langs.java = {
enable = lib.mkEnableOption "java";
};
config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [
openjdk25
java-language-server

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "js";
optionPath = [
"coding"
"langs"
"js"
];
config' = {
let
cfg = config.my.coding.langs.js;
in
{
options.my.coding.langs.js = {
enable = lib.mkEnableOption "js";
};
config = lib.mkIf cfg.enable {
my.hm = {
home.packages = with pkgs; [
nodejs

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "lua";
optionPath = [
"coding"
"langs"
"lua"
];
config' = {
let
cfg = config.my.coding.langs.lua;
in
{
options.my.coding.langs.lua = {
enable = lib.mkEnableOption "lua";
};
config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [
luajit
stylua

View File

@@ -4,17 +4,17 @@
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "python3";
packagePath = [ "python3" ];
optionPath = [
"coding"
"langs"
"python"
];
extraConfig = {
let
cfg = config.my.coding.langs.python;
in
{
options.my.coding.langs.python = {
enable = lib.mkEnableOption "python3";
};
config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [
python3
uv
pyright
];

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "QML";
optionPath = [
"coding"
"langs"
"qml"
];
config' = {
let
cfg = config.my.coding.langs.qml;
in
{
options.my.coding.langs.qml = {
enable = lib.mkEnableOption "QML";
};
config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [
kdePackages.qtdeclarative
];

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "rust";
optionPath = [
"coding"
"langs"
"rust"
];
config' = {
let
cfg = config.my.coding.langs.rust;
in
{
options.my.coding.langs.rust = {
enable = lib.mkEnableOption "rust";
};
config = lib.mkIf cfg.enable {
my.hm = {
home.packages = with pkgs; [
(fenix.stable.withComponents [

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "Typst";
optionPath = [
"coding"
"langs"
"typst"
];
config' = {
let
cfg = config.my.coding.langs.typst;
in
{
options.my.coding.langs.typst = {
enable = lib.mkEnableOption "Typst";
};
config = lib.mkIf cfg.enable {
my.hm.home.packages = with pkgs; [
typst
tinymist