modified: README.md
modified: flake.nix modified: home/README.md modified: home/ssh.nix modified: hosts/README.md modified: hosts/desktop/README.md modified: hosts/desktop/configuration.nix new file: hosts/nixos-lxc/README.md new file: hosts/nixos-lxc/configuration.nix renamed: modules/wsl/default.nix -> hosts/nixos-lxc/default.nix modified: hosts/server/README.md modified: hosts/server/configuration.nix modified: hosts/virtualbox/README.md modified: hosts/virtualbox/configuration.nix modified: hosts/virtualbox/hardware-configuration.nix modified: hosts/wsl/README.md modified: hosts/wsl/configuration.nix modified: lib/README.md modified: lib/hosts.nix modified: lib/mkHost.nix modified: modules/README.md modified: modules/core/README.md modified: modules/core/core.nix modified: modules/core/users.nix modified: modules/desktop/README.md modified: modules/desktop/de/README.md modified: modules/desktop/wm/README.md modified: modules/desktop/wm/default.nix modified: modules/drivers/README.md modified: modules/drivers/amdgpu.nix modified: modules/server/README.md modified: modules/server/default.nix new file: modules/server/firewall.nix modified: modules/server/pkg.nix modified: modules/server/ssh.nix modified: modules/server/virtualbox-guest.nix deleted: modules/wsl/README.md deleted: modules/wsl/configuration.nix modified: overlays/README.md modified: profiles/README.md modified: profiles/desktop.nix new file: profiles/lxc.nix modified: profiles/wsl.nix modified: secrets/README.md modified: secrets/users/README.md 添加了pve-lxc的配置文件 删除了wsl的配置文件
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# 🖥️ hosts 目录说明
|
||||
# 🖥️ hosts 目录说明
|
||||
|
||||
主机入口层。每台主机目录固定为三文件结构:
|
||||
- `default.nix`:统一入口,导入 `configuration.nix`
|
||||
@@ -16,13 +16,12 @@
|
||||
│ ├─ 🧩 default.nix
|
||||
│ ├─ ⚙️ configuration.nix
|
||||
│ └─ 📝 README.md
|
||||
├─ 📦 virtualbox/
|
||||
│ ├─ 🧩 default.nix
|
||||
│ ├─ ⚙️ configuration.nix
|
||||
│ ├─ 🧱 hardware-configuration.nix
|
||||
│ └─ 📝 README.md
|
||||
└─ 🪟 wsl/
|
||||
└─ 📦 virtualbox/
|
||||
├─ 🧩 default.nix
|
||||
├─ ⚙️ configuration.nix
|
||||
├─ 🧱 hardware-configuration.nix
|
||||
└─ 📝 README.md
|
||||
|
||||
```
|
||||
`r`n
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 🧑💻 hosts/desktop
|
||||
# 🧑💻 hosts/desktop
|
||||
|
||||
桌面主机入口。
|
||||
|
||||
@@ -9,3 +9,5 @@
|
||||
├─ ⚙️ configuration.nix # profile + hostName + 机器相关配置
|
||||
└─ 📝 README.md
|
||||
```
|
||||
`r`n
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
{ ... }:
|
||||
{
|
||||
# 可在此合并由 nixos-generate-config 生成的机器专属配置:
|
||||
# 磁盘布局、引导加载器、文件系统、硬件选项等。
|
||||
imports = [
|
||||
../../profiles/desktop.nix
|
||||
../../modules/drivers/nvidia.nix
|
||||
../../modules/drivers/amdgpu.nix
|
||||
];
|
||||
|
||||
networking.hostName = "desktop";
|
||||
|
||||
# Machine-specific config generated by nixos-generate-config can be
|
||||
# merged here: disk layout, boot loader, filesystem, hardware options.
|
||||
}
|
||||
|
||||
14
hosts/nixos-lxc/README.md
Normal file
14
hosts/nixos-lxc/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# 📦 hosts/nixos-lxc
|
||||
|
||||
Proxmox LXC 主机入口。
|
||||
|
||||
## 🌲 目录树
|
||||
```text
|
||||
hosts/nixos-lxc
|
||||
├─ default.nix
|
||||
├─ configuration.nix
|
||||
└─ README.md
|
||||
```
|
||||
`r`n
|
||||
|
||||
|
||||
42
hosts/nixos-lxc/configuration.nix
Normal file
42
hosts/nixos-lxc/configuration.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
||||
];
|
||||
|
||||
# 修复 LXC 挂载报错
|
||||
systemd.mounts = [
|
||||
{ where = "/sys/kernel/debug"; enable = false; }
|
||||
{ where = "/sys/fs/fuse/connections"; enable = false; }
|
||||
];
|
||||
systemd.services."sys-kernel-debug.mount".enable = false;
|
||||
|
||||
# 容器运行时设置
|
||||
nix.settings.sandbox = false;
|
||||
proxmoxLXC = {
|
||||
manageNetwork = false;
|
||||
privileged = true;
|
||||
};
|
||||
|
||||
# 由宿主机处理 fstrim
|
||||
services.fstrim.enable = false;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
PermitRootLogin = "yes";
|
||||
PasswordAuthentication = true;
|
||||
};
|
||||
};
|
||||
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
|
||||
services.resolved = {
|
||||
extraConfig = ''
|
||||
Cache=true
|
||||
CacheFromLocalhost=true
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
7
hosts/nixos-lxc/default.nix
Normal file
7
hosts/nixos-lxc/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./configuration.nix
|
||||
];
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# 🗄️ hosts/server
|
||||
# 🗄️ hosts/server
|
||||
|
||||
服务器主机入口。
|
||||
|
||||
@@ -9,3 +9,5 @@
|
||||
├─ ⚙️ configuration.nix # profile + hostName + 机器相关配置
|
||||
└─ 📝 README.md
|
||||
```
|
||||
`r`n
|
||||
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../../profiles/server.nix
|
||||
];
|
||||
|
||||
networking.hostName = "server";
|
||||
|
||||
# Machine-specific config generated by nixos-generate-config can be
|
||||
# merged here: disk layout, boot loader, filesystem, hardware options.
|
||||
# 可在此合并由 nixos-generate-config 生成的机器专属配置:
|
||||
# 磁盘布局、引导加载器、文件系统、硬件选项等。
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 📦 hosts/virtualbox
|
||||
# 📦 hosts/virtualbox
|
||||
|
||||
VirtualBox 虚拟机主机入口。
|
||||
|
||||
@@ -10,3 +10,5 @@ VirtualBox 虚拟机主机入口。
|
||||
├─ 🧱 hardware-configuration.nix # 由 nixos-generate-config 生成的硬件配置
|
||||
└─ 📝 README.md
|
||||
```
|
||||
`r`n
|
||||
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../../profiles/virtualbox.nix
|
||||
];
|
||||
|
||||
networking.hostName = "virtualbox";
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Machine-specific config generated by nixos-generate-config can be
|
||||
# merged here: disk layout, boot loader, filesystem, hardware options.
|
||||
# 可在此合并由 nixos-generate-config 生成的机器专属配置:
|
||||
# 磁盘布局、引导加载器、文件系统、硬件选项等。
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
# 请勿直接修改此文件!它由 `nixos-generate-config` 自动生成,
|
||||
# 后续再次执行生成命令时可能会被覆盖。请改动
|
||||
# /etc/nixos/configuration.nix。
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 🪟 hosts/wsl
|
||||
# 🪟 hosts/wsl
|
||||
|
||||
WSL 主机入口。
|
||||
|
||||
@@ -9,3 +9,5 @@ WSL 主机入口。
|
||||
├─ ⚙️ configuration.nix # profile + hostName(可加 WSL 机器项)
|
||||
└─ 📝 README.md
|
||||
```
|
||||
`r`n
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
../../profiles/wsl.nix
|
||||
inputs.nixos-wsl.nixosModules.default
|
||||
];
|
||||
|
||||
networking.hostName = "nixos-wsl";
|
||||
|
||||
# Keep minimal for WSL. Add machine-specific options here if needed.
|
||||
wsl = {
|
||||
enable = true;
|
||||
defaultUser = username;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user