modified: .sops.yaml
modified: flake.nix modified: home/git.nix modified: home/nvchad.nix modified: home/ssh.nix modified: home/zsh.nix new file: hosts/virtualbox/README.md new file: hosts/virtualbox/configuration.nix new file: hosts/virtualbox/default.nix new file: hosts/virtualbox/hardware-configuration.nix modified: lib/hosts.nix modified: modules/core/README.md new file: modules/core/core.nix modified: modules/core/default.nix new file: modules/core/pkg.nix modified: modules/core/sops.nix modified: modules/desktop/README.md modified: modules/desktop/apps.nix modified: modules/desktop/default.nix new file: modules/desktop/fcitx5.nix new file: modules/desktop/pkg.nix modified: modules/server/README.md modified: modules/server/default.nix modified: modules/server/docker.nix new file: modules/server/pkg.nix modified: modules/server/ssh.nix new file: modules/server/virtualbox-guest.nix new file: modules/server/vscode-server.nix modified: modules/wsl/configuration.nix new file: profiles/virtualbox.nix modified: profiles/wsl.nix modified: secrets/users/README.md modified: secrets/users/luochen570.enc.yaml.example
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
```text
|
||||
🧭 modules/core
|
||||
├─ 🧩 default.nix # 基础 imports + 时区/镜像源/flakes 等默认设置
|
||||
├─ 📦 pkg.nix # 全局基础软件包
|
||||
├─ 👤 users.nix # 用户、默认 shell、密码与公钥
|
||||
└─ 🔐 sops.nix # sops-nix secret 映射
|
||||
```
|
||||
|
||||
30
modules/core/core.nix
Normal file
30
modules/core/core.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbtr1HEhF2M7wP6+jJj6Jm23UM="
|
||||
];
|
||||
};
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d";
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
time.timeZone = lib.mkDefault "Asia/Shanghai";
|
||||
i18n.defaultLocale = lib.mkDefault "zh_CN.UTF-8";
|
||||
|
||||
networking.firewall.enable = lib.mkDefault true;
|
||||
|
||||
system.stateVersion = lib.mkDefault "25.05";
|
||||
}
|
||||
@@ -1,46 +1,9 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./core.nix
|
||||
./pkg.nix
|
||||
./users.nix
|
||||
./sops.nix
|
||||
];
|
||||
|
||||
nix.settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
auto-optimise-store = true;
|
||||
substituters = [
|
||||
"https://cache.nixos.org"
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store"
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store"
|
||||
];
|
||||
trusted-public-keys = [
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbtr1HEhF2M7wP6+jJj6Jm23UM="
|
||||
];
|
||||
};
|
||||
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 14d";
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
time.timeZone = lib.mkDefault "Asia/Shanghai";
|
||||
i18n.defaultLocale = lib.mkDefault "zh_CN.UTF-8";
|
||||
|
||||
networking.firewall.enable = lib.mkDefault true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
eza
|
||||
git
|
||||
htop
|
||||
ranger
|
||||
vim
|
||||
wget
|
||||
];
|
||||
|
||||
system.stateVersion = lib.mkDefault "25.05";
|
||||
}
|
||||
|
||||
}
|
||||
12
modules/core/pkg.nix
Normal file
12
modules/core/pkg.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
eza
|
||||
git
|
||||
htop
|
||||
ranger
|
||||
vim
|
||||
wget
|
||||
];
|
||||
}
|
||||
@@ -11,6 +11,11 @@ in
|
||||
defaultSopsFile = secretFile;
|
||||
secrets = lib.mkIf (builtins.pathExists secretFile) {
|
||||
"users/luochen570/authorized_key" = {};
|
||||
"users/luochen570/ssh_private_key" = {
|
||||
owner = "luochen570";
|
||||
group = "users";
|
||||
mode = "0400";
|
||||
};
|
||||
"users/luochen570/ssh_config" = {
|
||||
owner = "luochen570";
|
||||
group = "users";
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
## 🌲 目录树
|
||||
```text
|
||||
🖥️ modules/desktop
|
||||
├─ 📦 default.nix # 聚合入口(de + apps)
|
||||
├─ 📦 default.nix # 聚合入口(de + pkg + apps)
|
||||
├─ 🧭 de/ # 桌面环境模块(例如 KDE)
|
||||
├─ 🪟 wm/ # 窗口管理器模块(预留)
|
||||
├─ 📦 pkg.nix # 桌面软件包
|
||||
└─ 📱 apps.nix # 桌面应用与默认浏览器关联
|
||||
```
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
{ ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
firefox
|
||||
google-chrome
|
||||
linuxqq
|
||||
wechat-uos
|
||||
xterm
|
||||
kdePackages.kate
|
||||
kdePackages.konsole
|
||||
];
|
||||
|
||||
xdg.mime.enable = true;
|
||||
xdg.mime.defaultApplications = {
|
||||
"text/html" = [ "google-chrome.desktop" ];
|
||||
"application/xhtml+xml" = [ "google-chrome.desktop" ];
|
||||
"x-scheme-handler/http" = [ "google-chrome.desktop" ];
|
||||
"x-scheme-handler/https" = [ "google-chrome.desktop" ];
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
{
|
||||
imports = [
|
||||
./de
|
||||
./pkg.nix
|
||||
./apps.nix
|
||||
./fcitx5.nix
|
||||
];
|
||||
}
|
||||
}
|
||||
20
modules/desktop/fcitx5.nix
Normal file
20
modules/desktop/fcitx5.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
i18n.inputMethod = {
|
||||
enabled = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-rime
|
||||
fcitx5-configtool
|
||||
fcitx5-gtk
|
||||
fcitx5-chinese-addons
|
||||
];
|
||||
};
|
||||
|
||||
environment.sessionVariables = {
|
||||
GTK_IM_MODULE = "fcitx";
|
||||
QT_IM_MODULE = "fcitx";
|
||||
XMODIFIERS = "@im=fcitx";
|
||||
SDL_IM_MODULE = "fcitx";
|
||||
GLFW_IM_MODULE = "fcitx";
|
||||
};
|
||||
}
|
||||
12
modules/desktop/pkg.nix
Normal file
12
modules/desktop/pkg.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
firefox
|
||||
google-chrome
|
||||
linuxqq
|
||||
wechat-uos
|
||||
xterm
|
||||
kdePackages.kate
|
||||
kdePackages.konsole
|
||||
];
|
||||
}
|
||||
@@ -5,7 +5,9 @@
|
||||
## 🌲 目录树
|
||||
```text
|
||||
🗄️ modules/server
|
||||
├─ 📦 default.nix # 聚合入口
|
||||
├─ 🔐 ssh.nix # OpenSSH 参数
|
||||
└─ 🐳 docker.nix # Docker 与清理策略
|
||||
├─ 📦 default.nix # 聚合入口
|
||||
├─ 📦 pkg.nix # 服务器常用软件包
|
||||
├─ 🔐 ssh.nix # OpenSSH 参数
|
||||
├─ 🐳 docker.nix # Docker 与清理策略
|
||||
└─ 🧠 vscode-server.nix # VS Code Server 模块
|
||||
```
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./pkg.nix
|
||||
./docker.nix
|
||||
./ssh.nix
|
||||
];
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
dates = "weekly";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
6
modules/server/pkg.nix
Normal file
6
modules/server/pkg.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
jq
|
||||
];
|
||||
}
|
||||
@@ -10,5 +10,5 @@
|
||||
};
|
||||
openFirewall = true;
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
6
modules/server/virtualbox-guest.nix
Normal file
6
modules/server/virtualbox-guest.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
# virtualbox-guest
|
||||
virtualisation.virtualbox.guest.enable = true;
|
||||
virtualisation.virtualbox.guest.dragAndDrop = true;
|
||||
}
|
||||
13
modules/server/vscode-server.nix
Normal file
13
modules/server/vscode-server.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.vscode-server.nixosModules.default
|
||||
];
|
||||
|
||||
services.vscode-server.enable = true;
|
||||
|
||||
programs.direnv.enable = true;
|
||||
|
||||
# 允许未打补丁的动态二进制文件在 NixOS 上运行
|
||||
programs.nix-ld.enable = true;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
{
|
||||
imports = [
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
inputs.vscode-server.nixosModules.default
|
||||
../server/vscode-server.nix
|
||||
];
|
||||
|
||||
wsl = {
|
||||
@@ -10,6 +10,5 @@
|
||||
defaultUser = username;
|
||||
};
|
||||
|
||||
services.vscode-server.enable = true;
|
||||
users.users.${username}.extraGroups = [ "vscode" "docker" "wheel" ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user