From 3659dc3e50bbac4d9b2bb853872f628c304346e7 Mon Sep 17 00:00:00 2001 From: luochen570 <1160510664@qq.com> Date: Sat, 28 Feb 2026 10:21:32 +0800 Subject: [PATCH] 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 --- .sops.yaml | 2 +- flake.nix | 16 +-- home/git.nix | 6 +- home/nvchad.nix | 56 ++++----- home/ssh.nix | 4 + home/zsh.nix | 120 ++++++++++---------- hosts/virtualbox/README.md | 11 ++ hosts/virtualbox/configuration.nix | 11 ++ hosts/virtualbox/default.nix | 7 ++ hosts/virtualbox/hardware-configuration.nix | 29 +++++ lib/hosts.nix | 7 +- modules/core/README.md | 1 + modules/core/core.nix | 30 +++++ modules/core/default.nix | 45 +------- modules/core/pkg.nix | 12 ++ modules/core/sops.nix | 5 + modules/desktop/README.md | 3 +- modules/desktop/apps.nix | 15 +-- modules/desktop/default.nix | 4 +- modules/desktop/fcitx5.nix | 20 ++++ modules/desktop/pkg.nix | 12 ++ modules/server/README.md | 8 +- modules/server/default.nix | 1 + modules/server/docker.nix | 4 +- modules/server/pkg.nix | 6 + modules/server/ssh.nix | 4 +- modules/server/virtualbox-guest.nix | 6 + modules/server/vscode-server.nix | 13 +++ modules/wsl/configuration.nix | 3 +- profiles/virtualbox.nix | 10 ++ profiles/wsl.nix | 1 + secrets/users/README.md | 1 + secrets/users/luochen570.enc.yaml.example | 4 + 33 files changed, 312 insertions(+), 165 deletions(-) create mode 100644 hosts/virtualbox/README.md create mode 100644 hosts/virtualbox/configuration.nix create mode 100644 hosts/virtualbox/default.nix create mode 100644 hosts/virtualbox/hardware-configuration.nix create mode 100644 modules/core/core.nix create mode 100644 modules/core/pkg.nix create mode 100644 modules/desktop/fcitx5.nix create mode 100644 modules/desktop/pkg.nix create mode 100644 modules/server/pkg.nix create mode 100644 modules/server/virtualbox-guest.nix create mode 100644 modules/server/vscode-server.nix create mode 100644 profiles/virtualbox.nix diff --git a/.sops.yaml b/.sops.yaml index 41504d9..274d677 100644 --- a/.sops.yaml +++ b/.sops.yaml @@ -2,4 +2,4 @@ creation_rules: - path_regex: ^secrets/users/.*\.ya?ml$ key_groups: - age: - - age1REPLACE_WITH_YOUR_AGE_PUBLIC_KEY + - age1REPLACE_WITH_YOUR_AGE_PUBLIC_KEY diff --git a/flake.nix b/flake.nix index 7cca9cc..78c3812 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { description = "My Infra"; - + inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; @@ -8,12 +8,12 @@ url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - - nix4nvchad = { - url = "github:nix-community/nix4nvchad"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - + + nix4nvchad = { + url = "github:nix-community/nix4nvchad"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; vscode-server.url = "github:nix-community/nixos-vscode-server"; @@ -23,7 +23,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; - + outputs = inputs@{ nixpkgs, home-manager, ... }: let username = "luochen570"; diff --git a/home/git.nix b/home/git.nix index bbc9b55..75037c2 100644 --- a/home/git.nix +++ b/home/git.nix @@ -6,8 +6,8 @@ user = { name = "luochen570"; email = "1160510664@qq.com"; - }; - init.defaultBranch = "main"; - }; + }; + init.defaultBranch = "main"; + }; }; } diff --git a/home/nvchad.nix b/home/nvchad.nix index 06d2b48..fe38620 100644 --- a/home/nvchad.nix +++ b/home/nvchad.nix @@ -1,29 +1,29 @@ -{ config, pkgs, inputs, system, ... }: -{ - # 导入 NvChad 模块 - imports = [ - inputs.nix4nvchad.homeManagerModules.default - ]; - - programs.nvchad = { - enable = true; - - # 可选:添加你需要的语言服务器和工具 - extraPackages = with pkgs; [ - # LSP 服务器 - nil # Nix LSP - nixd # Nix 语言服务器(另一种选择) - marksman # Markdown LSP - - # 格式化工具 - nixpkgs-fmt - shfmt - ]; - }; - - # 设置默认编辑器 - home.sessionVariables = { - EDITOR = "nvim"; - VISUAL = "nvim"; - }; +{ config, pkgs, inputs, system, ... }: +{ + # 导入 NvChad 模块 + imports = [ + inputs.nix4nvchad.homeManagerModules.default + ]; + + programs.nvchad = { + enable = true; + + # 可选:添加你需要的语言服务器和工具 + extraPackages = with pkgs; [ + # LSP 服务器 + nil # Nix LSP + nixd # Nix 语言服务器(另一种选择) + marksman # Markdown LSP + + # 格式化工具 + nixpkgs-fmt + shfmt + ]; + }; + + # 设置默认编辑器 + home.sessionVariables = { + EDITOR = "nvim"; + VISUAL = "nvim"; + }; } \ No newline at end of file diff --git a/home/ssh.nix b/home/ssh.nix index 6d61ac8..07e7fbe 100644 --- a/home/ssh.nix +++ b/home/ssh.nix @@ -2,6 +2,10 @@ { programs.ssh.enable = true; + # ~/.ssh/id_rsa comes from a sops secret file. + home.file.".ssh/id_rsa".source = + config.lib.file.mkOutOfStoreSymlink "/run/secrets/users/luochen570/ssh_private_key"; + # ~/.ssh/config comes from a sops secret file. home.file.".ssh/config".source = config.lib.file.mkOutOfStoreSymlink "/run/secrets/users/luochen570/ssh_config"; diff --git a/home/zsh.nix b/home/zsh.nix index 2fcac42..f5142ce 100644 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -1,61 +1,61 @@ -{ config, pkgs, inputs, system, ... }: -{ programs.zsh = { - enable = true; - enableCompletion = true; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - # initContent = "source ~/.p10k.zsh"; - plugins = [ - { - name = "powerlevel10k"; - src = pkgs.zsh-powerlevel10k; - file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; - } - { - name = "fzf-tab"; - src = "${pkgs.zsh-fzf-tab}/share/fzf-tab"; - } - # { - # name = "powerlevel10k-config"; - # src = "/home/luochen570/nixos-config/modules/home/p10k/"; - # file = "p10k.zsh"; - # } - ]; - # 设置alias - shellAliases = { - # Git相关 - gc1 = "git clone --recursive --depth=1"; - - # 目录操作 - md = "mkdir -p"; - "..." = "../.."; - "...." = "../../.."; - "....." = "../../../.."; - "......" = "../../../../.."; - - # eza/ls替代 - ls = "eza --color=auto"; - l = "eza -lbah --icons=auto"; - la = "eza -labgh --icons=auto"; - ll = "eza -lbg --icons=auto"; - lt = "eza -lTbg --icons=auto"; - lsa = "eza -lbagR --icons=auto"; - lst = "eza -lTabgh --icons=auto"; - - # bat/cat替代 - cat = "bat -pp"; - ccat = "cat"; - }; - - oh-my-zsh = { - enable = true; - plugins = [ - "sudo" - "z" - "extract" - "git" - # "fzf-tab" - ]; - }; - }; +{ config, pkgs, inputs, system, ... }: +{ programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + # initContent = "source ~/.p10k.zsh"; + plugins = [ + { + name = "powerlevel10k"; + src = pkgs.zsh-powerlevel10k; + file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; + } + { + name = "fzf-tab"; + src = "${pkgs.zsh-fzf-tab}/share/fzf-tab"; + } + # { + # name = "powerlevel10k-config"; + # src = "/home/luochen570/nixos-config/modules/home/p10k/"; + # file = "p10k.zsh"; + # } + ]; + # 设置alias + shellAliases = { + # Git相关 + gc1 = "git clone --recursive --depth=1"; + + # 目录操作 + md = "mkdir -p"; + "..." = "../.."; + "...." = "../../.."; + "....." = "../../../.."; + "......" = "../../../../.."; + + # eza/ls替代 + ls = "eza --color=auto"; + l = "eza -lbah --icons=auto"; + la = "eza -labgh --icons=auto"; + ll = "eza -lbg --icons=auto"; + lt = "eza -lTbg --icons=auto"; + lsa = "eza -lbagR --icons=auto"; + lst = "eza -lTabgh --icons=auto"; + + # bat/cat替代 + cat = "bat -pp"; + ccat = "cat"; + }; + + oh-my-zsh = { + enable = true; + plugins = [ + "sudo" + "z" + "extract" + "git" + # "fzf-tab" + ]; + }; + }; } \ No newline at end of file diff --git a/hosts/virtualbox/README.md b/hosts/virtualbox/README.md new file mode 100644 index 0000000..600d8ec --- /dev/null +++ b/hosts/virtualbox/README.md @@ -0,0 +1,11 @@ +# hosts/virtualbox + +VirtualBox guest host entry. + +## Layout +```text +hosts/virtualbox +|- default.nix # host entry, imports configuration.nix +|- configuration.nix # profile + hostName + machine specific options +`- README.md +``` \ No newline at end of file diff --git a/hosts/virtualbox/configuration.nix b/hosts/virtualbox/configuration.nix new file mode 100644 index 0000000..228a715 --- /dev/null +++ b/hosts/virtualbox/configuration.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + imports = [ + ../../profiles/virtualbox.nix + ]; + + networking.hostName = "virtualbox"; + + # Machine-specific config generated by nixos-generate-config can be + # merged here: disk layout, boot loader, filesystem, hardware options. +} \ No newline at end of file diff --git a/hosts/virtualbox/default.nix b/hosts/virtualbox/default.nix new file mode 100644 index 0000000..863ca48 --- /dev/null +++ b/hosts/virtualbox/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./configuration.nix + ./hardware-configuration.nix + ]; +} \ No newline at end of file diff --git a/hosts/virtualbox/hardware-configuration.nix b/hosts/virtualbox/hardware-configuration.nix new file mode 100644 index 0000000..320b3a0 --- /dev/null +++ b/hosts/virtualbox/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "ohci_pci" "ehci_pci" "ahci" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/31ec1b9d-9138-4051-86ed-51dc63f2619b"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/935D-FCF6"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + virtualisation.virtualbox.guest.enable = true; +} diff --git a/lib/hosts.nix b/lib/hosts.nix index 1d532ef..582bdda 100644 --- a/lib/hosts.nix +++ b/lib/hosts.nix @@ -13,4 +13,9 @@ system = "x86_64-linux"; profile = "wsl"; }; -} + + virtualbox = { + system = "x86_64-linux"; + profile = "virtualbox"; + }; +} \ No newline at end of file diff --git a/modules/core/README.md b/modules/core/README.md index 20cac56..4e7099b 100644 --- a/modules/core/README.md +++ b/modules/core/README.md @@ -6,6 +6,7 @@ ```text 🧭 modules/core ├─ 🧩 default.nix # 基础 imports + 时区/镜像源/flakes 等默认设置 +├─ 📦 pkg.nix # 全局基础软件包 ├─ 👤 users.nix # 用户、默认 shell、密码与公钥 └─ 🔐 sops.nix # sops-nix secret 映射 ``` diff --git a/modules/core/core.nix b/modules/core/core.nix new file mode 100644 index 0000000..5ac6c5b --- /dev/null +++ b/modules/core/core.nix @@ -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"; +} \ No newline at end of file diff --git a/modules/core/default.nix b/modules/core/default.nix index 5189b95..1944213 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -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"; -} - +} \ No newline at end of file diff --git a/modules/core/pkg.nix b/modules/core/pkg.nix new file mode 100644 index 0000000..30ea539 --- /dev/null +++ b/modules/core/pkg.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + curl + eza + git + htop + ranger + vim + wget + ]; +} diff --git a/modules/core/sops.nix b/modules/core/sops.nix index 6396de2..7867b79 100644 --- a/modules/core/sops.nix +++ b/modules/core/sops.nix @@ -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"; diff --git a/modules/desktop/README.md b/modules/desktop/README.md index bf6c076..90716ba 100644 --- a/modules/desktop/README.md +++ b/modules/desktop/README.md @@ -5,8 +5,9 @@ ## 🌲 目录树 ```text 🖥️ modules/desktop -├─ 📦 default.nix # 聚合入口(de + apps) +├─ 📦 default.nix # 聚合入口(de + pkg + apps) ├─ 🧭 de/ # 桌面环境模块(例如 KDE) ├─ 🪟 wm/ # 窗口管理器模块(预留) +├─ 📦 pkg.nix # 桌面软件包 └─ 📱 apps.nix # 桌面应用与默认浏览器关联 ``` diff --git a/modules/desktop/apps.nix b/modules/desktop/apps.nix index 79b2401..0cc5a64 100644 --- a/modules/desktop/apps.nix +++ b/modules/desktop/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" ]; }; -} +} \ No newline at end of file diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index ea75343..95c221b 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -2,6 +2,8 @@ { imports = [ ./de + ./pkg.nix ./apps.nix + ./fcitx5.nix ]; -} +} \ No newline at end of file diff --git a/modules/desktop/fcitx5.nix b/modules/desktop/fcitx5.nix new file mode 100644 index 0000000..1fd1758 --- /dev/null +++ b/modules/desktop/fcitx5.nix @@ -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"; + }; +} \ No newline at end of file diff --git a/modules/desktop/pkg.nix b/modules/desktop/pkg.nix new file mode 100644 index 0000000..f5f4fd7 --- /dev/null +++ b/modules/desktop/pkg.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + firefox + google-chrome + linuxqq + wechat-uos + xterm + kdePackages.kate + kdePackages.konsole + ]; +} diff --git a/modules/server/README.md b/modules/server/README.md index 5573b67..aee0c7a 100644 --- a/modules/server/README.md +++ b/modules/server/README.md @@ -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 模块 ``` diff --git a/modules/server/default.nix b/modules/server/default.nix index 6ca2df7..31ad1b0 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./pkg.nix ./docker.nix ./ssh.nix ]; diff --git a/modules/server/docker.nix b/modules/server/docker.nix index 3bdbe4c..2d04223 100644 --- a/modules/server/docker.nix +++ b/modules/server/docker.nix @@ -7,5 +7,5 @@ dates = "weekly"; }; }; -} - +} + diff --git a/modules/server/pkg.nix b/modules/server/pkg.nix new file mode 100644 index 0000000..d191dc0 --- /dev/null +++ b/modules/server/pkg.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + jq + ]; +} diff --git a/modules/server/ssh.nix b/modules/server/ssh.nix index 2ce04d2..9ba5b0f 100644 --- a/modules/server/ssh.nix +++ b/modules/server/ssh.nix @@ -10,5 +10,5 @@ }; openFirewall = true; }; -} - +} + diff --git a/modules/server/virtualbox-guest.nix b/modules/server/virtualbox-guest.nix new file mode 100644 index 0000000..5bfda41 --- /dev/null +++ b/modules/server/virtualbox-guest.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + # virtualbox-guest + virtualisation.virtualbox.guest.enable = true; + virtualisation.virtualbox.guest.dragAndDrop = true; +} \ No newline at end of file diff --git a/modules/server/vscode-server.nix b/modules/server/vscode-server.nix new file mode 100644 index 0000000..0c7f738 --- /dev/null +++ b/modules/server/vscode-server.nix @@ -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; +} diff --git a/modules/wsl/configuration.nix b/modules/wsl/configuration.nix index ec7753e..2d03b42 100644 --- a/modules/wsl/configuration.nix +++ b/modules/wsl/configuration.nix @@ -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" ]; } diff --git a/profiles/virtualbox.nix b/profiles/virtualbox.nix new file mode 100644 index 0000000..180d283 --- /dev/null +++ b/profiles/virtualbox.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + imports = [ + ../modules/core + ../modules/desktop + ../modules/server/ssh.nix + ../modules/server/virtualbox-guest.nix + ../modules/server/vscode-server.nix + ]; +} \ No newline at end of file diff --git a/profiles/wsl.nix b/profiles/wsl.nix index 6bfa2e1..278e17c 100644 --- a/profiles/wsl.nix +++ b/profiles/wsl.nix @@ -3,6 +3,7 @@ imports = [ ../modules/core ../modules/wsl + ../modules/server/ssh.nix ]; networking.firewall.enable = false; diff --git a/secrets/users/README.md b/secrets/users/README.md index 751cfa7..cbd933e 100644 --- a/secrets/users/README.md +++ b/secrets/users/README.md @@ -12,3 +12,4 @@ ## 🔐 本地源文件(Git 黑名单) - 你可以在本目录维护 `*.source` 文件作为本地敏感源文件(例如真实域名和 IP)。 - 这些文件已被仓库 `.gitignore` 屏蔽,不会被 Git 收集和推送。 +- 示例:`luochen570.ssh_config.source`、`luochen570.id_rsa.source` diff --git a/secrets/users/luochen570.enc.yaml.example b/secrets/users/luochen570.enc.yaml.example index 9ef05ba..e8865db 100644 --- a/secrets/users/luochen570.enc.yaml.example +++ b/secrets/users/luochen570.enc.yaml.example @@ -4,6 +4,10 @@ users: luochen570: authorized_key: "ssh-rsa AAAA... your-comment" + ssh_private_key: | + -----BEGIN OPENSSH PRIVATE KEY----- + + -----END OPENSSH PRIVATE KEY----- passwordHash: "REPLACE_WITH_mkpasswd_HASH" ssh_config: | # ~/.ssh/config