feat: modify wsl config

This commit is contained in:
2025-04-18 09:20:15 +08:00
parent f8b0337060
commit 0f61cc5118
4 changed files with 26 additions and 11 deletions

View File

@@ -1,9 +1,11 @@
keys:
- &imxyy-nix age1jf5pg2x6ta8amj40xdy0stvcvrdlkwc2nrwtmkpymu0qclk0eg5qmm9kns
- &imxyy-nix-server age1hpgg6psejh4y6jcdd34wxuml75fnweqpe0kh8376yqsctsfn9qxs037kk6
- &imxyy-cloudwin age1tp7th3rrv3x0l6jl76n0hjqjp223w2y586pkgr0hcjwdm254jd5shkj6a8
creation_rules:
- path_regex: secrets/.*\.(yaml|toml|json|env|dae|txt)$
key_groups:
- age:
- *imxyy-nix
- *imxyy-nix-server
- *imxyy-cloudwin

View File

@@ -1,13 +1,13 @@
{ ... }:
{ username, ... }:
{
my.home.programs.zsh.shellAliases = {
localproxy_on = "export http_proxy=http://192.168.128.1:7890 https_proxy=http://192.168.128.1:7890 all_proxy=socks://192.168.128.1:7890";
};
my = {
sops.sshKeyPath = "/home/${username}/.ssh/id_ed25519";
coding.all.enable = true;
cmd.misc.enable = true;
xdg.enable = true;
cmd.media.all.enable = true;
desktop.media.all.enable = true;
};
}

View File

@@ -14,4 +14,7 @@
PasswordAuthentication = true;
};
};
# fix vscode remote
programs.nix-ld.enable = true;
}

View File

@@ -1,24 +1,34 @@
{
lib,
config,
pkgs,
lib,
username,
...
}:
lib.my.makeSwitch {
inherit config;
default = true;
optionName = "sops secret settings";
optionPath = [ "sops" ];
config' = {
let
cfg = config.my.sops;
in
{
options.my.sops = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
};
sshKeyPath = lib.mkOption {
type = lib.types.str;
default = "/persistent/home/${username}/.ssh/id_ed25519";
};
};
config = lib.mkIf cfg.enable {
sops.age.sshKeyPaths = [
"/persistent/home/${username}/.ssh/id_ed25519"
cfg.sshKeyPath
];
users.users.${username}.extraGroups = [ "keys" ];
environment.variables.SOPS_AGE_KEY_FILE = "/run/secrets.d/age-keys.txt";
my.home = {
sops.age.sshKeyPaths = [
"/persistent/home/${username}/.ssh/id_ed25519"
cfg.sshKeyPath
];
home.packages = [
pkgs.sops