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,12 +1,13 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all coding tools";
optionPath = [
"coding"
"all"
];
config' = {
let
cfg = config.my.coding.all;
in
{
options.my.coding.all = {
enable = lib.mkEnableOption "all coding tools";
};
config = lib.mkIf cfg.enable {
my.coding = {
editor.all.enable = true;
langs.all.enable = true;

View File

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

View File

@@ -4,15 +4,15 @@
pkgs,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "neovim";
optionPath = [
"coding"
"editor"
"neovim"
];
extraConfig = {
let
cfg = config.my.coding.editor.neovim;
in
{
options.my.coding.editor.neovim = {
enable = lib.mkEnableOption "neovim";
};
config = lib.mkIf cfg.enable {
my.hm = {
xdg.configFile."nvim/init.lua".source = ./nvim/init.lua;
xdg.configFile."nvim/lua" = {

View File

@@ -4,15 +4,16 @@
pkgs,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "vscode";
optionPath = [
"coding"
"editor"
"vscode"
];
extraConfig = {
let
cfg = config.my.coding.editor.vscode;
in
{
options.my.coding.editor.vscode = {
enable = lib.mkEnableOption "vscode";
};
config = lib.mkIf cfg.enable {
my.hm.programs.vscode.enable = true;
my.hm = {
programs.vscode = {
package = pkgs.vscodium;

View File

@@ -3,15 +3,16 @@
lib,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "zed-editor";
optionPath = [
"coding"
"editor"
"zed"
];
extraConfig = {
let
cfg = config.my.coding.editor.zed;
in
{
options.my.coding.editor.zed = {
enable = lib.mkEnableOption "zed-editor";
};
config = lib.mkIf cfg.enable {
my.hm.programs.zed-editor.enable = true;
my.persist.homeDirs = [
".config/zed"
".local/share/zed"

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

View File

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