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,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