init: public
This commit is contained in:
20
modules/coding/langs/all.nix
Normal file
20
modules/coding/langs/all.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
22
modules/coding/langs/c.nix
Normal file
22
modules/coding/langs/c.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
12
modules/coding/langs/default.nix
Normal file
12
modules/coding/langs/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./all.nix
|
||||
./c.nix
|
||||
./go.nix
|
||||
./js.nix
|
||||
./rust.nix
|
||||
./python.nix
|
||||
./lua.nix
|
||||
];
|
||||
}
|
||||
21
modules/coding/langs/go.nix
Normal file
21
modules/coding/langs/go.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
||||
33
modules/coding/langs/js.nix
Normal file
33
modules/coding/langs/js.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
||||
20
modules/coding/langs/lua.nix
Normal file
20
modules/coding/langs/lua.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
21
modules/coding/langs/python.nix
Normal file
21
modules/coding/langs/python.nix
Normal 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
|
||||
];
|
||||
};
|
||||
}
|
||||
42
modules/coding/langs/rust.nix
Normal file
42
modules/coding/langs/rust.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user