refactor: gate ssh sops symlinks, follow nixos-wsl, fix CRLF
- home/ssh.nix: only create /run/secrets symlinks when secrets exist - flake.nix: nixos-wsl explicit nixpkgs follows - fix CRLF line endings: nvchad.nix, virtualbox-guest.nix, docker.nix
This commit is contained in:
@@ -1,28 +1,28 @@
|
|||||||
{ config, pkgs, inputs, system, ... }:
|
{ config, pkgs, inputs, system, ... }:
|
||||||
{
|
{
|
||||||
# 导入 NvChad 模块
|
# 导入 NvChad 模块
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nix4nvchad.homeManagerModules.default
|
inputs.nix4nvchad.homeManagerModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.nvchad = {
|
programs.nvchad = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
# NvChad 需要的额外包
|
# NvChad 需要的额外包
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
# LSP 服务器
|
# LSP 服务器
|
||||||
nil # Nix LSP
|
nil # Nix LSP
|
||||||
marksman # Markdown LSP
|
marksman # Markdown LSP
|
||||||
|
|
||||||
# 格式化工具
|
# 格式化工具
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
shfmt
|
shfmt
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# 设置默认编辑器
|
# 设置默认编辑器
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
VISUAL = "nvim";
|
VISUAL = "nvim";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
20
home/ssh.nix
20
home/ssh.nix
@@ -1,12 +1,18 @@
|
|||||||
{ config, ... }:
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
# 与 modules/core/sops.nix 保持同一开关:secrets 文件存在时才启用。
|
||||||
|
secretsEnabled = builtins.pathExists ../../secrets/users/luochen570.enc.yaml;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
programs.ssh.enable = true;
|
programs.ssh.enable = true;
|
||||||
|
|
||||||
# ~/.ssh/id_rsa 来自 sops secret 文件。
|
home.file = lib.mkIf secretsEnabled {
|
||||||
home.file.".ssh/id_rsa".source =
|
# ~/.ssh/id_rsa 来自 sops secret 文件。
|
||||||
config.lib.file.mkOutOfStoreSymlink "/run/secrets/users/luochen570/ssh_private_key";
|
".ssh/id_rsa".source =
|
||||||
|
config.lib.file.mkOutOfStoreSymlink "/run/secrets/users/luochen570/ssh_private_key";
|
||||||
|
|
||||||
# ~/.ssh/config 来自 sops secret 文件。
|
# ~/.ssh/config 来自 sops secret 文件。
|
||||||
home.file.".ssh/config".source =
|
".ssh/config".source =
|
||||||
config.lib.file.mkOutOfStoreSymlink "/run/secrets/users/luochen570/ssh_config";
|
config.lib.file.mkOutOfStoreSymlink "/run/secrets/users/luochen570/ssh_config";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
# VirtualBox Guest 增强支持
|
# VirtualBox Guest 增强支持
|
||||||
virtualisation.virtualbox.guest.enable = true;
|
virtualisation.virtualbox.guest.enable = true;
|
||||||
virtualisation.virtualbox.guest.dragAndDrop = true;
|
virtualisation.virtualbox.guest.dragAndDrop = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user