init: public

This commit is contained in:
2025-04-13 15:09:14 +08:00
parent 5995c2050b
commit 50247d94e8
253 changed files with 12964 additions and 567 deletions

View File

@@ -0,0 +1,20 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all coding langs";
optionPath = [
"coding"
"langs"
"all"
];
config' = {
my.coding.langs = {
c.enable = true;
go.enable = true;
js.enable = true;
python.enable = true;
rust.enable = true;
lua.enable = true;
};
};
}

View File

@@ -0,0 +1,22 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "c";
optionPath = [
"coding"
"langs"
"c"
];
config' = {
my.home.home.packages = with pkgs; [
gcc
clang-tools
cmake
];
};
}

View File

@@ -0,0 +1,12 @@
{ ... }:
{
imports = [
./all.nix
./c.nix
./go.nix
./js.nix
./rust.nix
./python.nix
./lua.nix
];
}

View File

@@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "go";
packagePath = [ "go" ];
optionPath = [
"coding"
"langs"
"go"
];
extraConfig = {
my.persist.homeDirs = [
"go"
];
};
}

View File

@@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "js";
optionPath = [
"coding"
"langs"
"js"
];
config' = {
my.home = {
home.packages = with pkgs; [
nodejs
nodePackages.npm
typescript
];
home.file.".npmrc".text = ''
prefix = ''${HOME}/.npm-global
registry = https://registry.npmmirror.com
'';
};
my.persist.homeDirs = [
".npm"
".npm-global"
];
};
}

View File

@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "lua";
optionPath = [
"coding"
"langs"
"lua"
];
config' = {
my.home.home.packages = with pkgs; [
luajit
];
};
}

View File

@@ -0,0 +1,21 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeHomePackageConfig {
inherit config pkgs;
packageName = "python3";
packagePath = [ "python3" ];
optionPath = [
"coding"
"langs"
"python"
];
extraConfig = {
my.home.home.packages = with pkgs; [
uv
];
};
}

View File

@@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "rust";
optionPath = [
"coding"
"langs"
"rust"
];
config' = {
my.home = {
home.packages = with pkgs; [
(fenix.stable.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
])
evcxr # rust repl
];
home.file.".cargo/config.toml".text = ''
[source.crates-io]
replace-with = 'rsproxy-sparse'
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[net]
git-fetch-with-cli = true
'';
};
my.persist.homeDirs = [
".cargo"
];
};
}